Hello, I’m trying to use a classification model but I have issues with id of class detected. It return an id of -1.
My model take a 3x224x224 image input and should return an id in range of [0,10[.
I don’t have warning or error in the console.
The capsule object NULL don’t allow me to view the label inside the object.
My model come from pyt model converted to onnx and to trt.
I have my blue bounding box on the extremes of my video.
My code is here: Hastebin
The configuration of the pgie file is here: Hastebin
The starting output when I running the code is here: Hastebin
My print output are here: Hastebin
The model output is a list of probabilities where each pair (probability, index) corresponds to the probability that the image belongs to the class number “index”. In my case, I only need the label with the highest probability.
He only needs to classify the current image, there is no detection here.
This may come from the Python code.
With a model that returns the softmax of the 10 classes, am I supposed to retrieve the identifier of the class with the highest probability using NvDsObjectMeta#class_id or am I supposed to retrieve the softmax list myself using another method?
And now, I still have an id of -1 ouput but I have the right label on the top left corner of my application and he is updating correctly.
If I try to get the text of the label, I have a None return.
My way to do that is:
display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta)
display_meta.num_labels = 1
py_nvosd_text_params = display_meta.text_params[0]
print(pyds.get_string(py_nvosd_text_params.display_text))
Again, I think that my Python code is not correctly write to get the id the current classified class or at least to get the label of the current classified class.
I’m sorry to insist, but labels are displayed at the top left of my application (they are correct) without my having ordered any label to be put on ndvsosd. I have tried to retrieve the text from the displaymeta with the above lines of code but I get “None” return. Do you have a solution for retrieving this automatically placed label?
Labels coming from the labels.txt, for example: “Esophagus”.
Everything makes me think that the model and the configuration of the pgie file are correct because the right label is displayed.
Yes, absolutely. Or the label id.
Deepstream seems to automatically parse the output of the model (softmax) and display the label of the class found at the top left of the application without my asking it to.