You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project using a Yolov8l model on a Raspberry Pi5 with the Hailo 8 coprocessor. I successfully trained and tested the model on my PC, and I can retrieve the detected object ID using the following code:
model = YOLO("yolo8l.pt")
model.predict(frame)
track_ids = results[0].boxes.id.int().cpu().tolist()
I then converted the model to the .hef format following the instructions provided in hailo-rpi5-examples. While I can successfully perform inference on the converted model, I'm unable to retrieve the object ID. I can access the detected object label, but there seems to be no clear way to get the ID.
I tried:
roi = hailo.get_roi_from_buffer(buffer)
hailo_detections = roi.get_objects_typed(hailo.HAILO_DETECTION)
n = len(hailo_detections)
boxes = np.zeros((n, 4))
confidence = np.zeros(n)
class_id = np.zeros(n)
tracker_id = np.empty(n)
for i, detection in enumerate(hailo_detections):
if 1 :#detection.get_label() == "person": # Only track "person" objects
class_id[i] = detection.get_class_id()
confidence[i] = detection.get_confidence()
unique_ids = detection.get_objects_typed(hailo.HAILO_UNIQUE_ID)
tracker_id[i] = unique_ids[0].get_id() if unique_ids else -1 # Use -1 if no unique ID is found
but the unique_ids returns empty list always
I've searched for solutions online but haven't found anything definitive. Can anyone provide some guidance on how to access the object ID after conversion to the .hef model?
Expected Behavior:
I expect the code to return a list containing the IDs of the detected objects, similar to the output on my PC.
Any help would be greatly appreciated!
Hardware: RPI5 + Hailo8
Model: Yolov8l
The text was updated successfully, but these errors were encountered:
MECHAAMER
changed the title
Unable to retrieve object ID for Hailo RPI5
Unable to retrieve detected object ID - Hailo8 + RPI5
Dec 24, 2024
Hello everyone,
I'm working on a project using a Yolov8l model on a Raspberry Pi5 with the Hailo 8 coprocessor. I successfully trained and tested the model on my PC, and I can retrieve the detected object ID using the following code:
I then converted the model to the .hef format following the instructions provided in hailo-rpi5-examples. While I can successfully perform inference on the converted model, I'm unable to retrieve the object ID. I can access the detected object label, but there seems to be no clear way to get the ID.
I tried:
but the unique_ids returns empty list always
I've searched for solutions online but haven't found anything definitive. Can anyone provide some guidance on how to access the object ID after conversion to the .hef model?
Expected Behavior:
I expect the code to return a list containing the IDs of the detected objects, similar to the output on my PC.
Any help would be greatly appreciated!
Hardware: RPI5 + Hailo8
Model: Yolov8l
The text was updated successfully, but these errors were encountered: