• Hardware Platform: Jetson AGX Xavier
• DeepStream Version: 6.2
• JetPack Version: 5.0.2
• TensorRT Version: 8.4.1
• Issue Type: bugs
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.
I checked a topic with the same class id problem (Primary classifier class_id=-1 and result_prob=0.58 for all frames - #5 by harryhsl8c) but the problem is still here. I tried to modify the value of my process-mode from 1 to 2 (for a classification) but I’m not longer able to get a class_id.
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
Do you have any suggestion ?
What is your model’s output? What is the model’s feature? Will it detect and classify objects at the same time?
I can’t access anything through the hastebin links, can you post the files directly?
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.
Here are the files:
endoscopy_pgie_config.txt (269 Bytes)
final_infer.py (5.8 KB)
out.txt (2.3 KB)
Are you sure the “output0” layer output softmax of the 10 classes?
Where is your label file?
This is a typical classifier configuration file deepstream_tao_apps/configs/multi_task_tao/pgie_multi_task_tao_config.txt at master · NVIDIA-AI-IOT/deepstream_tao_apps (github.com) for your reference.
If the model does not need normalization for preprocessing, please set “net-scale-factor=1.0”.
Thank you for the link. I updated my pgie config file to:
endoscopy_pgie_config.txt (379 Bytes)
but the output is exactly the same.
Also, there is my labels file:
labels.txt (96 Bytes)
The content of the label file should be
Please check your input also. DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums
I updated the label file but nothing change.
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?
I tried a new configuration for the pgie file:
endoscopy_pgie_config.txt (334 Bytes)
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.num_labels = 1
py_nvosd_text_params = display_meta.text_params
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.
Have you any idea to resolve this problem ?
Your model output dimension is 10, so the default output parsin algorithm inside gst-nvinfer is not compatible to your model. You need implement your own output parsing. Please refer to deepstream_lpr_app/deepstream-lpr-app/lpr_config_pgie.txt at master · NVIDIA-AI-IOT/deepstream_lpr_app (github.com) for how to customize classifier output parsing callback function.
Okey, I’ll try it, thank you for the link.
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?
What labels are displayed on top-left of the video?
Do you mean you want to get the label for the classification result?
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.
I’ve converted the code to Python and it works very well. I have the id and the label of my class.
Thanks a lot!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.