JeVoisBase  1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
PyCoralDetect.PyCoralDetect Class Reference

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
 

Detailed Description

Object detection using Coral Edge TPU.

More pre-trained models are available at https://coral.ai/models/

Author
Laurent Itti
Videomapping:
YUYV 320 264 30.0 YUYV 320 240 30.0 JeVois PyClassificationDNN
Email:
itti@.nosp@m.usc..nosp@m.edu
Address:
880 W 1st St Suite 807, Los Angeles CA 90012, USA
Main URL:
http://jevois.org
Support URL:
http://jevois.org
Other URL:
http://jevois.org
License:
GPL v3
Distribution:
Unrestricted
Restrictions:
None

Definition at line 32 of file PyCoralDetect.py.

Constructor & Destructor Documentation

◆ __init__()

PyCoralDetect.PyCoralDetect.__init__ (   self)

Constructor.

Definition at line 35 of file PyCoralDetect.py.

References jevois.getNumInstalledTPUs().

Member Function Documentation

◆ draw_objects()

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().

◆ get_objects()

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().

◆ process()

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.

◆ processGUI()

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.

◆ stringToRGBA()

PyCoralDetect.PyCoralDetect.stringToRGBA (   self,
  str 
)

Definition at line 61 of file PyCoralDetect.py.

Referenced by PyCoralDetect.PyCoralDetect.processGUI().

Member Data Documentation

◆ interpreter

◆ labels

◆ model

◆ rgb

◆ threshold

◆ timer


The documentation for this class was generated from the following file: