40 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(netw,
Net, "Network to load. This meta-parameter sets parameters "
45 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(
dataroot, std::
string, "Root path for data, config, and weight files. "
46 "If empty, use the module's path.",
47 JEVOIS_SHARE_PATH "/darknet/single", ParamCateg);
50 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(
datacfg, std::
string, "Data configuration file (if relative, relative to "
52 "
cfg/imagenet1k.data", ParamCateg);
55 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(
cfgfile, std::
string, "Network configuration file (if relative, relative to "
57 "
cfg/tiny.
cfg", ParamCateg);
60 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(
weightfile, std::
string, "Network weights file (if relative, relative to "
62 "weights/tiny.weights", ParamCateg);
65 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(namefile, std::
string, "Category names file, or empty to fetch it from the "
67 "config file (if relative, relative to
dataroot)",
71 JEVOIS_DECLARE_PARAMETER(top,
unsigned int, "Max number of top-scoring predictions that
score above thresh to return",
75 JEVOIS_DECLARE_PARAMETER(thresh,
float, "Threshold (in percent confidence) above which predictions will be reported",
76 20.0
F,
jevois::Range<
float>(0.0
F, 100.0
F), ParamCateg);
79 JEVOIS_DECLARE_PARAMETER(threads,
int, "Number of parallel computation threads",
80 6,
jevois::Range<
int>(1, 1024), ParamCateg);
104 Darknet(std::string
const & instance,
bool show_detail_params =
false);
108 void postInit()
override;
114 void postUninit()
override;
121 float predict(cv::Mat
const & cvimg, std::vector<jevois::ObjReco> &
results);
128 float predict(
image & im, std::vector<jevois::ObjReco> &
results);
135 void resizeInDims(
int w,
int h);
139 void getInDims(
int &
w,
int &
h,
int & c);
143 char ** names =
nullptr;
152 void onParamChange(dknet::namefile
const & param, std::string
const & newval)
override;