EasyVision
EasyVision

EasyVision package

Submodules

EasyVision.base module

Base module containing Base and helper classes for all of EasyVision algorithms.

class EasyVision.base.EasyVisionBase(debug=False, display_results=False, fps_num_frames=30, *args, **kwargs)[source]

Bases: abc.ABC

EasyVisionBase is an abstract class for all EasyVision algorithms Contains simple setup/release, debug/display_results, setup/release and context functionality.

Uses __slots__ to conserve space, so derived classes can choose to continue using __slots__.

Implements these:
__enter__
Implements a context manager
__exit__
Implements a context manager
__next__
Implements an iterator for Python 3.7
__iter__
Implements an iterator
__len__
Allows to receive a preliminary number of frames available
__getattr__
Catches {ClassName}_fps and returns current fps
update_fps
Updates fps counter
name
Returns Derived Class name
Abstract methods:
next
For Python 2.7 compatibility. Implements iterator.
description
Must return a brief description of the algorithm.
setup
Must allocate resources.
release
Must deallocate resources.
Optional methods:
debug_changed
Being called when debug property value is changed
display_results_changed
Being called when display_results property value is changed
debug

Property specifying whether to perform some outpuf for debugging purposes

description

Abstract property. Should return a brief description of the algorithm.

display_results

Property specifying whether to display intermediate results

name

Returns the name of the class.

next()[source]

Abstract method. Legacy method for Python 2.7

release()[source]

Release method that should be called in order to release allocated resources.

This method should be used for resource deallocation and cleaning up. All derived classes must implement this method and call it using super after all the deallocation is complete. This is being handled if using the algorithm with “with” statement.

setup()[source]

Setup method that should be called before any call to __next__/capture/compute.

This method should be used for resource allocation, algorithm initialization, opening of devices, etc. All derived classes must implement this method and call it using super after all the initialization is complete. This is being handled if using the algorithm with “with” statement.

update_fps(now=None)[source]

Updates FPS counter

Parameters:now – optional datetime object. If set to None will use datetime.now() instead.
Returns:None
class EasyVision.base.FPSCounter(num_frames=30)[source]

Bases: object

Simple FPS Counter descriptor.

setting a datetime object or None to this descriptor will update fps. getting this descriptor will return calculated fps. deleting this descriptor will reset the counter

reset()[source]
update(now)[source]
class EasyVision.base.NamedTupleExtendHelper[source]

Bases: object

NamedTupleExtendedHelper is a helper Mixin style class that enables to extend namedtuple derived classes with fields

Implements:
__repr__
Builds a string representation of the object
_make
Make a new object from a sequence or iterable
_replace
Return a new object replacing specified fields with new values

example

MyBase = namedtuple('MyBase', 'a b')

class MyNamedTuple(MyBase):
    _fields = MyBase._fields + ('c')
    __slots__ = ()

    def __new__(cls, *args, **kwargs):
        return super(MyNamedTuple, self).__new__(*args, **kwargs)

    c = property(itemgetter(2), doc="Alias for field number 3")
class EasyVision.base.lru_cache(*args, **kwargs)[source]

Bases: object

Simple lru_cache analog for python 2.7 as python 3.x has it builtin

EasyVision.exceptions module

This module defines all the base exceptions used throughout EasyVision algorithms.

exception EasyVision.exceptions.EasyVisionError[source]

Bases: exceptions.Exception

General EasyVision exception

EasyVision.processorstackbuilder module

EasyVision.server module

Module contents

The main intent behind EasyVision Library is to create simple yet powerful vision framework for autonomous robots, that mainly run on NanoPi/RaspberryPi or any other embedded platforms that support Python and OpenCV.