30namespace jevois {
class StdModule; }
39 JEVOIS_SHARE_PATH
"/darknet/yolo", ParamCateg);
43 "cfg/coco.data", ParamCateg);
47 "cfg/yolov3-tiny.cfg", ParamCateg);
51 "weights/yolov3-tiny.weights", ParamCateg);
55 "config file (if relative, relative to dataroot)",
90 jevois::Parameter<yolo::dataroot, yolo::datacfg, yolo::cfgfile, yolo::weightfile, yolo::namefile,
91 yolo::nms, yolo::thresh, yolo::hierthresh, yolo::threads>
95 Yolo(std::string
const & instance);
111 float predict(cv::Mat
const & cvimg);
142 void getInDims(
int & w,
int &
h,
int & c)
const;
Detect multiple objects in scenes using the Darknet YOLO deep neural network.
void drawDetections(jevois::RawImage &outimg, int inw, int inh, int xoff, int yoff)
Draw the detections.
void sendSerial(jevois::StdModule *mod, int inw, int inh)
Send serial messages about detections.
JEVOIS_DECLARE_PARAMETER(cfgfile, std::string, "Network configuration file (if relative, relative to dataroot)", "cfg/yolov3-tiny.cfg", ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(thresh, float, "Detection threshold in percent confidence", 24.0F, jevois::Range< float >(0.0F, 100.0F), ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(hierthresh, float, "Hierarchical detection threshold in percent confidence", 50.0F, jevois::Range< float >(0.0F, 100.0F), ParamCateg)
Parameter.
void computeBoxes(int inw, int inh)
Compute the boxes.
void resizeInDims(int w, int h)
Resize the network's input image dims.
std::future< void > itsReadyFut
JEVOIS_DECLARE_PARAMETER(threads, int, "Number of parallel computation threads", 6, jevois::Range< int >(1, 1024), ParamCateg)
Parameter.
float predict(cv::Mat const &cvimg)
Processing function, results are stored internally in the underlying Darknet network object.
JEVOIS_DECLARE_PARAMETER(weightfile, std::string, "Network weights file (if relative, relative to dataroot)", "weights/yolov3-tiny.weights", ParamCateg)
Parameter.
std::atomic< bool > itsReady
void postUninit() override
Un-initialize and free resources.
JEVOIS_DECLARE_PARAMETER(namefile, std::string, "Category names file, or empty to fetch it from the network " "config file (if relative, relative to dataroot)", "", ParamCateg)
Parameter.
void getInDims(int &w, int &h, int &c) const
Get input width, height, channels.
JEVOIS_DECLARE_PARAMETER(dataroot, std::string, "Root path for data, config, and weight files. If empty, use " "the module's path.", JEVOIS_SHARE_PATH "/darknet/yolo", ParamCateg)
Parameter.
void postInit() override
Initialize, configure and load the network in a thread.
JEVOIS_DECLARE_PARAMETER(datacfg, std::string, "Data configuration file (if relative, relative to dataroot)", "cfg/coco.data", ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(nms, float, "Non-maximum suppression intersection-over-union threshold in percent", 45.0F, jevois::Range< float >(0.0F, 100.0F), ParamCateg)
Parameter.
virtual ~Yolo()
Virtual destructor for safe inheritance.