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

Simple classification DNN post-processor written in python. More...

Public Member Functions

 __init__ (self)
 [Optional] Constructor
 
 init (self)
 [Optional] JeVois parameters initialization
 
 freeze (self, doit)
 [Optional] Freeze some parameters that should not be changed at runtime.
 
 loadClasses (self, filename)
 [Optional] Parameter callback: Load class names when 'classes' parameter value is changed, when a pipeline is selected from the model zoo
 
 process (self, outs, preproc)
 [Required] Main processing function: parse network output blobs and store resulting labels and scores locally.
 
 report (self, outimg, helper, overlay, idle)
 [Optional] 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

 results
 
 classmap
 
 classes
 
 loadClasses
 
 cthresh
 
 top
 
 classoffset
 

Detailed Description

Simple classification DNN post-processor written in python.

Compare this code to the C++ PostProcessorClassify (which has more functionality than here):

Author
Laurent Itti
Email:
itti@usc.edu
Address:
University of Southern California, HNB-07A, 3641 Watt Way, Los Angeles, CA 90089-2520, USA
Main URL:
http://jevois.org
Support URL:
http://jevois.org/doc
Other URL:
http://iLab.usc.edu
License:
GPL v3
Distribution:
Unrestricted
Restrictions:
None

Definition at line 26 of file PyPostClassify.py.

Constructor & Destructor Documentation

◆ __init__()

PyPostClassify.PyPostClassify.__init__ (   self)

[Optional] Constructor

Definition at line 29 of file PyPostClassify.py.

Member Function Documentation

◆ freeze()

PyPostClassify.PyPostClassify.freeze (   self,
  doit 
)

◆ init()

PyPostClassify.PyPostClassify.init (   self)

[Optional] JeVois parameters initialization

Definition at line 35 of file PyPostClassify.py.

◆ loadClasses()

PyPostClassify.PyPostClassify.loadClasses (   self,
  filename 
)

[Optional] Parameter callback: Load class names when 'classes' parameter value is changed, when a pipeline is selected from the model zoo

Definition at line 64 of file PyPostClassify.py.

References PyPostClassify.PyPostClassify.classmap, PyPostDAMOyolo.PyPostDAMOyolo.classmap, PyPostYolo.PyPostYolo.classmap, and PyPostYOLOv8seg.PyPostYOLOv8seg.classmap.

◆ process()

PyPostClassify.PyPostClassify.process (   self,
  outs,
  preproc 
)

[Required] Main processing function: parse network output blobs and store resulting labels and scores locally.

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 (not used here).

Definition at line 75 of file PyPostClassify.py.

References PyPostClassify.PyPostClassify.classmap, PyPostDAMOyolo.PyPostDAMOyolo.classmap, PyPostYolo.PyPostYolo.classmap, PyPostYOLOv8seg.PyPostYOLOv8seg.classmap, PyPostClassify.PyPostClassify.classoffset, PyPostYolo.PyPostYolo.classoffset, PyPostClassify.PyPostClassify.cthresh, PyPostDAMOyolo.PyPostDAMOyolo.cthresh, PyPostYolo.PyPostYolo.cthresh, PyPostClassify.PyPostClassify.results, PyPostStub.PyPostStub.results, PyPreBlob.PyPreBlob.results, and PyPostClassify.PyPostClassify.top.

◆ report()

PyPostClassify.PyPostClassify.report (   self,
  outimg,
  helper,
  overlay,
  idle 
)

[Optional] 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 125 of file PyPostClassify.py.

References PyPostClassify.PyPostClassify.cthresh, PyPostDAMOyolo.PyPostDAMOyolo.cthresh, PyPostYolo.PyPostYolo.cthresh, PyPostClassify.PyPostClassify.results, PyPostStub.PyPostStub.results, PyPreBlob.PyPreBlob.results, and PyPostClassify.PyPostClassify.top.

Member Data Documentation

◆ classes

◆ classmap

◆ classoffset

PyPostClassify.PyPostClassify.classoffset

Definition at line 51 of file PyPostClassify.py.

Referenced by PyPostClassify.PyPostClassify.process().

◆ cthresh

PyPostClassify.PyPostClassify.cthresh

◆ loadClasses

PyPostClassify.PyPostClassify.loadClasses

Definition at line 41 of file PyPostClassify.py.

◆ results

◆ top

PyPostClassify.PyPostClassify.top

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