Custom YOLOv8s model on Hailo8L: checksum generation and extra class detection

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.json file.

  • I am running local inference using @local on 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

  1. Checksum in model.json
    I noticed that if I remove the Checksum field, I get an error indicating that the model_zoo cannot 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 Checksum supposed to be generated correctly for a custom model?
  2. 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 DetectionYoloHailo post-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!

Hi @pfma98

Welcome to the DeGirum community.

Regarding checksum: while it is a required field, you can set it to any non-empty value when using in a local zoo. Only when you use our cloud model zoo, a valid checksum is needed to ensure that the local copy is the latest one. For models compiled by you and maintained locally, just set it to any non-empty value. Hope this helps.

Regarding the non-existent class 4: do you see valid bounding boxes? We cannot give you a definitive answer without looking at your compile settings, but one thing you can try is add “OutputNumClasses”: 3, line to POSTPROCESS section in the model json. You can also try to compile using our cloud compiler to make sure things are set properly: Early access: DeGirum Cloud Compiler is live!

2 Likes