JeVoisBase  1.20
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
PyPostClassify.PyPostClassify Class Reference

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

Public Member Functions

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

Public Attributes

 results
 
 classmap
 
 classes
 
 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__()

def PyPostClassify.PyPostClassify.__init__ (   self)

[Optional] Constructor

Definition at line 29 of file PyPostClassify.py.

Member Function Documentation

◆ freeze()

def PyPostClassify.PyPostClassify.freeze (   self,
  doit 
)

[Optional] Freeze some parameters that should not be changed at runtime.

The JeVois core will call this with doit being either True or False

Definition at line 58 of file PyPostClassify.py.

References PyPostClassify.PyPostClassify.classes, Darknet.classes, and Yolo.classes.

◆ init()

def PyPostClassify.PyPostClassify.init (   self)

[Optional] JeVois parameters initialization

Definition at line 35 of file PyPostClassify.py.

◆ loadClasses()

def 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, and split().

◆ process()

def 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, PyPostClassify.PyPostClassify.classoffset, PyPostClassify.PyPostClassify.cthresh, PyPostClassify.PyPostClassify.results, and PyPostClassify.PyPostClassify.top.

◆ report()

def 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, PyPostClassify.PyPostClassify.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

◆ results

◆ top

PyPostClassify.PyPostClassify.top

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