#include <visp3/detection/vpDetectorDNNOpenCV.h>
|
| NetConfig () |
|
| NetConfig (const NetConfig &config) |
|
| NetConfig (float confThresh, const float &nmsThresh, const std::vector< std::string > &classNames, const cv::Size &dnnInputSize, const double &filterSizeRatio=0., const cv::Scalar &mean=cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor=2./255., const bool &swapRB=true, const DNNResultsParsingType &parsingType=vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename="", const std::string &configFilename="", const std::string &framework="") |
|
| NetConfig (const float &confThresh, const float &nmsThresh, const std::string &classNamesFile, const cv::Size &dnnInputSize, const double &filterSizeRatio=0., const cv::Scalar &mean=cv::Scalar(127.5, 127.5, 127.5), const double &scaleFactor=2./255., const bool &swapRB=true, const DNNResultsParsingType &parsingType=vpDetectorDNNOpenCV::USER_SPECIFIED, const std::string &modelFilename="", const std::string &configFilename="", const std::string &framework="") |
|
std::string | toString () const |
|
NetConfig & | operator= (const NetConfig &config) |
|
◆ NetConfig() [1/4]
vpDetectorDNNOpenCV::NetConfig::NetConfig |
( |
| ) |
|
|
inline |
◆ NetConfig() [2/4]
vpDetectorDNNOpenCV::NetConfig::NetConfig |
( |
const NetConfig & |
config | ) |
|
|
inline |
◆ NetConfig() [3/4]
vpDetectorDNNOpenCV::NetConfig::NetConfig |
( |
float |
confThresh, |
|
|
const float & |
nmsThresh, |
|
|
const std::vector< std::string > & |
classNames, |
|
|
const cv::Size & |
dnnInputSize, |
|
|
const double & |
filterSizeRatio = 0. , |
|
|
const cv::Scalar & |
mean = cv::Scalar(127.5, 127.5, 127.5) , |
|
|
const double & |
scaleFactor = 2. / 255. , |
|
|
const bool & |
swapRB = true , |
|
|
const DNNResultsParsingType & |
parsingType = vpDetectorDNNOpenCV::USER_SPECIFIED , |
|
|
const std::string & |
modelFilename = "" , |
|
|
const std::string & |
configFilename = "" , |
|
|
const std::string & |
framework = "" |
|
) |
| |
|
inline |
Construct a new Net Config object.
- Parameters
-
confThresh | The confidence threshold to keep a detection. |
nmsThresh | The Non-Maximum Suppression threshold to merge overlapping detections. |
classNames | A vector containing the list of classes the DNN can detect. |
dnnInputSize | The size of the input that the DNN is expecting. |
filterSizeRatio | The threshold for the size filter that the user can chose to activate or not (see vpDetectorDNNOpenCV::filterDetectionSingleClassInput and vpDetectorDNNOpenCV::filterDetectionMultiClassInput methods for more information). |
mean | The mean value we must deduce to each color channel of the image. |
scaleFactor | The scale factor that will be multiplied to each color channel of the image. |
swapRB | If true, will swap the red and blue channel of the input image. |
parsingType | The type of parsing method to use to interpret the DNN raw results. |
modelFilename | The path towards the DNN weights. |
configFilename | The path towards the additional DNN configuration file potentially needed. |
framework | The type of framework used to store the weights of the DNN. |
Definition at line 370 of file vpDetectorDNNOpenCV.h.
◆ NetConfig() [4/4]
vpDetectorDNNOpenCV::NetConfig::NetConfig |
( |
const float & |
confThresh, |
|
|
const float & |
nmsThresh, |
|
|
const std::string & |
classNamesFile, |
|
|
const cv::Size & |
dnnInputSize, |
|
|
const double & |
filterSizeRatio = 0. , |
|
|
const cv::Scalar & |
mean = cv::Scalar(127.5, 127.5, 127.5) , |
|
|
const double & |
scaleFactor = 2. / 255. , |
|
|
const bool & |
swapRB = true , |
|
|
const DNNResultsParsingType & |
parsingType = vpDetectorDNNOpenCV::USER_SPECIFIED , |
|
|
const std::string & |
modelFilename = "" , |
|
|
const std::string & |
configFilename = "" , |
|
|
const std::string & |
framework = "" |
|
) |
| |
|
inline |
Construct a new Net Config object.
- Parameters
-
confThresh | The confidence threshold to keep a detection. |
nmsThresh | The Non-Maximum Suppression threshold to merge overlapping detections. |
classNamesFile | The path towards the file containing the classes names, written as a YAML string array or one class name by line. |
dnnInputSize | The size of the input that the DNN is expecting. |
filterSizeRatio | The threshold for the size filter that the user can chose to activate or not (see vpDetectorDNNOpenCV::filterDetectionSingleClassInput and vpDetectorDNNOpenCV::filterDetectionMultiClassInput methods for more information). |
mean | The mean value we must deduce to each color channel of the image. |
scaleFactor | The scale factor that will be multiplied to each color channel of the image. |
swapRB | If true, will swap the red and blue channel of the input image. |
parsingType | The type of parsing method to use to interpret the DNN raw results. |
modelFilename | The path towards the DNN weights. |
configFilename | The path towards the additional DNN configuration file potentially needed. |
framework | The type of framework used to store the weights of the DNN. |
Definition at line 404 of file vpDetectorDNNOpenCV.h.
◆ operator=()
◆ parseClassNamesFile()
static std::vector<std::string> vpDetectorDNNOpenCV::NetConfig::parseClassNamesFile |
( |
const std::string & |
filename | ) |
|
|
inlinestatic |
Parse the file containing the list of classes the DNN can detect. These classes can be written either as a YAML array (i.e. ["classname_0", ... ,"classname_last"]) or with one classname by row (without quotes).
For example, in the case of a yaml file called my-classes.yaml
, one content could be:
$ cat my-classes.yaml
[ "person", "bicycle", "car"]
And in the case of a text file called my-classes.txt
, similar content could be:
$ cat my-classes.txt
person
bicycle
car
- Parameters
-
filename | The path towards the file containing the list of classes the DNN can detect. |
- Returns
- std::vector<std::string> The list of classes the DNN can detect.
Definition at line 286 of file vpDetectorDNNOpenCV.h.
Referenced by vpDetectorDNNOpenCV::parseClassNamesFile().
◆ toString()
std::string vpDetectorDNNOpenCV::NetConfig::toString |
( |
| ) |
const |
|
inline |
◆ from_json
void from_json |
( |
const json & |
j, |
|
|
NetConfig & |
config |
|
) |
| |
|
friend |
Read the network configuration from JSON. All values are optional and if an argument is not present, the default value defined in the constructor is kept.
- Parameters
-
j | The JSON object, resulting from the parsing of a JSON file. |
config | The configuration of the network, that will be initialized from the JSON data. |
Definition at line 202 of file vpDetectorDNNOpenCV.h.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const NetConfig & |
config |
|
) |
| |
|
friend |
◆ to_json
void to_json |
( |
json & |
j, |
|
|
const NetConfig & |
config |
|
) |
| |
|
friend |
◆ vpDetectorDNNOpenCV
friend vpDetectorDNNOpenCV::NetConfig::vpDetectorDNNOpenCV |