![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpDetectorDNNOpenCV.h>
Public Member Functions | |
| 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) |
Static Public Member Functions | |
| static std::vector< std::string > | parseClassNamesFile (const std::string &filename) |
Public Attributes | |
| friend | vpDetectorDNNOpenCV |
Friends | |
| void | from_json (const nlohmann::json &j, NetConfig &config) |
| void | to_json (nlohmann::json &j, const NetConfig &config) |
| std::ostream & | operator<< (std::ostream &os, const NetConfig &config) |
Structure containing some information required for the configuration of a vpDetectorDNNOpenCV object.
Definition at line 190 of file vpDetectorDNNOpenCV.h.
|
inline |
Default constructor of the structure vpDetectorDNNOpenCV::NetConfig , required for JSON serialization/deserialization.
Definition at line 332 of file vpDetectorDNNOpenCV.h.
References vpDetectorDNNOpenCV::USER_SPECIFIED, and vpDetectorDNNOpenCV.
Referenced by from_json, NetConfig(), operator<<, operator=(), and to_json.
|
inline |
Definition at line 349 of file vpDetectorDNNOpenCV.h.
References NetConfig().
|
inline |
Construct a new Net Config object.
| 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 383 of file vpDetectorDNNOpenCV.h.
References vpDetectorDNNOpenCV::USER_SPECIFIED.
|
inline |
Construct a new Net Config object.
| 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 417 of file vpDetectorDNNOpenCV.h.
References parseClassNamesFile(), and vpDetectorDNNOpenCV::USER_SPECIFIED.
Definition at line 460 of file vpDetectorDNNOpenCV.h.
References NetConfig().
|
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
| filename | The path towards the file containing the list of classes the DNN can detect. |
Definition at line 299 of file vpDetectorDNNOpenCV.h.
Referenced by NetConfig().
|
inline |
Definition at line 435 of file vpDetectorDNNOpenCV.h.
References vpDetectorDNNOpenCV::dnnResultsParsingTypeToString().
|
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.
| 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 215 of file vpDetectorDNNOpenCV.h.
References vpException::badValue, vpException::dimensionError, vpDetectorDNNOpenCV::dnnResultsParsingTypeFromString(), vpDetectorDNNOpenCV::dnnResultsParsingTypeToString(), and NetConfig().
|
friend |
Definition at line 454 of file vpDetectorDNNOpenCV.h.
References NetConfig().
|
friend |
Parse a vpDetectorDNNOpenCV::NetConfig into JSON format.
| j | A JSON parser object. |
| config | The vpDetectorDNNOpenCV::NetConfig that must be parsed into JSON format. |
Definition at line 255 of file vpDetectorDNNOpenCV.h.
References vpDetectorDNNOpenCV::dnnResultsParsingTypeToString(), and NetConfig().
| friend vpDetectorDNNOpenCV::NetConfig::vpDetectorDNNOpenCV |
Definition at line 477 of file vpDetectorDNNOpenCV.h.
Referenced by NetConfig().