hailo8 retinaface mobilenet model postprocessing

Hi everyone,

I’m currently working on a face detection project using the RetinaFace MobileNetV1 model from the Hailo Model Zoo. I’m running it on a Raspberry Pi 5 with a Hailo-8 accelerator, using the HailoRT Python API.

I’ve managed to successfully run the model on the Hailo-8, but I’m stuck on how to process the results. I know there’s some post-processing code for face detection in the Model Zoo (specifically in hailo_model_zoo/core/postprocessing/face_detection_postprocessing.py), but I can’t get it to work on the Raspberry Pi.

The problem is that the Hailo Model Zoo can’t be installed on the Pi, since the Dataflow Compiler is not available for Raspberry, and it’s a required dependency. Because of that, I don’t have access to the post-processing tools or utilities that are usually available when running the Model Zoo on a PC.

I also couldn’t find any examples or documentation on how to use the RetinaFace post-processing code in Python or how to implement it manually.

From what I understand, the model uses three grid sizes to detect faces. Each grid size has layers for confidence scores, bounding boxes, and facial landmarks. But I’m having trouble understanding the format of these outputs. For example:

What anchor sizes or aspect ratios are used for the bounding box calculations?

How do I decode the bounding box predictions?

What exactly do the confidence layers represent?

Right now I’m just guessing based on what I see in the outputs, but I don’t have a clear understanding, and nothing I’ve tried has worked so far.

I also would like to avoid gstreamer.

I’d really appreciate any guidance on where to find some more information and how to tackle post-processing.

Thanks in advance.

Hi @Dawid_Jakubczuk
We developed PySDK, a python package to simplify development with Hailo devices. You can see this post for support of retinaface: SCRFD Model Support in DeGirum PySDK

Hi @shashi,
Thanks a lot for the link! I’ve been banging my head against the wall for a while now. Your postprocessing code helped me finally extract all the data from the model. For now, I’m moving on to face recognition. I looked through your repo for any face recognition examples but couldn’t find any. Do you happen to have some postprocessing code for that as well?

Hi @Dawid_Jakubczuk
Happy to hear that the code is working for you. For face recognition, please see our detailed user guide: A Comprehensive Guide to Building a Face Recognition System