DAMOYOLO inference and postprocessing example

Hello,

I am currently working with the following code (that uses yolov7): Hailo-Application-Code-Examples/runtime/python/object_detection at main · hailo-ai/Hailo-Application-Code-Examples · GitHub

I would like to use damoyolo_tinynasL35_M instead (also available in the model zoo). However I am struggling with the postprocessing.

Could anyone provide me the postprocessing code to extract boxes, classes and scores from the model (hef) outputs?

I tried to look at the nanodet (split) postprocessing functions in the model zoo but I was not able to make it work.

(Any inference example for damoyolo would suit me as well).

Regards,

Hi @ade
We have integrated postprocessor for damoyolo to our PySDK. It is available in our public model zoo. For PySDK reference, please see: Simplifying Edge AI Development with DeGirum PySDK and Hailo. The code is available at: DamoYOLO Postprocessor. Please let me know if you need any further help in getting this to run.

Hi @shashi,

Thank you for your answer.

I tried to install DeGirum but it doesn’t seem to be compatible with my current HailoRT version (4.20.0). I have read on your documentation that you require 4.19.0. The command degirum sys-info doesn’t find my hailo8 device (which is found by hailo scan command).

Is it possible to use your DamoYOLO postprocessor directly on top of the HailoRT outputs tensors (without using DeGirum full SDK)? If so how can I transform Hailo yaml config into DeGirum json config?

Regards,

@ade
We will release a new PySDK compatible with 4.20.0 soon. I will keep you posted.

@shashi

That is a great news. In the meantime, could you explain to me where can I find the dequantization infos (scale and zero_point) ?
Maybe you have an example of details_list for the damoyolo. I am working with the default hef and yaml files from the hailo model zoo (and an hailo8 device).

Regards,

@ade
You can use this code snippet to find the zero point and scales for the output tensors:

from hailo_platform import HEF

hef = HEF("your_hef_path")
output_vstream_info = hef.get_output_vstream_infos()

print("Outputs")
for output_info in output_vstream_info:
  print(output_info)
  print("Scale: {}".format(output_info.quant_info.qp_scale))
  print("Zero point: {}\n".format(output_info.quant_info.qp_zp))

@shashi
Thank you very much for your help. This was the source of my problem (I was using the wrong values for scale an zero point).
Regards,

@ade
Glad to hear you got it to work.