Replace existing labels with custom labels for custom weights.

I am trying to use the deepstream-yolo-app from deepstream reference apps. I need to change the labels displayed in the terminal with my own,with the correct count output, frame-wise. How may I do that? Thanks for reading.

Can you refer to the sample
sources/gst-plugins/gst-dsexample -> attach_metadata_object()
Can this meet your requirement ?

Hi armaanpuri17,

Have you tried with previous suggestions?
Is this still an issue to support?


@kayccc, @ChrisDing
No. We weren’t able to fix it with this. Where are the original labels coming from? We are unable to find this.

It gets loaded from a file from the data directory.

Here -

@NvCJR Thanks for you reply. We had changed the labels.txt file with our labels. However, it seemed they were being replaced by the default labels. Also, the code increments the object count based on the predefined labels for each frame; we need to replace that with our labels. What I meant to ask by where the labels are coming from is where they’re being assigned their numerical label and how that is incremented upon detection in the frame. For eg: we have classes like small car, big car, lcv, etc. Our weights have been trained on those labels. However, simply replacing labels.txt with our labels didn’t seem to help.

To clarify further, the detections in the video are correct, according to our labels. However, in the terminal the labels are still the old ones. We seek to change those too to our labels.

It’s getting printed from the function here -

Please change it according to your needs.