marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.4k stars 345 forks source link

Displaying Confidence value with label in deepstream-app #355

Closed Abulala10 closed 1 year ago

Abulala10 commented 1 year ago

I understood that we have to edit the process_meta() function in deepstream_app.c to show the confidence value on screen, but what exactly do we have to edit ?

marcoslucianops commented 1 year ago

It's better to create your own code instead to edit the deepstream-app. See: https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

Tstegen21 commented 1 year ago

Hello @marcoslucianops , I also have a similar issue . But for my case , I am using deepstream_app in c . Any suggestions regarding this without python-bindings (I do not want to switch to python) .

marcoslucianops commented 1 year ago

You can use the C/C++ apps. They are located in /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps.

Abulala10 commented 1 year ago

It's better to create your own code instead to edit the deepstream-app. See: https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

Okay and do you have any idea as to what part of code I should edit, if I am using the C/C++ app ?

marcoslucianops commented 1 year ago

For the test apps (test1, test2, etc), see the pad_buffer_probe functions. Take a look on https://github.com/marcoslucianops/DeepStream-Yolo#extract-metadata to see strcuture of the NvDsFrameMeta and NvDsObjMeta.

Tstegen21 commented 1 year ago

Great @marcoslucianops I was able to do some basic changes and run the app , but I am facing issues while trying to display my confidence scores while inferencing . Could please guide me how to display the confidence score on the screen ?

marcoslucianops commented 1 year ago

Without tracker

snprintf(obj_meta->text_params.display_text, MAX_LABEL_SIZE, "%s (%.2f)", obj_meta->obj_label, obj_meta->confidence);

With tracker

snprintf(obj_meta->text_params.display_text, MAX_LABEL_SIZE, "%s %ld (%.2f)", obj_meta->obj_label, obj_meta->object_id, obj_meta->confidence);
Abulala10 commented 1 year ago

Without tracker

snprintf(obj_meta->text_params.display_text, MAX_LABEL_SIZE, "%s (%.2f)", obj_meta->obj_label, obj_meta->confidence);

With tracker

snprintf(obj_meta->text_params.display_text, MAX_LABEL_SIZE, "%s %ld (%.2f)", obj_meta->obj_label, obj_meta->object_id, obj_meta->confidence);

Thank you @marcoslucianops !!! It works !

Tstegen21 commented 1 year ago

Cheers @marcoslucianops , I am able to display the conf values on the screen .

Thank you !!