I recently purchased a raspberry pi 5 and ai hat (with Hailo8l) so I could port an application (originally written on a Jetson Nano) to this more powerful platform for evaluation. I followed the setup instructions from Raspberry Pi (Here) and the sample applications run and work very well.
My next step was going to be to write a standalone python test app that uses hailoRT and yolov8s-pose.hef to do pose estimation/detection, but I’m having trouble even getting started. I’ve found several examples of how to load a hef file in python, but none of them work for me.
For example, if I try the following:
from hailo_platform import Device, Hef, VStreamsManager
import numpy as np
# Load the HEF file
hef_path = "yolov8s-pose.hef"
hef = Hef(hef_path)
then I get the error
Traceback (most recent call last):
File "/home/uatu/src/test/posetest/posetest.py", line 1, in <module>
from hailo_platform import Device, Hef, VStreamsManager
ImportError: cannot import name 'Hef' from 'hailo_platform' (/home/uatu/.local/lib/python3.11/site-packages/hailo_platform/__init__.py)
Can you please point me towards the proper way to load the pose estimation model in a python program? I plan on passing it input data from an opencv data source that is part of my application code, so all I want to be able to do is load the model and then, in a loop, take frames from the opencv source and run an inference on them, getting the results to pass to another part of the code for use.
Thanks @shashi, I’ll take a look at that, but I’d be interested in learning to do it without using a 3rd party API if possible. Is that not something that’s easily achievable?
Check out these examples - they should get you started with the Hailo API:
Object Detection:
Utils (How to run ASYNC infernce on hailo8):
Pose Estimation:
These examples cover the basics of working with the Hailo API and should give you a good foundation. If you run into any specific issues or need help with a particular use case, just let me know!