Open RiccardoSegala04 opened 1 year ago
Hi @RiccardoSegala04,
The Hailo ModelZoo has an evaluation CLI tool called eval, it can be used for both calculating accuracy and visualizing results.
To get more information about the eval tool's usage, run hailomz eval -h
And you can find the code for the ModelZoo's detection evaluation here.
We also offer standalone examples for yolov8 in HACER. They include inference, postprocessing, and visualization:
Let me know if anything is unclear.
Thank you for your response.
I tried using hailomz eval command, and on the model i downloaded from hailo model zoo repository it works. Our model is a retrained one with less prediction classes than the original one (7 classes), and it does not work with that command.
hailomz eval --hef /path/to/hef --target hailo8 --data-path /path/to/data --visualize yolov8n
I get this error:
score = tf.reshape(node, (-1, fm_size_h * fm_size_w, num_classes))
ValueError: Dimension size must be evenly divisible by 512000 but is 358400
I thought it was because of the different number of classes, so i tried to use the python example you showed me. Even there i needed to change the shape of the tensors i get from the hailo, but i can't get any result, like the network is imported in a wrong way...
What should i do?
Hi @RiccardoSegala04
The model-zoo models are being configured through YAML files, yolov8n configuration can be seen here, and it assumes you run on COCO dataset (80 classes).
pleas try to add the right number of classes into this YAML:
evaluation: classes: 7
Also - the shapes might be wrong because different order of parsing, in the yolov8n.yaml you can see what layers were defined as the outputs... in the info you will see the output shapes
output_shape: 80x80x80, 80X80X64, 40X40X80, 40X40X64, 20X20X80, 20X20X64
which our model zoo expects
And if i wanted to use my model with the python examples the only things i should change in the code are the network output shapes?
@RiccardoSegala04
For the python example you need to pass the --classes-num
flag with the relevant number of classes
I did that but it didn't work because the output shape of my model is different, because the number of classes is different. So i changed that in the code, and it runs, but it seems like the network is imported in the wrong way..
@RiccardoSegala04
We will be happy to assist you with it through our ticketing system. Click here to open a ticket.
thank you
You can modify yolo_inference.py
lines 152 through 157 with the following sed command to recover the functionality of the --class-num
CLI argument .
sed -i 's/, 80\]/, num_of_classes\]/g' yolo_inference.py
If you want to revert for whatever reason, run
git checkout yolo_inference.py
Hello,
I retrained a yolov8n network using the instructions i found on hailo model zoo github. Now i have a .hef network, but when I try to infer with this model I get in output 6 vectors of different dimensions. What's the correct way to translate them in order to get a list of actual detections?