Troubleshooting Custom YOLOv8s-Pose Model for Action Classification on Hailo8L: Issues with Inference and Custom Class Detection

I’m working on creating a custom model based on YOLOv8s-pose for the Raspberry Pi 5 AI Kit (Hailo8L). The goal is to classify three actions: sitting, standing, and about-to-stand. I followed the examples provided in the Hailo community and successfully generated the model. However, when running inference, I’m getting detections for the class “person,” which is the default class in YOLOv8s-pose, instead of the custom classes I trained for.

I believe there’s an issue with the parsing, optimizing, or compiling steps, but I’m new to Hailo and am not sure if I need to modify the YAML file for the classes or what exact commands I should run to train this custom model properly.

For reference, these are the commands I used earlier:
hailomz parse --hw-arch hailo8l --ckpt ./best.onnx yolov8s_pose
hailomz optimize --hw-arch hailo8l --har ./yolov8s_pose.har yolov8s_pose
hailomz compile yolov8s_pose --hw-arch hailo8l --har ./yolov8s_pose.har

ive used v3.27.0 compiler and v2.11.0 model zoo for create har and hef files as i rpi 5 uses hailort v4.17.0

@HAILO is there any update in this?
@Nadav @omria

@HAILO is there any update in this?
@Nadav @omria

What do yo umean by getting detections for the ‘person’ class instead the classes that you’ve created? How have you ran it?

@omria @Nadav
Im using: Hailo-Application-Code-Examples/runtime/cpp/pose_estimation/yolov8_pose at main · hailo-ai/Hailo-Application-Code-Examples · GitHub

i’ve tried #define SCORE_THRESHOLD 0.1
#define IOU_THRESHOLD 0.1
#define NUM_CLASSES 4

im not sure my pytorch model is correctly compiled to hef or the problem is with the script that allows only one class for pose detection. The pytorch version of the model is perfectly working the local machine.

Could you please give a detailed step for compiling multiple own classes yolo8spose model in hailo. So far there is only guide for object detection with our own classes in the hailo community.

Also can you share the application code for hailo that can do pose detection with multiple classes?

referring to the exmaple, the labels are taken here:
Hailo-Application-Code-Examples/runtime/cpp/pose_estimation/yolov8_pose/yolov8pose_postprocess.cpp at main · hailo-ai/Hailo-Application-Code-Examples (github.com)

Since the network we have was trained on the COCO dataset, the first 4 classes are:
image

@Nadav im aware it is trained on coco dataset.
Could you please give a detailed step for compiling multiple own classes yolo8spose model in hailo. So far there is only guide for object detection with our own classes in the hailo community.

Also can you share the application code for hailo that can do pose detection with multiple classes?

Hi @prasaanthg,
We don’t have a deatiled guide, so I cannot share one, but we will be more than happy to share the guide from you, like other community project that we highlight!

@Nadav can you atleast say what i can try to make it work

Hi @prasaanthg,

This is most likely not the case, as the labels are not stored in the compiled model.

As @Nadav explained, the labels are taken from a file in the example that you are using. All you need to do is change the file with your labels. This is the file that needs to be changed:

@nina-vilela yeah i aware of that. but we should mention the number of classes right? we should specify that number of classes in yolov8s_pose.yaml or some other files right?

This is only relevant if you are using the ModelZoo for inference. Since you are using the example mentioned, no need to worry about it.

So just so we can understand, after you changed the file you still see errors?

while compiling the model(retraining our custom model(has multi labels) with yolo8s-pose which by default has only one label ) what are the changes needs to be done to get the right model.
when i did this: hailomz parse --hw-arch hailo8l --ckpt ./best.onnx yolov8s_pose
hailomz optimize --hw-arch hailo8l --har ./yolov8s_pose.har yolov8s_pose
hailomz compile yolov8s_pose --hw-arch hailo8l --har ./yolov8s_pose.har
i only got a single class-“person”. i should at least get wrong labels printed that are mention in the coco-dataset if my compiled model is muliticlass

im not getting errors. im getting my model compiled but there is only one prediction class displayed while running inference.

@prasaanthg,
Now the issue is clearer, thank you for explaining.

And just to be sure, have you confirmed that the native model has the correct outputs?

yeah i have successfully run my pytorch model and got the right predictions. im very sure about it

You can try changing this line:

already tried that but still getting the issue

is it possible for you to send us your compiled model by dm? we’ll take a look