33 void loadpy(std::string
const & pypath);
61 LINFO(
"Loaded " << pypath);
72 LFATAL(
"No process() method provided. It is required, please add it to your Python post-processor.");
83 LFATAL(
"No process() method provided. It is required, please add it to your Python post-processor.");
104 PythonWrapper::pyinst().attr(
"report")(boost::python::object(), boost::ref(helperpy), overlay, idle);
108 PythonWrapper::pyinst().attr(
"report")(boost::python::object(), boost::python::object(), overlay, idle);
121 itsImpl = addSubComponent<jevois::dnn::PostProcessorPythonImpl>(
"pypost");
132 pypost::freeze(doit);
135 itsImpl->freeze(doit);
140 std::string
const & newval)
142 if (newval.empty() ==
false) itsImpl->loadpy(newval);
147{ itsImpl->process(outs, preproc); }
152{ itsImpl->report(mod, outimg, helper, overlay, idle); }
#define JEVOIS_SHARE_PATH
Base path for shared files (e.g., neural network weights, etc)
A component of a model hierarchy.
void unRegisterPythonComponent(Component *comp)
Unregister a component as linked to some python code, used by dynamic params created in python.
Wrapper around GUIhelper to be used by Python.
Helper class to assist modules in creating graphical and GUI elements.
friend class Component
Allow Component and DynamicParameter to access our registry data, everyone else is locked out.
Helper class to run python code from C++.
void pythonload(std::string const &path)
Init from path if default constructor was used.
boost::python::object & pyinst()
Get the python class pyinst, or throw if construction error occurred (e.g., file not found)
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
Base class for a module that supports standardized serial messages.
virtual ~PostProcessorPythonImpl()
void loadpy(std::string const &pypath)
void process(std::vector< cv::Mat > const &outs, PreProcessor *preproc)
void report(jevois::StdModule *mod, jevois::RawImage *outimg=nullptr, jevois::OptGUIhelper *helper=nullptr, bool overlay=true, bool idle=false)
std::shared_ptr< PostProcessorPythonImpl > itsImpl
virtual ~PostProcessorPython()
Destructor.
void process(std::vector< cv::Mat > const &outs, PreProcessor *preproc) override
Process outputs and draw/send some results.
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.
void freeze(bool doit) override
Freeze/unfreeze parameters that users should not change while running.
PostProcessorPython(std::string const &instance)
Constructor.
void onParamChange(postprocessor::pypost const ¶m, std::string const &newval) override
Post-Processor for neural network pipeline.
Pre-Processor for neural network pipeline.
std::shared_ptr< PreProcessorForPython > getPreProcForPy() const
Get a pointer to our python-friendly interface.
#define LFATAL(msg)
Convenience macro for users to print out console or syslog messages, FATAL level.
#define LINFO(msg)
Convenience macro for users to print out console or syslog messages, INFO level.
boost::python::list pyVecToList(std::vector< T > const &v)
Helper to convert std::vector<T> to python list.
bool hasattr(boost::python::object &o, char const *name)
Check whether a boost::python::object has an attribute.
Main namespace for all JeVois classes and functions.