With a custom yolov5 model with 2 classes renamed as myclass0 and myclass1, the hailomz eval
is providing very bad results. When I look into the generated video, I see that my objects are detected, but classified as “person” and “bycicle” (ie the old COCO labels names).
I double check my .pt and .onnx files, and they have the proper labels.
So I have the feeling that the eval script is using some previous class label, hence producing wrong AP results at the end.
So first question : how to specify new label names for the eval stage ?
Hey @sylvain.fabre ,
You’re right — the evaluation is pulling in the wrong class labels. By default, the Hailo Model Zoo (hailomz
) uses the labels defined in the YAML config. If that file still lists the original COCO labels, you’ll end up seeing results like “person” or “bicycle” even if your model was trained on something completely different.
How to Fix It
You need to make sure your YAML config reflects that.
Update Your YAML Config
In the YAML file you’re using with hailomz compile
and hailomz eval
, update these fields:
1. evaluation.classes
Set this to the number of classes — for example, 2
if you have two.
2. postprocessing.classes
Same thing — set to 2
.
3. postprocessing.class_names
This is the important one. Set your custom class names like this:
postprocessing:
classes: 2
class_names:
- myclass0
- myclass1
This makes sure both the post-processing and evaluation stages know what your model’s outputs mean.
Example Snippet
If you’re using a config file like yolov5m_custom.yaml
, it should include:
evaluation:
classes: 2
postprocessing:
classes: 2
class_names:
- myclass0
- myclass1
Also double-check that this file is the one you’re actually passing to the --yaml
flag in your commands.