Yolov8-seg, trained with yolo segment..., converted to ONNX, then to HEF, no errors in the process

Yet the number of inputs is not as expected …
Any idea what I’m doing wrong?

Hi @stonito69

Welcome to the DeGirum community. Can you share the results of hailortcli parse-heffor the hef file? Also, the labels files and the config json. Finally, please try compiling using our cloud compiler and see if the problem persists.

Hi @shashi,

Below are the info you requested:

(degirum) toni@stonito:~/hef/cucumber_seg $ hailortcli parse-hef cucumbers_seg.hef
Architecture HEF was compiled for: HAILO8L
Network group name: cucumbers_seg, Multi Context - Number of contexts: 2
Network name: cucumbers_seg/cucumbers_seg
VStream infos:
Input cucumbers_seg/input_layer1 UINT8, NHWC(640x640x3)
Output cucumbers_seg/yolov8_nms_postprocess FLOAT32, HAILO NMS BY CLASS(number of classes: 1, maximum bounding boxes per class: 100, maximum frame size: 2004)
Operation:
Op YOLOV8
Name: YOLOV8-Post-Process
Score threshold: 0.200
IoU threshold: 0.70
Classes: 1
Max bboxes per class: 100
Image height: 640
Image width: 640

cucumber_seg.json
{
“ConfigVersion”: 10,
“Checksum”: “926bf34651d94e850361ad272b141a61af0097e64e46f3a7519e7dff84c8f323”,
“DEVICE”: [
{
“DeviceType”: “HAILO8”,
“RuntimeAgent”: “HAILORT”,
“SupportedDeviceTypes”: “HAILORT/HAILO8L”
}
],
“PRE_PROCESS”: [
{
“InputType”: “Image”,
“InputN”: 1,
“InputH”: 640,
“InputW”: 640,
“InputC”: 3,
“InputPadMethod”: “letterbox”,
“InputResizeMethod”: “bilinear”,
“InputQuantEn”: true
}
],
“MODEL_PARAMETERS”: [
{
“ModelPath”: “cucumbers_seg.hef”
}
],
“POST_PROCESS”: [
{
“OutputPostprocessType”: “SegmentationYoloV8”,
“LabelsPath”: “labels_coco.json”,
“OutputNumClasses”: 1,
“OutputConfThreshold”: 0.3,
“SigmoidOnCLS”: true
}
]
}


labels_json
{
    "0": "cucumber"
}

Original Yolo file works, above are the results from yolo segment predict on the best.ptmodel

Hi @stonito69

Thanks for sharing. It looks like the postprocessor is already included in the compiled model which is the first time we are seeing for a segmentation model. Can you try setting “OutputPostprocessType”: “DetectionYoloHailo”and see what happens?

Hi @shashi,

Thanks for your help.

That actually did it.
No errors whatsoever.

I tried it on some pictures, and I got the results.

But I expected to see mask in the results too, yet it seems there is none.

In the detection result, there is only:

bbox: [29.32929754257202, 59.67315673828125, 162.3439121246338, 955.6406021118164]
category_id: 0
label: cucumber
score: 0.8244609236717224

Hi @stonito69

Ok, this confirms the suspicion that when you compile a segmentation model with Hailo’s built-in postprocessor, it only returns detection results as they do not have postprocessor for segmentation. You can compile without postprocessor and use PySDK’s postprocessor. If you use our cloud compiler (we already gave you access), this will happen automatically.


All done.
And compilation was much faster than when I did it myself.
The results are not as good as with the original model, but it is expected.

Thanks for your help.

Hi @stonito69

You are welcome. Glad to see you were able to get things to work. Please feel free to reach out if you need any help.

Hi @stonito69, I’m glad Shashi was able to help you! Would you mind marking the answer that helped you the most in the thread (the icon with a checkmark) so others can easily reference the solution?