YOLOv8n-Pose custom resolution model not converting properly to .hef

I have recently been trying to convert a custom resolution YOLOv8n-Pose model to .hef. The input resolution of this model is 320x320, and the ONNX works perfectly without any issues.

On converting to hef, the output of the model is out of range, e.g confidence scores as -5.43 (Going Negative). Other values like bounding boxes are out of range as well.

Hence, we draw nothing on the image, and results are not usable.

I have tried modifying the config files, and trying different levels of optimization, but none of it works. Used standard CLI commands like hailomz parse, optimize and compile commands.

I am attaching the ONNX in this thread for reference.

Link: [https://drive.google.com/file/d/15ETx_KalygUpM9Xk9k_woEPFwaXHN7H_/view?usp=sharing](ONNX File for YOLOv8n-Pose-320x320)

Let me know, what might be going wrong

1 Like

Hey @jsingh
Thanks for sharing the details and the ONNX file. From what you’ve described, it sounds like the issue might be related to how the output layers are being parsed when using hailomz or the hailo CLI. If the end nodes aren’t set properly during parsing, it can lead to weird output like negative confidence scores or garbage values for bounding boxes.

One thing you might want to try (if you haven’t already) is explicitly setting the output layers using the --end-node-names flag during the parse step. These should align with the original YOLOv8s-Pose model output layers that Hailo uses in their model zoo.

hailomz parse yolov8n_pose_320x320.onnx \
    --end-node-names conv70 conv71 conv72 \
                     conv57 conv58 conv59 \
                     conv43 conv44 conv45

This should help make sure the output format is correct and prevent the invalid values. The idea is to match the output structure like this:

Output conv70 UINT8, FCR(20x20x64)
Output conv71 UINT8, NHWC(20x20x1)
Output conv72 UINT16, FCR(20x20x51)
Output conv57 UINT8, FCR(40x40x64)
Output conv58 UINT8, NHWC(40x40x1)
Output conv59 UINT16, FCR(40x40x51)
Output conv43 UINT8, FCR(80x80x64)
Output conv44 UINT8, NHWC(80x80x1)
Output conv45 UINT16, FCR(80x80x51)

You can check your ONNX model with Netron to confirm the exact layer names if they’re slightly different.

Hope this helps! Let me know if that fixes it or if you’re still running into issues.

Hey,

You can try one of these 2 alternatives.

Option 1 - Using the DFC
You can try the following:

hailo parser onnx --hw-arch <hailo-board> --net-name <name-output-har-file> <name-onnx-file.onnx> --end-node-names "/model.22/cv2.1/cv2.1.2/Conv" "/model.22/cv3.1/cv3.1.2/Conv" "/model.22/cv2.0/cv2.0.2/Conv" "/model.22/cv3.0/cv3.0.2/Conv" "/model.22/cv2.2/cv2.2.2/Conv" "/model.22/cv3.2/cv3.2.2/Conv" "/model.22/cv4.0/cv4.0.2/Conv" "/model.22/cv4.1/cv4.1.2/Conv" "/model.22/cv4.2/cv4.2.2/Conv"

After that you need to create your .alls files that include the “end node names” specified above. You can refer to the Hailo Model Zoo for some examples of .alls files.

Finally, follow the last 2 steps mentioned here:

Option 2 - Using Hailo Model Zoo
You can check this link and try using the hailomz. You can try the Yolov8s-pose as reference as it was suggested above.