Model doesnt return object names only label number

Hi, im trying to use the yolov5 inference and while it runs it only returns an integer of the object class and the name field is just ‘None’. Has anyone else seen this or know how to fix it?

im running yolov5 detection example code.

1 Like

Hello,

Could you be a bit more specific about the code you are running ? A link maybe, or the actual code ?

Antoine

hi, im running the custom detection in the exaples found here:

Okay, and where does the problem happen ? What is returning wrong ? What is this name field that you mention ?

Antoine

Hi @alassagne
I am facing the same problem that @chad write about.
He means yolo should write the class names instead of the numbers. You can find the sample screenshot.

i never got it fixed so what i did was extract the names, put them in a separate dict and in the code where that text is generated it uses the class number to get the name from the dictionary.

Thank you for reporting this. We’ll investigate and try to fix that.

Has the problem been solved?

hi, could you tell me exactly how to make it?

Hi, what do you mean “how to make it” ? As far as I know the problem is still there.

Hi! have you fixed it?

Hi, we don’t retrieve actual class names in the Custom Object Detection module. Even the class id is entered manually by the users here : https://github.com/stereolabs/zed-sdk/blob/master/object%20detection/custom%20detector/python/pytorch_yolov8/detector.py#L57

We could make you input the class names too, but it would be a bad solution. It actually make more sense to do what @chad did, having a dict that contains the name of the classes in regards to their id.

Hi, I’m trying to do the same thing but I’m getting confused. What are the steps to achieving what @chad did?

Where is the class names list and list of class IDs obtained? Thanks

The class names are given by you and your model, along with the Ids. This list allows you to find the name back from the ZED SDK which only get the id from the detection.