JeVoisBase
1.22
JeVois Smart Embedded Machine Vision Toolkit Base Modules
|
|
Python DNN post-processor for DAMO YOLO. More...
Public Member Functions | |
__init__ (self) | |
Constructor. | |
init (self) | |
JeVois parameters initialization. | |
freeze (self, doit) | |
Freeze some parameters that should not be changed at runtime. | |
loadClasses (self, filename) | |
Parameter callback: Load class names when 'classes' parameter value is changed by model zoo. | |
multiclass_nms (self, bboxes, scores, score_th, nms_th, max_num) | |
Multiclass non-maximum suppression as implemented by PINTO0309. | |
postprocess (self, scores, bboxes, score_th, nms_th) | |
Post-processing as implemented by PINTO0309. | |
process (self, outs, preproc) | |
Get network outputs outs is a list of numpy arrays for the network's outputs. | |
getLabel (self, id, conf) | |
Helper to get class name and confidence as a clean string, and a color that varies with class name. | |
report (self, outimg, helper, overlay, idle) | |
Report the latest results obtained by process() by drawing them outimg is None or a RawImage to draw into when in Legacy mode (drawing to an image sent to USB) helper is None or a GUIhelper to do OpenGL drawings when in JeVois-Pro GUI mode overlay is True if user wishes to see overlay text idle is true if keyboard/mouse have been idle for a while, which typically would reduce what is displayed. | |
Public Attributes | |
classIds | |
confidences | |
boxes | |
classmap | |
classes | |
loadClasses | |
nms | |
maxnbox | |
cthresh | |
Python DNN post-processor for DAMO YOLO.
Adapted from https://github.com/PINTO0309/PINTO_model_zoo/blob/main/334_DAMO-YOLO/demo/demo_DAMO-YOLO_onnx.py and https://github.com/tinyvision/DAMO-YOLO/blob/master/tools/demo.py
Definition at line 25 of file PyPostDAMOyolo.py.
PyPostDAMOyolo.PyPostDAMOyolo.__init__ | ( | self | ) |
Constructor.
Definition at line 28 of file PyPostDAMOyolo.py.
PyPostDAMOyolo.PyPostDAMOyolo.freeze | ( | self, | |
doit | |||
) |
Freeze some parameters that should not be changed at runtime.
Definition at line 61 of file PyPostDAMOyolo.py.
References Darknet.classes, Yolo.classes, PyPostClassify.PyPostClassify.classes, PyPostDAMOyolo.PyPostDAMOyolo.classes, PyPostYolo.PyPostYolo.classes, PyPostYOLOv8seg.PyPostYOLOv8seg.classes, PyClassificationDNN.PyClassificationDNN.classes, PyDetectionDNN.PyDetectionDNN.classes, PyEmotion.PyEmotion.classes, and PyPostDAMOyolo.PyPostDAMOyolo.freeze().
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.freeze().
PyPostDAMOyolo.PyPostDAMOyolo.getLabel | ( | self, | |
id, | |||
conf | |||
) |
Helper to get class name and confidence as a clean string, and a color that varies with class name.
Definition at line 149 of file PyPostDAMOyolo.py.
References PyPostClassify.PyPostClassify.classmap, PyPostDAMOyolo.PyPostDAMOyolo.classmap, PyPostYolo.PyPostYolo.classmap, and PyPostYOLOv8seg.PyPostYOLOv8seg.classmap.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.report(), PyPostYolo.PyPostYolo.report(), and PyPostYOLOv8seg.PyPostYOLOv8seg.report().
PyPostDAMOyolo.PyPostDAMOyolo.init | ( | self | ) |
JeVois parameters initialization.
These can be set by users in the GUI or JeVois model zoo file
Definition at line 39 of file PyPostDAMOyolo.py.
PyPostDAMOyolo.PyPostDAMOyolo.loadClasses | ( | self, | |
filename | |||
) |
Parameter callback: Load class names when 'classes' parameter value is changed by model zoo.
Definition at line 66 of file PyPostDAMOyolo.py.
References PyPostClassify.PyPostClassify.classmap, PyPostDAMOyolo.PyPostDAMOyolo.classmap, PyPostYolo.PyPostYolo.classmap, and PyPostYOLOv8seg.PyPostYOLOv8seg.classmap.
PyPostDAMOyolo.PyPostDAMOyolo.multiclass_nms | ( | self, | |
bboxes, | |||
scores, | |||
score_th, | |||
nms_th, | |||
max_num | |||
) |
Multiclass non-maximum suppression as implemented by PINTO0309.
Definition at line 74 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.postprocess().
PyPostDAMOyolo.PyPostDAMOyolo.postprocess | ( | self, | |
scores, | |||
bboxes, | |||
score_th, | |||
nms_th | |||
) |
Post-processing as implemented by PINTO0309.
Definition at line 99 of file PyPostDAMOyolo.py.
References PyPostDAMOyolo.PyPostDAMOyolo.maxnbox, PyPostYolo.PyPostYolo.maxnbox, and PyPostDAMOyolo.PyPostDAMOyolo.multiclass_nms().
Referenced by PyDetectionDNN.PyDetectionDNN.process(), PyPostDAMOyolo.PyPostDAMOyolo.process(), and PyPostYOLOv8seg.PyPostYOLOv8seg.process().
PyPostDAMOyolo.PyPostDAMOyolo.process | ( | self, | |
outs, | |||
preproc | |||
) |
Get network outputs outs is a list of numpy arrays for the network's outputs.
preproc is a handle to the pre-processor that was used, useful to recover transforms from original image to cropped/resized network inputs.
Definition at line 113 of file PyPostDAMOyolo.py.
References PyPostDAMOyolo.PyPostDAMOyolo.boxes, PyPostYolo.PyPostYolo.boxes, PyPostYOLOv8seg.PyPostYOLOv8seg.boxes, PyPostDAMOyolo.PyPostDAMOyolo.classIds, PyPostYolo.PyPostYolo.classIds, PyPostDAMOyolo.PyPostDAMOyolo.confidences, PyPostYolo.PyPostYolo.confidences, PyPostClassify.PyPostClassify.cthresh, PyPostDAMOyolo.PyPostDAMOyolo.cthresh, PyPostYolo.PyPostYolo.cthresh, PyPostDAMOyolo.PyPostDAMOyolo.nms, PyPostYolo.PyPostYolo.nms, DetectionDNN.postprocess(), PyDetectionDNN.PyDetectionDNN.postprocess(), PyPostYOLOv8seg.PyPostYOLOv8seg.postprocess(), and PyPostDAMOyolo.PyPostDAMOyolo.postprocess().
PyPostDAMOyolo.PyPostDAMOyolo.report | ( | self, | |
outimg, | |||
helper, | |||
overlay, | |||
idle | |||
) |
Report the latest results obtained by process() by drawing them outimg is None or a RawImage to draw into when in Legacy mode (drawing to an image sent to USB) helper is None or a GUIhelper to do OpenGL drawings when in JeVois-Pro GUI mode overlay is True if user wishes to see overlay text idle is true if keyboard/mouse have been idle for a while, which typically would reduce what is displayed.
Note that report() is called on every frame even though the network may run slower or take some time to load and initialize, thus you should be prepared for report() being called even before process() has ever been called (i.e., create some class member variables to hold the reported results, initialize them to some defaults in your constructor, report their current values here, and update their values in process()).
Definition at line 168 of file PyPostDAMOyolo.py.
References PyPostDAMOyolo.PyPostDAMOyolo.boxes, PyPostYolo.PyPostYolo.boxes, PyPostYOLOv8seg.PyPostYOLOv8seg.boxes, PyPostDAMOyolo.PyPostDAMOyolo.classIds, PyPostYolo.PyPostYolo.classIds, PyPostDAMOyolo.PyPostDAMOyolo.confidences, PyPostYolo.PyPostYolo.confidences, PyPostDAMOyolo.PyPostDAMOyolo.getLabel(), PyPostYolo.PyPostYolo.getLabel(), and PyPostYOLOv8seg.PyPostYOLOv8seg.getLabel().
PyPostDAMOyolo.PyPostDAMOyolo.boxes |
PyPostDAMOyolo.PyPostDAMOyolo.classes |
Definition at line 42 of file PyPostDAMOyolo.py.
Referenced by PyPostClassify.PyPostClassify.freeze(), PyPostDAMOyolo.PyPostDAMOyolo.freeze(), PyPostYolo.PyPostYolo.freeze(), PyPostYOLOv8seg.PyPostYOLOv8seg.freeze(), PyDetectionDNN.PyDetectionDNN.postprocess(), and PyClassificationDNN.PyClassificationDNN.process().
PyPostDAMOyolo.PyPostDAMOyolo.classIds |
Definition at line 30 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.process(), PyPostYolo.PyPostYolo.process(), PyPostDAMOyolo.PyPostDAMOyolo.report(), and PyPostYolo.PyPostYolo.report().
PyPostDAMOyolo.PyPostDAMOyolo.classmap |
Definition at line 35 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.getLabel(), PyPostYolo.PyPostYolo.getLabel(), PyPostYOLOv8seg.PyPostYOLOv8seg.getLabel(), PyPostClassify.PyPostClassify.loadClasses(), PyPostDAMOyolo.PyPostDAMOyolo.loadClasses(), PyPostYolo.PyPostYolo.loadClasses(), PyPostYOLOv8seg.PyPostYOLOv8seg.loadClasses(), and PyPostClassify.PyPostClassify.process().
PyPostDAMOyolo.PyPostDAMOyolo.confidences |
Definition at line 31 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.process(), PyPostYolo.PyPostYolo.process(), PyPostDAMOyolo.PyPostDAMOyolo.report(), and PyPostYolo.PyPostYolo.report().
PyPostDAMOyolo.PyPostDAMOyolo.cthresh |
Definition at line 55 of file PyPostDAMOyolo.py.
Referenced by PyPostClassify.PyPostClassify.process(), PyPostDAMOyolo.PyPostDAMOyolo.process(), and PyPostClassify.PyPostClassify.report().
PyPostDAMOyolo.PyPostDAMOyolo.loadClasses |
Definition at line 45 of file PyPostDAMOyolo.py.
PyPostDAMOyolo.PyPostDAMOyolo.maxnbox |
Definition at line 51 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.postprocess().
PyPostDAMOyolo.PyPostDAMOyolo.nms |
Definition at line 47 of file PyPostDAMOyolo.py.
Referenced by PyPostDAMOyolo.PyPostDAMOyolo.process().