ONNX Model Zoo

meinvirgos/face_detection_yunet_dynamic

By meinvirgos · ↓ 0 · ♥ 0 · Updated 2025-07-27

What's in this repo

This page lists the files in meinvirgos/face_detection_yunet_dynamic, including face_detection_yunet_2023mar_dynamic.onnx.

  • 1 ONNX models (.onnx files)
  • 3 files, including 1 .md, 1 .onnx
  • Last updated 2025-07-27

ONNX files

File Size Download
face_detection_yunet_2023mar_dynamic.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

I made the dynamic the model:

face_detection_yunet_2023mar.onnx https://github.com/opencv/opencv_zoo/blob/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx

The way y Made it dynamic:

# Initialization
!pip install onnx==1.16 | tail -n 1
!pip install onnxruntime==1.16.3 | tail -n 1

import onnx
import onnxruntime as ort
from onnx.tools import update_model_dims

# We read the model
onnx_model_path = "face_detection_yunet_2023mar.onnx"
model = onnx.load(onnx_model_path)
## Vemos los dims
input_dims = {i.name:  [d.dim_value for d in i.type.tensor_type.shape.dim] for i in model.graph.input}
output_dims = {o.name:  [d.dim_value for d in o.type.tensor_type.shape.dim] for o in model.graph.output}
print(input_dims)
print(output_dims)

# Debug: we create a session (not needed)
ort.set_default_logger_severity(3)
ort_session = ort.InferenceSession(onnx_model_path, providers=['CPUExecutionProvider'])
print("Original Input Shapes:")
for i in ort_session.get_inputs():
    print(f"Input Name: {i.name}, Shape: {i.shape}")

# Here we made the model dynamic. The character "N" means the input is dynamic
input_dims['input'] = [1, 3, "N", "N"]
updated_model = update_model_dims.update_inputs_outputs_dims(model, input_dims, output_dims)

# Finally we save the dynamic model
import os
os.mkdir("./save_dir")
dynamic_model_path = "./save_dir/face_detection_yunet_2023mar_dynamic.onnx"
onnx.save(updated_model, dynamic_model_path)

Model info

onnx license:apache-2.0 region:us
↓ 0 ♥ 0

Created: 2025-07-27

Updated: 2025-07-27

View on Hugging Face

Files (3)

.gitattributes
README.md
face_detection_yunet_2023mar_dynamic.onnx ONNX

Related models