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

Object detection and recognition using OpenCV Deep Neural Networks (DNN) More...

Public Member Functions

 __init__ (self)
 Constructor.
 
 postprocess (self, frame, outs)
 Analyze and draw boxes, object names, and confidence scores.
 
 process (self, inframe, outframe)
 JeVois main processing function.
 

Public Attributes

 confThreshold
 
 nmsThreshold
 
 inpWidth
 
 inpHeight
 
 scale
 
 mean
 
 rgb
 
 classes
 
 net
 
 timer
 
 model
 
 outNames
 

Detailed Description

Object detection and recognition using OpenCV Deep Neural Networks (DNN)

This module runs an object detection deep neural network using the OpenCV DNN library. Detection networks analyze a whole scene and produce a number of bounding boxes around detected objects, together with identity labels and confidence scores for each detected box.

This module supports detection networks implemented in TensorFlow, Caffe, Darknet, Torch, etc as supported by the OpenCV DNN module.

Included with the standard JeVois distribution are:

  • OpenCV Face Detector, Caffe model
  • MobileNet + SSD trained on Pascal VOC (20 object classes), Caffe model
  • MobileNet + SSD trained on Coco (80 object classes), TensorFlow model
  • MobileNet v2 + SSD trained on Coco (80 object classes), TensorFlow model
  • Darknet Tiny YOLO v3 trained on Coco (80 object classes), Darknet model
  • Darknet Tiny YOLO v2 trained on Pascal VOC (20 object classes), Darknet model

See the module's constructor (init) code and select a value for model to switch network. Object categories are as follows:

  • The 80 COCO object categories are: person, bicycle, car, motorbike, aeroplane, bus, train, truck, boat, traffic, fire, stop, parking, bench, bird, cat, dog, horse, sheep, cow, elephant, bear, zebra, giraffe, backpack, umbrella, handbag, tie, suitcase, frisbee, skis, snowboard, sports, kite, baseball, baseball, skateboard, surfboard, tennis, bottle, wine, cup, fork, knife, spoon, bowl, banana, apple, sandwich, orange, broccoli, carrot, hot, pizza, donut, cake, chair, sofa, pottedplant, bed, diningtable, toilet, tvmonitor, laptop, mouse, remote, keyboard, cell, microwave, oven, toaster, sink, refrigerator, book, clock, vase, scissors, teddy, hair, toothbrush.
  • The 20 Pascal-VOC object categories are: aeroplane, bicycle, bird, boat, bottle, bus, car, cat, chair, cow, diningtable, dog, horse, motorbike, person, pottedplant, sheep, sofa, train, tvmonitor.

Sometimes it will make mistakes! The performance of yolov3-tiny is about 33.1% correct (mean average precision) on the COCO test set. The OpenCV Face Detector is quite fast and robust!

This module is adapted from the sample OpenCV code: https://github.com/opencv/opencv/blob/master/samples/dnn/object_detection.py

More pre-trained models are available on github in opencv_extra

Author
Laurent Itti
Videomapping:
YUYV 640 502 20.0 YUYV 640 480 20.0 JeVois PyDetectionDNN
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 61 of file PyDetectionDNN.py.

Constructor & Destructor Documentation

◆ __init__()

PyDetectionDNN.PyDetectionDNN.__init__ (   self)

Constructor.

Definition at line 64 of file PyDetectionDNN.py.

Member Function Documentation

◆ postprocess()

◆ process()

PyDetectionDNN.PyDetectionDNN.process (   self,
  inframe,
  outframe 
)

JeVois main processing function.

Definition at line 252 of file PyDetectionDNN.py.

References PyClassificationDNN.PyClassificationDNN.inpHeight, PyDetectionDNN.PyDetectionDNN.inpHeight, PyEmotion.PyEmotion.inpHeight, PyClassificationDNN.PyClassificationDNN.inpWidth, PyDetectionDNN.PyDetectionDNN.inpWidth, PyEmotion.PyEmotion.inpWidth, mobilenet_v1.MobileNetV1.mean, mobilenet_v2.MobileNetV2.mean, quantize-inc.Dataset.mean, transform.Normalize.mean, PyPreBlob.PyPreBlob.mean, PyClassificationDNN.PyClassificationDNN.mean, PyDetectionDNN.PyDetectionDNN.mean, PyEmotion.PyEmotion.mean, 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, Darknet.net, Yolo.net, ObjectRecognition< tiny_dnn::sequential >.net, ObjectRecognition< NetType >.net, PyNetKSNN.PyNetKSNN.net, PyNetOpenCV.PyNetOpenCV.net, PyClassificationDNN.PyClassificationDNN.net, PyDetectionDNN.PyDetectionDNN.net, PyEmotion.PyEmotion.net, PyDetectionDNN.PyDetectionDNN.outNames, DetectionDNN.postprocess(), PyDetectionDNN.PyDetectionDNN.postprocess(), PyPostYOLOv8seg.PyPostYOLOv8seg.postprocess(), PyPostDAMOyolo.PyPostDAMOyolo.postprocess(), PyClassificationDNN.PyClassificationDNN.rgb, PyCoralClassify.PyCoralClassify.rgb, PyCoralDetect.PyCoralDetect.rgb, PyCoralSegment.PyCoralSegment.rgb, PyDetectionDNN.PyDetectionDNN.rgb, PyEmotion.PyEmotion.rgb, PyPreBlob.PyPreBlob.scale, PyClassificationDNN.PyClassificationDNN.scale, PyDetectionDNN.PyDetectionDNN.scale, PyEmotion.PyEmotion.scale, 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.

Member Data Documentation

◆ classes

◆ confThreshold

PyDetectionDNN.PyDetectionDNN.confThreshold

◆ inpHeight

PyDetectionDNN.PyDetectionDNN.inpHeight

◆ inpWidth

PyDetectionDNN.PyDetectionDNN.inpWidth

◆ mean

◆ model

◆ net

◆ nmsThreshold

PyDetectionDNN.PyDetectionDNN.nmsThreshold

Definition at line 66 of file PyDetectionDNN.py.

Referenced by PyDetectionDNN.PyDetectionDNN.postprocess().

◆ outNames

PyDetectionDNN.PyDetectionDNN.outNames

◆ rgb

◆ scale

PyDetectionDNN.PyDetectionDNN.scale

◆ timer


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