Modifying the default detection.sh from Tappas to support any object detection model compiled with Hailo NMS post-processing

If you have an object detection HEF file that was compiled with Hailo NMS post-processing layer then you can modify the default detection.sh from Tappas to support it.

Here are the steps:

  1. First verify that the Hailo NMS post-processing is indeed compiled into the HEF file by using the command hailortcli parse-hef . The output should contain the words HAILO NMS . Ex:

hailortcli parse-hef yolov8m.hef
Architecture HEF was compiled for: HAILO8
Network group name: yolov8m, Multi Context - Number of contexts: 3
Network name: yolov8m/yolov8m
VStream infos:
Input yolov8m/input_layer1 UINT8, NHWC(640x640x3)
Output yolov8m/yolov8_nms_postprocess FLOAT32, HAILO NMS(number of classes: 80, maximum bounding boxes per class: 100, maximum frame size: 160320)
Operation:
Op YOLOV8
Name: YOLOV8-Post-Process
Score threshold: 0.200
IoU threshold: 0.70
Classes: 80
Cross classes: false
Max bboxes per class: 100
Image height: 640
Image width: 640

  1. Modify detection.sh so that the parameter function-name passed to hailofilter is equal to “filter”:
    hailofilter function-name="filter" so-path=$postprocess_so config-path=$json_config_path qos=false ! \

  2. If you want to pass custom labels, you can set $json_config_path to point to a json file that has the following content:

{
“labels”: [
“unlabeled”,
“label of object 1”,
“label of object 2”,

]
}