JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Object detection using Coral Edge TPU. More...
Public Member Functions | |
__init__ (self) | |
Constructor. | |
stringToRGBA (self, str) | |
draw_objects (self, draw, objs, labels) | |
process (self, inframe, outframe) | |
JeVois main processing function. | |
processGUI (self, inframe, helper) | |
Process function with GUI output. | |
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... | |
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.
PyCoralDetect.PyCoralDetect.__init__ | ( | self | ) |
Constructor.
Definition at line 35 of file PyCoralDetect.py.
References jevois.getNumInstalledTPUs().
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().
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.
Referenced by PyCoralDetect.PyCoralDetect.process(), and PyCoralDetect.PyCoralDetect.processGUI().
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(), TensorFlow.interpreter, PyCoralClassify.PyCoralClassify.interpreter, PyCoralDetect.PyCoralDetect.interpreter, PyCoralSegment.PyCoralSegment.interpreter, TensorFlow.labels, mobilenet_v1.MobileNetV1.labels, mobilenet_v2.MobileNetV2.labels, PyCoralClassify.PyCoralClassify.labels, PyCoralDetect.PyCoralDetect.labels, TensorFlow.model, mobilenet_v1.MobileNetV1.model, mobilenet_v2.MobileNetV2.model, lpd_yunet.LPD_YuNet.model, mp_palmdet.MPPalmDet.model, PyNetKSNN.PyNetKSNN.model, PyNetOpenCV.PyNetOpenCV.model, PyNetORT.PyNetORT.model, PyNetURetinex.PyNetURetinex.model, PyClassificationDNN.PyClassificationDNN.model, PyCoralClassify.PyCoralClassify.model, PyCoralDetect.PyCoralDetect.model, PyCoralSegment.PyCoralSegment.model, PyDetectionDNN.PyDetectionDNN.model, PyEmotion.PyEmotion.model, PyLicensePlate.PyLicensePlate.model, PyClassificationDNN.PyClassificationDNN.rgb, PyCoralClassify.PyCoralClassify.rgb, PyCoralDetect.PyCoralDetect.rgb, PyCoralSegment.PyCoralSegment.rgb, PyDetectionDNN.PyDetectionDNN.rgb, PyEmotion.PyEmotion.rgb, PyCoralClassify.PyCoralClassify.threshold, PyCoralDetect.PyCoralDetect.threshold, AprilTag.AprilTag.timer, FirstPython.FirstPython.timer, PyClassificationDNN.PyClassificationDNN.timer, PyCoralClassify.PyCoralClassify.timer, PyCoralDetect.PyCoralDetect.timer, PyCoralSegment.PyCoralSegment.timer, PyDetectionDNN.PyDetectionDNN.timer, PyDMTX.PyDMTX.timer, PyEmotion.PyEmotion.timer, PyFaceMesh.PyFaceMesh.timer, PyHandDetector.PyHandDetector.timer, PyLicensePlate.PyLicensePlate.timer, PyObjectron.PyObjectron.timer, PyPoseDetector.PyPoseDetector.timer, PySceneText.PySceneText.timer, PySelfie.PySelfie.timer, PythonObject6D.PythonObject6D.timer, PythonOpenCV.PythonOpenCV.timer, PythonParallel.PythonParallel.timer, PythonSandbox.PythonSandbox.timer, and PythonTest.PythonTest.timer.
PyCoralDetect.PyCoralDetect.processGUI | ( | self, | |
inframe, | |||
helper | |||
) |
Process function with GUI output.
Definition at line 131 of file PyCoralDetect.py.
References PyCoralDetect.PyCoralDetect.get_objects(), TensorFlow.interpreter, PyCoralClassify.PyCoralClassify.interpreter, PyCoralDetect.PyCoralDetect.interpreter, PyCoralSegment.PyCoralSegment.interpreter, TensorFlow.labels, mobilenet_v1.MobileNetV1.labels, mobilenet_v2.MobileNetV2.labels, PyCoralClassify.PyCoralClassify.labels, PyCoralDetect.PyCoralDetect.labels, TensorFlow.model, mobilenet_v1.MobileNetV1.model, mobilenet_v2.MobileNetV2.model, lpd_yunet.LPD_YuNet.model, mp_palmdet.MPPalmDet.model, PyNetKSNN.PyNetKSNN.model, PyNetOpenCV.PyNetOpenCV.model, PyNetORT.PyNetORT.model, PyNetURetinex.PyNetURetinex.model, PyClassificationDNN.PyClassificationDNN.model, PyCoralClassify.PyCoralClassify.model, PyCoralDetect.PyCoralDetect.model, PyCoralSegment.PyCoralSegment.model, PyDetectionDNN.PyDetectionDNN.model, PyEmotion.PyEmotion.model, PyLicensePlate.PyLicensePlate.model, PyClassificationDNN.PyClassificationDNN.rgb, PyCoralClassify.PyCoralClassify.rgb, PyCoralDetect.PyCoralDetect.rgb, PyCoralSegment.PyCoralSegment.rgb, PyDetectionDNN.PyDetectionDNN.rgb, PyEmotion.PyEmotion.rgb, PyCoralDetect.PyCoralDetect.stringToRGBA(), PyCoralClassify.PyCoralClassify.threshold, PyCoralDetect.PyCoralDetect.threshold, AprilTag.AprilTag.timer, FirstPython.FirstPython.timer, PyClassificationDNN.PyClassificationDNN.timer, PyCoralClassify.PyCoralClassify.timer, PyCoralDetect.PyCoralDetect.timer, PyCoralSegment.PyCoralSegment.timer, PyDetectionDNN.PyDetectionDNN.timer, PyDMTX.PyDMTX.timer, PyEmotion.PyEmotion.timer, PyFaceMesh.PyFaceMesh.timer, PyHandDetector.PyHandDetector.timer, PyLicensePlate.PyLicensePlate.timer, PyObjectron.PyObjectron.timer, PyPoseDetector.PyPoseDetector.timer, PySceneText.PySceneText.timer, PySelfie.PySelfie.timer, PythonObject6D.PythonObject6D.timer, PythonOpenCV.PythonOpenCV.timer, PythonParallel.PythonParallel.timer, PythonSandbox.PythonSandbox.timer, and PythonTest.PythonTest.timer.
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 PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyCoralClassify.PyCoralClassify.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), and PyCoralSegment.PyCoralSegment.processGUI().
PyCoralDetect.PyCoralDetect.labels |
Definition at line 52 of file PyCoralDetect.py.
Referenced by mobilenet_v1.MobileNetV1._postprocess(), mobilenet_v2.MobileNetV2._postprocess(), PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralClassify.PyCoralClassify.processGUI(), and PyCoralDetect.PyCoralDetect.processGUI().
PyCoralDetect.PyCoralDetect.model |
Definition at line 43 of file PyCoralDetect.py.
Referenced by lpd_yunet.LPD_YuNet.__init__(), PyNetKSNN.PyNetKSNN.freeze(), PyNetOpenCV.PyNetOpenCV.freeze(), PyNetORT.PyNetORT.freeze(), PyNetURetinex.PyNetURetinex.freeze(), mobilenet_v1.MobileNetV1.infer(), mobilenet_v2.MobileNetV2.infer(), lpd_yunet.LPD_YuNet.infer(), mp_palmdet.MPPalmDet.infer(), PyNetKSNN.PyNetKSNN.load(), PyNetOpenCV.PyNetOpenCV.load(), PyNetORT.PyNetORT.load(), PyNetURetinex.PyNetURetinex.load(), PyClassificationDNN.PyClassificationDNN.process(), PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyDetectionDNN.PyDetectionDNN.process(), PyCoralClassify.PyCoralClassify.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), PyCoralSegment.PyCoralSegment.processGUI(), PyLicensePlate.PyLicensePlate.processGUI(), mobilenet_v1.MobileNetV1.setBackend(), mobilenet_v2.MobileNetV2.setBackend(), lpd_yunet.LPD_YuNet.setBackend(), mp_palmdet.MPPalmDet.setBackend(), mobilenet_v1.MobileNetV1.setTarget(), mobilenet_v2.MobileNetV2.setTarget(), lpd_yunet.LPD_YuNet.setTarget(), and mp_palmdet.MPPalmDet.setTarget().
PyCoralDetect.PyCoralDetect.rgb |
Definition at line 40 of file PyCoralDetect.py.
Referenced by PyClassificationDNN.PyClassificationDNN.process(), PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyDetectionDNN.PyDetectionDNN.process(), PyCoralClassify.PyCoralClassify.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), and PyCoralSegment.PyCoralSegment.processGUI().
PyCoralDetect.PyCoralDetect.threshold |
Definition at line 39 of file PyCoralDetect.py.
Referenced by PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralClassify.PyCoralClassify.processGUI(), and PyCoralDetect.PyCoralDetect.processGUI().
PyCoralDetect.PyCoralDetect.timer |
Definition at line 58 of file PyCoralDetect.py.
Referenced by FirstPython.FirstPython.process(), PyClassificationDNN.PyClassificationDNN.process(), PyCoralClassify.PyCoralClassify.process(), PyCoralDetect.PyCoralDetect.process(), PyCoralSegment.PyCoralSegment.process(), PyDetectionDNN.PyDetectionDNN.process(), PyDMTX.PyDMTX.process(), PythonObject6D.PythonObject6D.process(), PythonOpenCV.PythonOpenCV.process(), PythonParallel.PythonParallel.process(), PythonSandbox.PythonSandbox.process(), AprilTag.AprilTag.processGUI(), PyCoralClassify.PyCoralClassify.processGUI(), PyCoralDetect.PyCoralDetect.processGUI(), PyCoralSegment.PyCoralSegment.processGUI(), PyFaceMesh.PyFaceMesh.processGUI(), PyHandDetector.PyHandDetector.processGUI(), PyLicensePlate.PyLicensePlate.processGUI(), PyObjectron.PyObjectron.processGUI(), PyPoseDetector.PyPoseDetector.processGUI(), PySceneText.PySceneText.processGUI(), PySelfie.PySelfie.processGUI(), PythonOpenCV.PythonOpenCV.processGUI(), PythonSandbox.PythonSandbox.processGUI(), PythonTest.PythonTest.processGUI(), FirstPython.FirstPython.processNoUSB(), PythonObject6D.PythonObject6D.processNoUSB(), and PythonSandbox.PythonSandbox.processNoUSB().