digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::DNNBaseDetectorModel Class Referenceabstract
+ Inheritance diagram for Digikam::DNNBaseDetectorModel:

Public Member Functions

 DNNBaseDetectorModel (float scale, const cv::Scalar &val, const cv::Size &inputImgSize)
 
virtual QHash< QString, QVector< QRect > > detectObjects (const cv::Mat &inputImage)
 detectObjects return the predicted objects and localization as well (if we use deeplearning for object detection like YOLO, etc) otherwise the map whose the key is the objects name and their values are empty.
 
virtual QList< QHash< QString, QVector< QRect > > > detectObjects (const std::vector< cv::Mat > &inputBatchImages)
 detectObjects in batch images (fixed batch size).
 
QList< QString > generateObjects (const cv::Mat &inputImage)
 generateObjects in one image return just the predicted objects without locations of objects using for the assignment tagging names.
 
QList< QList< QString > > generateObjects (const std::vector< cv::Mat > &inputImage)
 generateObjects in batch images return just the predicted objects without locations of objects using for the assignment tagging names.
 
cv::Size getinputImageSize () const
 Return the input Image Size from Deep NN model.
 
std::vector< cv::String > getOutputsNames () const
 
virtual QList< QString > getPredefinedClasses () const
 Get predefined objects according to selected model.
 
QList< QString > loadDetectionClasses ()
 
virtual QHash< QString, QVector< QRect > > postprocess (const cv::Mat &inputImage, const cv::Mat &out) const =0
 
QList< QHash< QString, QVector< QRect > > > postprocess (const std::vector< cv::Mat > &inputBatchImages, const std::vector< cv::Mat > &outs) const
 
std::vector< cv::Mat > preprocess (const cv::Mat &inputImage)
 
std::vector< cv::Mat > preprocess (const std::vector< cv::Mat > &inputBatchImages)
 
double showInferenceTime ()
 

Static Public Attributes

static float nmsThreshold = 0.4F
 Threshold for nms suppression.
 
static float scoreThreshold = 0.45F
 Threshold for class detection score.
 
static int uiConfidenceThreshold = DNN_MODEL_THRESHOLD_NOT_SET
 Threshold for bbox detection. It can be init and changed in the GUI.
 

Protected Member Functions

virtual bool loadModels ()=0
 

Protected Attributes

cv::Size inputImageSize
 
cv::Scalar meanValToSubtract
 
DNNModelBasemodel = nullptr
 
QList< QString > predefinedClasses
 
float scaleFactor = 1.0F
 

Member Data Documentation

◆ uiConfidenceThreshold

int Digikam::DNNBaseDetectorModel::uiConfidenceThreshold = DNN_MODEL_THRESHOLD_NOT_SET
static

setting 1000 will use the value from dnnmodels.conf if passed in