Ok i resolved the issue on yolov5seg, now it works! There’s no guide about on how to change json file, in particular in the field outputs size and outputs name everything must go in order.
1) Run hailortcli parse-hef just to know how your net is
In my case:
hailortcli parse-hef /home/user/Desktop/custom_models/yolov5m_seg.hef
Architecture HEF was compiled for: HAILO8
Network group name: yolov5m_seg, Multi Context - Number of contexts: 3
Network name: yolov5m_seg/yolov5m_seg
VStream infos:
Input yolov5m_seg/input_layer1 UINT8, NHWC(640x640x3)
Output yolov5m_seg/conv65 UINT16, FCR(80x80x117)
Output yolov5m_seg/conv85 UINT8, FCR(160x160x32)
Output yolov5m_seg/conv75 UINT16, FCR(40x40x117)
Output yolov5m_seg/conv83 UINT16, FCR(20x20x117)
2) Use the parse output to change the config.json!
In my case:
"outputs_size": [
80,
40,
20
],
"outputs_name": [
"yolov5m_seg/conv85",
"yolov5m_seg/conv65",
"yolov5m_seg/conv75",
"yolov5m_seg/conv83"
],
NOTE THAT A PRECISE ORDER MUST BE FOLLOW UNLESS SEGMENTATION FAULT HAPPENS!
Rules for the config.json for yolov5_seg (maybe works also with other segmentations custom models)
First line: the uint8 output conv85 in my case,
Second line and others lines: the uint16 output in order from the lesser (ending number) to the higher conv65, conv 75, conv83
outputs_size field MUST MATCH the uint8 output order given from hailortcli parse-hef in my case
Output yolov5m_seg/conv65 UINT16, FCR(**80**x80x117)
Output yolov5m_seg/conv85 UINT8, FCR(160x160x32)
Output yolov5m_seg/conv75 UINT16, FCR(**40**x40x117)
Output yolov5m_seg/conv83 UINT16, FCR(**20**x20x117)
FCR(80x80x117) FCR(40x40x117) (20x20x117) in my case 80, 40, 20
The config file modified in my case is QUITE different from hailo yolov5_seg from the examples!
Maybe this happen because i could have trained my custom model with a different version of the net.
If theese rules are not followed, a segmentation fault occour.
The process maybe could works also with yolov8_seg, but i didn’t tested because @shashi did a good wrapper to make it work DeGyrum.
If anyone could test other custom model trained with yolov and let us know below, would be great!