Hello everyone,
I am working with DeGirum + Hailo8L on a Raspberry Pi 5, and I have a couple of questions related to converting and running a custom-trained YOLOv8 small model.
context
-
I trained my own YOLOv8s (.pt) model with only 3 classes.
-
I converted the model to .hef targeting Hailo8L.
-
I manually defined the labels in a
labels.jsonfile. -
I am running local inference using
@localon the RPi5.
This is my model.json:
{
“ConfigVersion”: 1,
“Checksum”: “da96ad3b3730500d56c8e13d164d44a78eb6f062516717d4c4195f7995a8c391”,
“DEVICE”: [
{
“DeviceType”: “HAILO8L”,
“RuntimeAgent”: “HAILORT”,
“SupportedDeviceTypes”: “HAILORT/HAILO8L, HAILORT/HAILO8”
}
],
“PRE_PROCESS”: [
{
“InputN”: 1,
“InputH”: 640,
“InputW”: 640,
“InputC”: 3,
“InputQuantEn”: true
}
],
“MODEL_PARAMETERS”: [
{
“ModelPath”: “yolov8s-c.hef”
}
],
“POST_PROCESS”: [
{
“OutputPostprocessType”: “DetectionYoloHailo”,
“LabelsPath”: “labels.json”
}
]
}
And this is the inference script I am using:
import degirum as dg, degirum_tools
import cv2
your_model_name = “model”
your_host_address = “@local”
your_model_zoo = ‘/’
your_token = ‘’
model = dg.load_model(
model_name=your_model_name,
inference_host_address=your_host_address,
zoo_url=your_model_zoo,
token=your_token,
)
video_source = “test.mp4”
with degirum_tools.Display(“AI Camera”) as output_display:
for inference_result in degirum_tools.predict_stream(model, video_source):
output_display.show(inference_result)
Questions
-
Checksum in
model.json
I noticed that if I remove theChecksumfield, I get an error indicating that themodel_zoocannot be found.
Currently, I copied the checksum value from other examples in DeGirum’s GitHub repository, but I would like to understand:- How is the
Checksumsupposed to be generated correctly for a custom model?
- How is the
-
Detection of non-existent classes
Even though my model was trained with only 3 classes, during inference it detects additional objects labeled as class “4”.-
Could this be related to an incorrect configuration of the
DetectionYoloHailopost-processing? -
Is it possible that the model is still internally using the original YOLOv8 (COCO) number of classes?
-
Is there any additional parameter that needs to be set to force the model to use only my 3 classes?
-
Any guidance or pointers to relevant documentation would be greatly appreciated.
Thank you in advance!