SCRFD Model Support in DeGirum PySDK

We are excited to announce that support for SCRFD models has been added to the DeGirum PySDK. This includes the three variants of SCRFD models: 10G, 2.5G, and 500M. By developing a dedicated Python post-processor and integrating it into the model inference pipeline, we have made it seamless to run these models with the PySDK.

The code snippet below demonstrates how to run any of these models using DeGirum PySDK:

import degirum as dg, degirum_tools

# choose model name. Available models are: 
model_name = "scrfd_10g--640x640_quant_hailort_hailo8l_1"
# model_name = "scrfd_2.5g--640x640_quant_hailort_hailo8l_1"
# model_name = "scrfd_500m--640x640_quant_hailort_hailo8l_1"

# choose inference host address
inference_host_address = "@cloud" 
# inference_host_address = "@local"

# choose zoo_url
zoo_url = "degirum/models_hailort"
# zoo_url = "<path to local folder>"

# choose image source
image_source = "../assets/ThreePersons.jpg"

# set token
token = degirum_tools.get_token()
# token = '' # leave empty for local inference

# load AI model
model = dg.load_model(
    model_name=model_name,
    inference_host_address=inference_host_address,
    zoo_url=zoo_url,
    token=token
)

# perform AI model inference on given image source
print(f" Running inference using '{model_name}' on image source '{image_source}'")
inference_result = model(image_source)

# print('Inference Results \n', inference_result)  # numeric results
print(inference_result)
print("Press 'x' or 'q' to stop.")

# show results of inference
with degirum_tools.Display("AI Camera") as output_display:
    output_display.show_image(inference_result)

This simple code is all you need to run SCRFD models with the PySDK, making it effortless to perform real-time face detection and landmark localization.

For those interested in the inner workings, you can find the Python post-processor code that powers these models in our repository:

Works great with the exact same code as the yolov8 face detection! I also tested the retinaface model you posted in your hub, and it works with the same code as well, just changing the input resolution.

Awesome, keep them coming :slight_smile:

1 Like

As pointed out by @davidpichevin , we now have added support for retinaface model as well thereby unifying all face detection models with one single codebase. Currently working on simplifying face recognition pipeline. We will post a user guide soon.

The face recognition user guide is available at: A Comprehensive Guide to Building a Face Recognition System

1.Shall i run this code directly in my setup(Raspberry 5+Hailo8 AI Hat+ 26 TOPS)
The steps that i followed is
1.Installed the docker in another linux machine
2.Created the scrfd_10g.hef by parsing,optimze,compiling
3.I had scp the .hef into the raspberry pi

see i am in this setup now tell me what are the approach that i need to follow to infer the video

Hi @Dendukuri_Narendra_v
Along with model hef, you need the postprocessor file, model json, and label json files. You can either mimic the setup used by existing models or follow the guide here: User Guide 2: Running Your First Object Detection Model on a Hailo Device Using DeGirum PySDK