Hello @omria and thanks for the answer. Since some of us have problems with segmentation custom models, i’ll go more deeper on what i need to let who have the same problem understand what to do.
config file
I took from hailo-apps-infra/resources/yolov5n_seg.json and this is the content
{
"iou_threshold": 0.6,
"score_threshold": 0.25,
"outputs_size": [
20,
40,
80
],
"outputs_name": [
"yolov5n_seg/conv63",
"yolov5n_seg/conv48",
"yolov5n_seg/conv55",
"yolov5n_seg/conv61"
],
"anchors": [
[
116,
90,
156,
198,
373,
326
],
[
30,
61,
62,
45,
59,
119
],
[
10,
13,
16,
30,
33,
23
]
],
"input_shape": [
640,
640
],
"strides": [
32,
16,
8
]
}
Is this the correct file?
I would like to understand how to modify this file correctly basing on my model requirements to generalize it for other models.
as you can see in another thread of mine segmentation error yolov5_seg where i tried to train a yolov5_seg model to avoid to modify json, generate postprocess.so and avoid to modify instance_segmentation_pipeline.py, but i still have issues.
post-processing
I searched in the hailo-apps-infra/cpp/yolov5seg.cpp and yolov5seg.hpp, but i cannot tell what’s the part i should modify to makeit work, would be great if you could explain how to make it work for other models (like for example the yolov5-seg, as seems it works only with hailo yolov5_seg example model but not with the customs).
model infos
I run hailo profiler yolov8s_seg.hef but turn out the command need the har file, so i run hailo profiler yolov8s_seg.har and i got:
[info] Current Time: 15:36:02, 03/18/25
[info] CPU: Architecture: x86_64, Model: AMD Ryzen 9 7845HX with Radeon Graphics, Number Of Cores: 24, Utilization: 0.6%
[info] Memory: Total: 15GB, Available: 12GB
[info] System info: OS: Linux, Kernel: 5.15.167.4-microsoft-standard-WSL2
[info] Hailo DFC Version: 3.30.0
[info] HailoRT Version: 4.20.0
[info] PCIe: No Hailo PCIe device was found
[info] Running `hailo profiler yolov8s_seg.har`
[info] Running profile for yolov8s_seg in state compiled_model
[info]
Model Details
-------------------------------- -----------
Input Tensors Shapes 640x640x3
Operations per Input Tensor 39.92 GOPs
Operations per Input Tensor 20.00 GMACs
Pure Operations per Input Tensor 42.44 GOPs
Pure Operations per Input Tensor 21.25 GMACs
Model Parameters 13.24 M
-------------------------------- -----------
Profiler Input Settings
----------------- -----------------
Optimization Goal Reach Highest FPS
Profiler Mode Compiled
----------------- -----------------
Performance Summary
---------------------- ---
Number of Devices 1
Number of Contexts 2
Throughput N/A
Latency N/A
Operations per Second N/A
MACs per Second N/A
Total Input Bandwidth N/A
Total Output Bandwidth N/A
Context Switch Configs N/A
---------------------- ---
[info] Saved Profiler HTML Report to: /local/yolov8s_seg_compiled_model.html
then hailortcli run yolov8s_seg.hef --frames-count 1 --measure-latency
Running streaming inference (yolov8s_seg.hef):
Transform data: true
Type: auto
Quantized: true
Network yolov8s_seg/yolov8s_seg: 100% | 272 | FPS: 54.32 | ETA: 00:00:00
> Inference result:
Network group: yolov8s_seg
Frames count: 272
FPS: 54.33
Send Rate: 534.05 Mbit/s
Recv Rate: 713.80 Mbit/s
and finally hailortcli parse-hef yolov8s_seg.hef
Architecture HEF was compiled for: HAILO8
Network group name: yolov8s_seg, Multi Context - Number of contexts: 2
Network name: yolov8s_seg/yolov8s_seg
VStream infos:
Input yolov8s_seg/input_layer1 UINT8, NHWC(640x640x3)
Output yolov8s_seg/conv73 UINT8, FCR(20x20x64)
Output yolov8s_seg/conv74 UINT8, NHWC(20x20x2)
Output yolov8s_seg/conv75 UINT8, NHWC(20x20x32)
Output yolov8s_seg/conv60 UINT8, FCR(40x40x64)
Output yolov8s_seg/conv61 UINT8, NHWC(40x40x2)
Output yolov8s_seg/conv62 UINT8, FCR(40x40x32)
Output yolov8s_seg/conv44 UINT8, FCR(80x80x64)
Output yolov8s_seg/conv45 UINT8, NHWC(80x80x2)
Output yolov8s_seg/conv46 UINT8, FCR(80x80x32)
Output yolov8s_seg/conv48 UINT8, FCR(160x160x32)
Postprocess
It’s only needed to change the postprocess file or should i compile new one?
That’s all.. could you help me to understand also how to modify everything to use it with my custom models (also other model than yolov which i could be interested in) ?
Thanks A LOT!