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: