NMS score threshold is set, but there is no NMS output in this model

So I managed to create .hef file of yolov4 model
I trained the model with docker from hailo_zoo
and got the onnx file also by this tutorial
but when I use the model in basic pipeline script detection.py
I am getting this error :
NMS score threshold is set, but there is no NMS output in this model.
I confirmed with this command that my model don’t have any NMS.
from this previous post :

I understood that “detection.py example works only for models that are compiled with Hailo-NMS”(Omer)
And I should have postprocess_config json file
So I have 2 questions :
First : if I am using yolov4 what json file I can get from here : https://github.com/hailo-ai/hailo_model_zoo/tree/master/hailo_model_zoo/cfg/postprocess_config
If I cant get any can I make my own ? if so how can I do it netron.app ?

Second question :
if I got the postprocess config json file where can I use it as input ? in which part of the creation of .hef file ? Parsing ? Compilation ? Inference ?
Thanks

Hey @Andrey,

You have to create one on your own. The structure of this file includes parameters such as:

  • anchors
  • input_shape
  • num_classes
  • nms_score_thres, nms_iou_thres

You can check this example: hailo_model_zoo/hailo_model_zoo/cfg/postprocess_config/yolov5l_nms_config.json at v2.14 · hailo-ai/hailo_model_zoo · GitHub

This file is used when parsing and compiling the model (this tells the compiler to run the post process inside of the hailo chip or not).

What to look for in netron :

  1. Final Output Layer

    • Check the last layer(s) of your model
    • Note output shape format: [batch, num_anchors × grid_h × grid_w, num_classes + 5]
  2. Number of Classes

    • Calculate from output shape: num_classes = last_dimension - 5
  3. Input Shape

    • Find in the first layer (typically named input_1 or images)
    • Common formats: [1, 3, 416, 416] or [1, 416, 416, 3]
    • Use as input_shape: [height, width] in your JSON

Hi Omri thanks for the quick answer
You mentioned that after creating this file
I need to use it in the Parsing process yet this file not mentioned in the parsing tutorial : https://hailo.ai/developer-zone/documentation/dataflow-compiler-v3-30-0/?sp_referrer=tutorials_notebooks/notebooks/DFC_1_Parsing_Tutorial.html

And also not mentioned in the compilation tutorial :

Hailo

v3.30.0 | Hailo

NMS or the json file needed not mentioned in both of them so where exactly do I use this file ?

And another question :
How can I know for sure that I choose the right end nodes in YoloV4 ?
Might be something like this? :

@omria Hi Omri can you provide some info on where can I find the data on NMS layer ?

Hey @Andrey ,

Please check out the hailo model zoo documentation and for example check out the model zoo examples .