I’m using “/deepstream-4.0/sources/objectDetector_Yolo/nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp” as a custom parser. My problem is in “attach_metadata_detector” function in file : “gst-nvinfer/gstnvinfer_meta_utils.cpp” #Ln83 :
obj_meta->confidence = 0.0;
How can I change this to get the confidence calculated before in “nvdsparsebbox_Yolo.cpp” ??
Is there any way to access NvDsInferObjectDetectionInfo object from “attach_metadata_detector” function ??
I think you can add “confidence” parameters in “NvDsInferObject”
and set the value in “NvDsInferContextImpl::clusterAndFillDetectionOutputCV”
and then it can get confidence in “attach_metadata_detector()”
I couldn’t make it work. I’ve added “confidence” parameters in “NvDsInferObject” and modified “NvDsInferContextImpl::clusterAndFillDetectionOutputCV” :
for (unsigned int c = 0; c < m_NumDetectedClasses; c++)
{
/* Add coordinates and class ID and the label of all objects
* detected in the frame to the frame output. */
for (auto & rect:m_PerClassCvRectList[c])
{
NvDsInferObject &object = output.objects[output.numObjects];
object.left = rect.x;
object.top = rect.y;
object.width = rect.width;
object.height = rect.height;
object.confidence = 0.5;
object.classIndex = c;
object.label = nullptr;
if (c < m_Labels.size() && m_Labels[c].size() > 0)
object.label = strdup(m_Labels[c][0].c_str());
output.numObjects++;
}
}
Also, I modified “attach_metadata_detector()” :
obj_meta->confidence = obj.confidence;
I rebuild “nvdsinfer” and “gst-nvinfer” libraries.
However, I get :
confidence = 4747328616950188978942771200.000000
I tried to set the values of object.left, object.top, object.width, object.height to zero in “NvDsInferContextImpl::clusterAndFillDetectionOutputCV” function.
I rebuild everything.
I still got non null bbox detections (which doesn’t suppose to happen).
This means that “NvDsInferContextImpl::clusterAndFillDetectionOutputCV” doesn’t do anything.
I even tried modifying “NvDsInferContextImpl::clusterAndFillDetectionDBSCAN” function and still got the same results.
attach nvinfer process here. DBScan have confidence, but not for opencv. I think you can try to add confidence as my comment 2. We will fix this issue in the next version.