Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU): dGPU and Jetson Orin
• DeepStream Version: 8.0
• JetPack Version (valid for Jetson only): Latest
• TensorRT Version: Shipped with Deepstream Versions
• NVIDIA GPU Driver Version (valid for GPU only): 580.126.09
• Issue Type( questions, new requirements, bugs): BUG
• How to reproduce the issue ? I am attempting to migrate my C Deepstream application to using the Service Maker C++ API but it doesn’t look like a lot of the features are finished. Specifically looking at the ClassifierMetadata in a probe I am creating. The ClassifierMetadata only appears to expose labels and not confidence score from the SGIE.
**• Requirement details: The ClassifierMetadata should also include confidence score.
**
I am attempting to write a probe to show the SGIE Classification Label and Confidence score but I am only seeing the label being exposed in the ClassifierMetadata class:
#pragma once
#include "buffer_probe.hpp"
using namespace deepstream;
class SGIELabelOverlayProbe : public BufferProbe::IBatchMetadataObserver {
public:
probeReturn handleData(BufferProbe& probe, const BatchMetadata& batch) override {
// Iterate through all frames in the batch
batch.iterate([](const FrameMetadata& frame) {
// Iterate through all objects in the frame
frame.iterate([](const ObjectMetadata& obj) {
// We will build a new label string here
std::stringstream new_label;
// Start with the Primary GIE label (e.g., "Car")
// Note: getLabel() typically returns the PGIE class label
new_label << obj.label();
// Iterate through Classifier Metadata (SGIE results) attached to this object
obj.iterate([](const ClassifierMetadata& classifier) {
// Iterate through the labels generated by this classifier
classifier.iterate([](const LabelMetadata& label) {
// Append the SGIE label (e.g., "Color: Red")
// You can format this string however you want
// label.label() returns the string text of the classification
new_label << " [" << label.label() << "]";
});
});
// Update the object's display text to include the SGIE info.
// This ensures the OSD plugin draws the full text above the bounding box.
// Note: The setLabel method updates the text_params.display_text used by OSD.
const_cast<ObjectMetadata&>(obj).setLabel(new_label.str());
});
});
return probeReturn::Probe_Ok;
}
};
The ClassifierMetadata class in the metadata.hpp looks like so:
/** @brief Meta generated from a classifier */
class ClassifierMetadata : public Metadata {
public:
typedef std::unique_ptr<AbstractIterator<ClassifierMetadata>> Iterator;
/**
* @brief Constructor through opaque data pointer
*
* By default an empty classifier metadata object is created.
*
*/
ClassifierMetadata(void* data = nullptr);
/** @brief Destructor */
virtual ~ClassifierMetadata();
/** @brief Number of the lables generated by the classifier */
unsigned int nLabels() const;
/** @brief Identifying the unique component that generates the metadata */
unsigned int uniqueComponentId() const;
/** @brief Get the nth label */
std::string getLabel(unsigned int nth) const;
};
Why isn’t confidence score exposed along with the label?