JeVois  1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
PostProcessorDetect.H
Go to the documentation of this file.
1 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 //
3 // JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2021 by Laurent Itti, the University of Southern
4 // California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
5 //
6 // This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can
7 // redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
8 // Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
10 // License for more details. You should have received a copy of the GNU General Public License along with this program;
11 // if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
12 //
13 // Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, CA 90089-2520 - USA.
14 // Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
15 // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16 /*! \file */
17 
18 #pragma once
19 
21 #include <jevois/Types/ObjDetect.H>
22 
23 namespace jevois
24 {
25  namespace dnn
26  {
27  class PostProcessorDetectYOLO;
28 
29  //! Post-Processor for neural network pipeline
30  /*! This is the last step in a deep neural network processing Pipeline. \ingroup dnn */
32  public Parameter<postprocessor::classoffset, postprocessor::classes, postprocessor::nms,
33  postprocessor::detecttype, postprocessor::maxnbox,
34  postprocessor::cthresh, postprocessor::dthresh>
35  {
36  public:
37 
38  //! Inherited constructor ok
39  using PostProcessor::PostProcessor;
40 
41  //! Destructor
42  virtual ~PostProcessorDetect();
43 
44  //! Freeze/unfreeze parameters that users should not change while running
45  void freeze(bool doit) override;
46 
47  //! Process outputs and draw/send some results
48  void process(std::vector<cv::Mat> const & outs, PreProcessor * preproc) override;
49 
50  //! Report what happened in last process() to console/output video/GUI
51  void report(jevois::StdModule * mod, jevois::RawImage * outimg = nullptr,
52  jevois::OptGUIhelper * helper = nullptr, bool overlay = true, bool idle = false) override;
53 
54  protected:
55  void onParamChange(postprocessor::detecttype const & param, postprocessor::DetectType const & val) override;
56  void onParamChange(postprocessor::classes const & param, std::string const & val) override;
57  std::map<int, std::string> itsLabels; //!< Mapping from object ID to class name
58  std::vector<ObjDetect> itsDetections;
59  cv::Size itsImageSize;
60  std::shared_ptr<PostProcessorDetectYOLO> itsYOLO;
61  };
62 
63  } // namespace dnn
64 } // namespace jevois
jevois::dnn::PostProcessorDetect::itsLabels
std::map< int, std::string > itsLabels
Mapping from object ID to class name.
Definition: PostProcessorDetect.H:57
jevois::dnn::PostProcessorDetect::freeze
void freeze(bool doit) override
Freeze/unfreeze parameters that users should not change while running.
Definition: PostProcessorDetect.C:35
jevois::RawImage
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
Definition: RawImage.H:110
ObjDetect.H
jevois::GUIhelper
Helper class to assist modules in creating graphical and GUI elements.
Definition: GUIhelper.H:128
jevois::dnn::PostProcessorDetect
Post-Processor for neural network pipeline.
Definition: PostProcessorDetect.H:31
jevois
Definition: Concepts.dox:1
jevois::dnn::PreProcessor
Pre-Processor for neural network pipeline.
Definition: PreProcessor.H:108
jevois::dnn::PostProcessorDetect::process
void process(std::vector< cv::Mat > const &outs, PreProcessor *preproc) override
Process outputs and draw/send some results.
Definition: PostProcessorDetect.C:69
jevois::dnn::PostProcessorDetect::itsImageSize
cv::Size itsImageSize
Definition: PostProcessorDetect.H:59
PostProcessor.H
jevois::dnn::PostProcessorDetect::onParamChange
void onParamChange(postprocessor::detecttype const &param, postprocessor::DetectType const &val) override
jevois::dnn::PostProcessor
Post-Processor for neural network pipeline.
Definition: PostProcessor.H:146
jevois::dnn::PostProcessorDetect::itsDetections
std::vector< ObjDetect > itsDetections
Definition: PostProcessorDetect.H:58
jevois::StdModule
Base class for a module that supports standardized serial messages.
Definition: Module.H:232
jevois::dnn::PostProcessorDetect::itsYOLO
std::shared_ptr< PostProcessorDetectYOLO > itsYOLO
Definition: PostProcessorDetect.H:60
jevois::dnn::PostProcessorDetect::~PostProcessorDetect
virtual ~PostProcessorDetect()
Destructor.
Definition: PostProcessorDetect.C:31
jevois::dnn::PostProcessorDetect::report
void report(jevois::StdModule *mod, jevois::RawImage *outimg=nullptr, jevois::OptGUIhelper *helper=nullptr, bool overlay=true, bool idle=false) override
Report what happened in last process() to console/output video/GUI.
Definition: PostProcessorDetect.C:317