JeVoisBase
1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Object detection using Coral Edge TPU. More...
Public Member Functions | |
def | __init__ (self) |
Constructor. More... | |
def | stringToRGBA (self, str) |
def | draw_objects (self, draw, objs, labels) |
def | process (self, inframe, outframe) |
JeVois main processing function. More... | |
def | processGUI (self, inframe, helper) |
Process function with GUI output. More... | |
def | get_objects (self, interpreter, score_threshold=-float('inf'), image_scale=(1.0, 1.0)) |
Modified from https://github.com/google-coral/pycoral/blob/master/pycoral/adapters/detect.py to avoid calling interpreter._get_full_signature_list() which does not seem to exist anymore... More... | |
Public Attributes | |
threshold | |
rgb | |
model | |
labels | |
interpreter | |
timer | |
Object detection using Coral Edge TPU.
More pre-trained models are available at https://coral.ai/models/
Definition at line 32 of file PyCoralDetect.py.
def PyCoralDetect.PyCoralDetect.__init__ | ( | self | ) |
Constructor.
Definition at line 35 of file PyCoralDetect.py.
References jevois.getNumInstalledTPUs().
def PyCoralDetect.PyCoralDetect.draw_objects | ( | self, | |
draw, | |||
objs, | |||
labels | |||
) |
Draws the bounding box and label for each object.
Definition at line 69 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process().
def PyCoralDetect.PyCoralDetect.get_objects | ( | self, | |
interpreter, | |||
score_threshold = -float('inf') , |
|||
image_scale = (1.0, 1.0) |
|||
) |
Modified from https://github.com/google-coral/pycoral/blob/master/pycoral/adapters/detect.py to avoid calling interpreter._get_full_signature_list() which does not seem to exist anymore...
Gets results from a detection model as a list of detected objects. Args: interpreter: The ``tf.lite.Interpreter`` to query for results. score_threshold (float): The score threshold for results. All returned results have a score greater-than-or-equal-to this value. image_scale (float, float): Scaling factor to apply to the bounding boxes as (x-scale-factor, y-scale-factor), where each factor is from 0 to 1.0. Returns: A list of :obj:`Object` objects, which each contains the detected object's id, score, and bounding box as :obj:`BBox`.
Definition at line 188 of file PyCoralDetect.py.
References demo.float, and demo.int.
Referenced by PyCoralDetect.PyCoralDetect.process(), and PyCoralDetect.PyCoralDetect.processGUI().
def PyCoralDetect.PyCoralDetect.process | ( | self, | |
inframe, | |||
outframe | |||
) |
JeVois main processing function.
Definition at line 78 of file PyCoralDetect.py.
References PyCoralDetect.PyCoralDetect.draw_objects(), PyCoralDetect.PyCoralDetect.get_objects(), PyCoralDetect.PyCoralDetect.interpreter, PyCoralClassify.PyCoralClassify.interpreter, TensorFlow.interpreter, mobilenet_v1.MobileNetV1.labels, mobilenet_v2.MobileNetV2.labels, PyCoralDetect.PyCoralDetect.labels, PyCoralClassify.PyCoralClassify.labels, TensorFlow.labels, mobilenet_v1.MobileNetV1.model, mobilenet_v2.MobileNetV2.model, mp_palmdet.MPPalmDet.model, lpd_yunet.LPD_YuNet.model, PyNetORT.PyNetORT.model, PyNetURetinex.PyNetURetinex.model, PyCoralDetect.PyCoralDetect.model, PyNetOpenCV.PyNetOpenCV.model, PyCoralClassify.PyCoralClassify.model, PyClassificationDNN.PyClassificationDNN.model, TensorFlow.model, PyCoralDetect.PyCoralDetect.rgb, PyClassificationDNN.PyClassificationDNN.rgb, PyCoralClassify.PyCoralClassify.rgb, PyCoralDetect.PyCoralDetect.threshold, PyCoralClassify.PyCoralClassify.threshold, PyModule::__MODULE__.timer, PythonTutorial2::PythonTutorial2.timer, PyCoralDetect.PyCoralDetect.timer, PyCoralClassify.PyCoralClassify.timer, PyClassificationDNN.PyClassificationDNN.timer, and FirstPython.FirstPython.timer.
def PyCoralDetect.PyCoralDetect.processGUI | ( | self, | |
inframe, | |||
helper | |||
) |
Process function with GUI output.
Definition at line 131 of file PyCoralDetect.py.
References PyCoralDetect.PyCoralDetect.get_objects(), PyCoralDetect.PyCoralDetect.interpreter, PyCoralClassify.PyCoralClassify.interpreter, TensorFlow.interpreter, mobilenet_v1.MobileNetV1.labels, mobilenet_v2.MobileNetV2.labels, PyCoralDetect.PyCoralDetect.labels, PyCoralClassify.PyCoralClassify.labels, TensorFlow.labels, mobilenet_v1.MobileNetV1.model, mobilenet_v2.MobileNetV2.model, mp_palmdet.MPPalmDet.model, lpd_yunet.LPD_YuNet.model, PyNetORT.PyNetORT.model, PyNetURetinex.PyNetURetinex.model, PyCoralDetect.PyCoralDetect.model, PyNetOpenCV.PyNetOpenCV.model, PyCoralClassify.PyCoralClassify.model, PyClassificationDNN.PyClassificationDNN.model, TensorFlow.model, PyCoralDetect.PyCoralDetect.rgb, PyClassificationDNN.PyClassificationDNN.rgb, PyCoralClassify.PyCoralClassify.rgb, PyCoralDetect.PyCoralDetect.stringToRGBA(), PyCoralDetect.PyCoralDetect.threshold, PyCoralClassify.PyCoralClassify.threshold, PyModule::__MODULE__.timer, PythonTutorial2::PythonTutorial2.timer, PyCoralDetect.PyCoralDetect.timer, PyCoralClassify.PyCoralClassify.timer, PyClassificationDNN.PyClassificationDNN.timer, and FirstPython.FirstPython.timer.
def PyCoralDetect.PyCoralDetect.stringToRGBA | ( | self, | |
str | |||
) |
Definition at line 61 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.processGUI().
PyCoralDetect.PyCoralDetect.interpreter |
Definition at line 55 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyCoralDetect.PyCoralDetect.processGUI(), and PyCoralSegment.PyCoralSegment.processGUI().
PyCoralDetect.PyCoralDetect.labels |
Definition at line 52 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process(), and PyCoralDetect.PyCoralDetect.processGUI().
PyCoralDetect.PyCoralDetect.model |
Definition at line 43 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyDetectionDNN.PyDetectionDNN.process(), PyLicensePlate.PyLicensePlate.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), and PyCoralSegment.PyCoralSegment.processGUI().
PyCoralDetect.PyCoralDetect.rgb |
Definition at line 40 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyDetectionDNN.PyDetectionDNN.process(), PyCoralDetect.PyCoralDetect.processGUI(), and PyCoralSegment.PyCoralSegment.processGUI().
PyCoralDetect.PyCoralDetect.threshold |
Definition at line 39 of file PyCoralDetect.py.
Referenced by PyCoralDetect.PyCoralDetect.process(), and PyCoralDetect.PyCoralDetect.processGUI().
PyCoralDetect.PyCoralDetect.timer |
Definition at line 58 of file PyCoralDetect.py.
Referenced by PyDMTX.PyDMTX.process(), PythonOpenCV.PythonOpenCV.process(), PythonSandbox.PythonSandbox.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PythonParallel.PythonParallel.process(), PyDetectionDNN.PyDetectionDNN.process(), PythonObject6D.PythonObject6D.process(), PyHandDetector.PyHandDetector.processGUI(), PyPoseDetector.PyPoseDetector.processGUI(), PyFaceMesh.PyFaceMesh.processGUI(), PySelfie.PySelfie.processGUI(), PyObjectron.PyObjectron.processGUI(), PyLicensePlate.PyLicensePlate.processGUI(), PySceneText.PySceneText.processGUI(), PythonTest.PythonTest.processGUI(), PythonSandbox.PythonSandbox.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), PyCoralSegment.PyCoralSegment.processGUI(), PythonSandbox.PythonSandbox.processNoUSB(), and PythonObject6D.PythonObject6D.processNoUSB().