/ Модель

Характеристики

Лицензия
MIT
Опубликована
1 окт 2026

scrfd-500m-imx

Поиск объектовИзображение → bounding_boxes3 профессии

Компактная квантованная модель NXP для обнаружения лиц и пяти лицевых ориентиров на устройствах i.MX.

228скачиваний за 30 дней0лайковвеса обновлены10 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

SCRFD-500M-KPS — компактная модель обнаружения лиц, разработанная на основе SCRFD от InsightFace и переобученная и адаптированная компанией NXP для устройств i.MX. Она принимает RGB-изображение и возвращает рамки лиц, оценки уверенности и пять ориентиров на каждом лице: глаза, кончик носа и уголки рта. Веса представлены в вариантах int8 с входом и выходами uint8; размер сети — около 0,57 млн параметров. Для MPU доступны разрешения 128×128, 256×256, 256×320 и 512×640, для MCU — 128×128, 256×256 и 320×256.

Модель предназначена для обнаружения нескольких лиц и локализации ориентиров на периферийных устройствах NXP: i.MX 8M Plus, i.MX 93, i.MX 95, i.MX 952, i.MX RT1170 и i.MX RT700. Поставляются варианты LiteRT/TFLite и TensorFlow Lite Micro; отдельные файлы скомпилированы для соответствующих NPU и требуют совместимых runtime, делегатов и версий SDK. Декодирование рамок и ориентиров, а также подавление немаксимумов выполняются вне модели.

Низкое разрешение уменьшает вычислительную нагрузку, но затрудняет обнаружение небольших и удалённых лиц; квантование может влиять на точность. Качество также зависит от условий съёмки и представления примеров в обучающем наборе WIDER FACE. Модель не распознаёт личности и не определяет возраст, пол или эмоции. Репозиторий и переобученные NXP веса выпущены под лицензией MIT.

Сценарии применения

  • обнаружение нескольких лиц на изображениях с камеры
  • определение положения глаз, носа и уголков рта
  • обработка видеокадров на периферийных устройствах NXP
  • подсчёт и локализация лиц на изображениях

Ограничения

Квантование может снизить точность, а малые входные разрешения ухудшают обнаружение небольших и удалённых лиц; качество зависит от условий и представления данных в WIDER FACE. Модель обнаруживает лица и ориентиры, но не распознаёт людей и не определяет их атрибуты.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

SCRFD 500M KPS

Overview

SCRFD (Sample and Computation Redistribution for Efficient Face Detection) is an efficient, high-accuracy face detector originally described in the paper and accepted at ICLR 2022. Given an RGB image, the network detects faces and, for each face, returns a bounding box, a confidence score and five facial landmarks: left eye, right eye, nose tip, left mouth corner, and right mouth corner.

This repository contains the SCRFD-500M-KPS variant, retrained by NXP, quantized to int8 and compiled for NXP platforms:

  • i.MX MPUs (i.MX 8M Plus, i.MX 93, i.MX 95, i.MX 952) as LiteRT (.tflite) models, at four input resolutions: 128x128, 256x256, 256x320 and 512x640.
  • i.MX RT MCUs (i.MX RT1170, i.MX RT700) as TensorFlow Lite Micro C byte-array headers, at three input resolutions: 128x128, 256x256 and 320x256.

It also contains the scripts used to regenerate these assets (recipe.sh), an inference example (example.py) and an evaluation script (evaluate.py).

Note: This model performs face detection with 5-point facial landmark localization. It does not perform face recognition/identification.

Key Features

  • Lightweight face detector (0.57M parameters) suitable for edge devices.
  • Detects multiple faces per image and returns 5 facial landmarks per face.
  • Fully quantized int8 model with uint8 input (values 0-255) and uint8 (quantized) outputs.
  • Provided at four input resolutions for MPUs (128x128, 256x256, 256x320, 512x640); the conversion scripts accept any HEIGHT and WIDTH supported by the network.
  • Compiled for the i.MX 93 Ethos-U65 NPU (Vela) and converted for the i.MX 95 / i.MX 952 eIQ Neutron NPU.
  • Also available for MCUs under TensorFlow Lite Micro (i.MX RT1170 CPU and i.MX RT700 Neutron-64 NPU), shipped as C byte-array headers at 128x128, 256x256 and 320x256.

Model Description

This is a retrained, quantized and compiled version of the SCRFD-500M-KPS face detector from InsightFace, optimized for NXP i.MX MPUs and i.MX RT MCUs.

  • Base Model: SCRFD-500M-KPS (InsightFace)
  • Original Model Authors: Jia Guo, Jiankang Deng, Alexandros Lattas, Stefanos Zafeiriou (InsightFace)
  • Original License: MIT (InsightFace source code)
  • Modified by: NXP

Modifications

This model is a derivative work with the following changes from the original:

  • Retraining: NXP retrained SCRFD-500M-KPS on WIDER FACE. The retrained weights (scrfd_500m_kps_retrained_epoch_640.pth) are owned by NXP and released under the MIT license.
  • Format conversion: PyTorch -> ONNX (InsightFace scrfd2onnx.py) -> TensorFlow saved model -> TFLite (OpenVINO Model Optimizer and openvino2tensorflow).
  • Quantization (MPU models): full int8 post-training quantization, uint8 input / uint8 outputs, input normalization data / 255, calibrated on ~100 images from the commercially-usable ImageNetV2 subset per resolution.
  • Compilation (i.MX 93): compiled with Vela (--accelerator-config ethos-u65-512 --optimise Performance), tags lf-6.18.20_2.0.0 and lf-6.18.37_2.1.0.
  • Compilation (i.MX 95 / i.MX 952): converted with the eIQ Neutron SDK versions 3.1.3, 3.2.1 and 3.2.3.
  • MCU models: a different int8 quantization of the same network (also uint8 input / uint8 outputs), taken as-is from eIQ Media Processing Pipeline (MPP), compiled for i.MX RT700 with the eIQ Neutron SDK 3.2.2 and 3.2.3, and exported as C byte-array headers.
  • Post-processing: bounding box and landmark decoding plus non-maximum suppression are performed outside the model (see utils/scrfd.py).

Original model available at: https://github.com/deepinsight/insightface/tree/master/detection/scrfd.

Model Information

InformationValue
Input shapeRGB image (1, H, W, 3), uint8 - shipped at 128x128, 256x256, 256x320, 512x640 (MPU)
Input example (Image generated on thispersondoesnotexist.com)
Output shape9 tensors (per-stride scores, bbox distances, and keypoint distances for strides 8, 16 and 32), uint8 quantized; dequantize with each tensor's scale / zero point. See example.py to decode them.
Output example (blue = bounding box, red = landmarks)
VersionSCRFD_500M_KPS (retrained by NXP)
FLOPS~0.5 GFLOPs at VGA (640x480) input, as defined by the original authors; scales with input resolution
Number of parameters0.57M
File size (int8)794 KB (assets/quantized_tflite_model/*.tflite)
Source frameworkPyTorch

Supported Hardware and Software Configurations

All MPU models run with the eIQ LiteRT (TensorFlow Lite) runtime and the corresponding NPU delegate (VX for i.MX 8M Plus, Ethos-U for i.MX 93, Neutron for i.MX 95 / i.MX 952). The MCU headers run with TensorFlow Lite Micro through eIQ Media Processing Pipeline (MPP). Each link points to a directory containing one asset per listed resolution. The same information is captured in release_manifest.json.

AssetRuntimePrecisionHW targetBSP & SDK versionsResolutionsLink to asset
i.MX 8M Plus QuantizedLiteRTINT8i.MX 8M Plus-128x128, 256x256, 256x320, 512x640Download
i.MX 93 PrecompiledLiteRTINT8i.MX 93BSP lf-6.18.20_2.0.0, VELA_TAG = lf-6.18.20_2.0.0128x128, 256x256, 256x320, 512x640Download
i.MX 93 PrecompiledLiteRTINT8i.MX 93BSP lf-6.18.37_2.1.0, VELA_TAG = lf-6.18.37_2.1.0128x128, 256x256, 256x320, 512x640Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3128x128, 256x256, 256x320, 512x640Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1128x128, 256x256, 256x320, 512x640Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3128x128, 256x256, 256x320, 512x640Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3128x128, 256x256, 256x320, 512x640Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1128x128, 256x256, 256x320, 512x640Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3128x128, 256x256, 256x320, 512x640Download
i.MX RT1170 C headerTensorFlow Lite MicroINT8i.MX RT1170MCUXpresso SDK 26.09.00128x128, 256x256, 320x256Download
i.MX RT700 C headerTensorFlow Lite MicroINT8i.MX RT700MCUXpresso SDK 26.09.00, Neutron SDK v3.2.2128x128, 256x256, 320x256Download
i.MX RT700 C headerTensorFlow Lite MicroINT8i.MX RT700MCUXpresso SDK 26.09.00, Neutron SDK v3.2.3128x128, 256x256, 320x256Download

The hardware-independent int8 models are also provided for host (x86) inference and as inputs to the compilers: assets/quantized_tflite_model/ (MPU quantization) and assets/quantized_tflite_model_mcu/ (MCU quantization).

Limitations and Biases

This model inherits all limitations from the original SCRFD-500M-KPS model. Additional limitations:

  • Task scope: Face detection and 5-point landmark localization only. The model does not identify or recognize individuals and does not estimate attributes such as age, gender or emotion.
  • Hardware-specific: The Vela-compiled models only run on the i.MX 93 Ethos-U65 NPU and the Neutron-converted models only run on the i.MX 95 / i.MX 952 / i.MX RT700 Neutron NPU with the matching BSP / SDK versions listed above. Use the assets in assets/quantized_tflite_model/ for other targets.
  • Quantization effects: int8 quantization may introduce accuracy differences relative to the FP32 baseline. The MPU and MCU models use different quantizations and may produce slightly different results.
  • Input resolution: Lower input resolutions (e.g. 128x128) reduce compute but also reduce the ability to detect small or distant faces.
  • Dataset bias: The model is trained on WIDER FACE. Detection quality may vary for faces, poses, lighting conditions, occlusions or demographic groups that are under-represented in that dataset.

Training

The original SCRFD model was trained by its authors on the WIDER FACE training set. NXP retrained the SCRFD-500M-KPS variant on WIDER FACE using the InsightFace training code; the resulting weights (scrfd_500m_kps_retrained_epoch_640.pth) are provided in this repository under the MIT license.

Evaluation

evaluate.py compares the int8 quantized model against its FP32 reference (the float32 TFLite model exported at the same resolution by tflite/convert2tflite.sh) on the full WIDER FACE validation set (3226 images). The evaluation runs on a host PC (x86) with the LiteRT CPU runtime, using the hardware-independent models (assets/quantized_tflite_model/), not the NPU-compiled assets.

Download the WIDER FACE validation images, then run:

python evaluate.py \
    --dataset WIDER_val/images \
    --model_fp32 tflite/saved_model_scrfd_500m_bnkps_128x128/model_float32.tflite \
    --model_quant assets/quantized_tflite_model/scrfd_500m_128x128_uint8.tflite \
    --input_size 128,128

Download and Run

Running the example

example.py runs detection on an image on a host PC, draws bounding boxes (blue) and keypoints (red), and saves example_output.jpg. Install the dependencies from requirements.txt first.

# Run on PC with the 128x128 model:
python example.py --model assets/quantized_tflite_model/scrfd_500m_128x128_uint8.tflite --image example_input.jpg --input_size 128,128

# Run on PC with the 512x640 model (input_size is WIDTH,HEIGHT):
python example.py --model assets/quantized_tflite_model/scrfd_500m_512x640_uint8.tflite --image example_input.jpg --input_size 640,512

To run the models on an i.MX MPU target with the NPU delegates, see the i.MX Machine Learning User Guide.

Regenerating the assets with recipe.sh

The recipe installs the eIQ Neutron SDK from the NXP eIQ PyPI Distribution Portal. Configure pip once to use it:

python -m pip config --user set global.index https://eiq.nxp.com/repository
python -m pip config --user set global.index-url https://eiq.nxp.com/repository
python -m pip config --user set global.trusted-host eiq.nxp.com
python -m pip config --user set global.extra-index-url https://pypi.org/simple
python -m pip config --user set global.find-links https://eiq.nxp.com/repository/

recipe.sh builds both the MPU (Part A) and the MCU (Part B) artifacts. To regenerate everything with the default toolchain versions, run:

bash recipe.sh

The script takes four optional positional arguments:

bash recipe.sh [VELA_TAG] [NEUTRON_MPU_VER] [IMAGENETV2_PATH] [NEUTRON_MCU_VER]

defaulting to lf-6.18.20_2.0.0, 3.2.3, the dataset placeholder, and 3.2.3 respectively. The MCU Neutron SDK version is the LAST argument so the pre-existing MPU arguments keep their positions.

Part A converts the retrained PyTorch weights in two Docker-based steps, per resolution:

  1. PyTorch to ONNX (onnx/convert2onnx.sh): uses the InsightFace scrfd2onnx.py exporter inside the pinto0309/mmtracking image.
  2. ONNX to int8 TFLite (tflite/convert2tflite.sh): uses OpenVINO Model Optimizer and openvino2tensorflow inside the ghcr.io/pinto0309/openvino2tensorflow image, producing the float32 and full int8 (uint8 input / uint8 output) TFLite models. The calibration data is created by create_calib_data.py, which samples ~100 ImageNetV2 images, resizes them to the target HxW and stores the raw pixel values (0-255) as a .npy of shape (N, H, W, 3) (consumed with --calib_ds_type numpy; the data / 255 normalization is applied during calibration).

Both scripts accept HEIGHT and WIDTH positional arguments and therefore support any resolution:

cd onnx   && ./convert2onnx.sh   512 640
cd tflite && ./convert2tflite.sh 512 640

The int8 model is then compiled with Vela for i.MX 93 and converted with the eIQ Neutron SDK for i.MX 95 / i.MX 952. The generated MPU files (one set per resolution, <H>x<W> in {128x128, 256x256, 256x320, 512x640}) are:

  • assets/quantized_tflite_model/scrfd_500m_<H>x<W>_uint8.tflite - hardware-independent int8 model
  • assets/imx8mplus/scrfd_500m_<H>x<W>_uint8.tflite - int8 model for i.MX 8M Plus (identical to the hardware-independent int8 model)
  • assets/imx93/<VELA_TAG>/scrfd_500m_<H>x<W>_uint8_vela.tflite - Vela-compiled for i.MX 93
  • assets/imx95/<NEUTRON_MPU_VER>/scrfd_500m_<H>x<W>_uint8_converted.tflite - Neutron-converted for i.MX 95
  • assets/imx952/<NEUTRON_MPU_VER>/scrfd_500m_<H>x<W>_uint8_converted.tflite - Neutron-converted for i.MX 952

Part B compiles the MCU base models for i.MX RT700 with the eIQ Neutron Compiler and regenerates every header with xxd -i plus the NXP banner (see the next section).

MCU targets (TensorFlow Lite Micro)

On MCUs the shippable artifacts are C header files containing the model as a byte array, to be compiled directly into the firmware image - not .tflite files. The base .tflite models are provided in assets/quantized_tflite_model_mcu/ for reference and for re-running the conversion.

Note: the MCU models are a different quantization of the same network than the MPU models above (same uint8 input / uint8 output interface, but different quantization parameters) and are taken as-is from eIQ MPP, so they are neither re-trained nor re-quantized by recipe.sh. They are shipped side by side with the MPU models under their eIQ MPP names.

Three input resolutions are available for MCUs, named WIDTHxHEIGHT following the eIQ MPP convention (so 320x256 is the landscape variant that the MPU section calls 256x320). There is no 512x640 MCU build.

MCUComputeNeutron targetDirectory
i.MX RT1170Cortex-M7 (CPU, no NPU)-assets/rt1170/
i.MX RT700Neutron-64 NPUimxrt700assets/rt700/3.2.2/, assets/rt700/3.2.3/

The i.MX RT700 build converts 133/133 operators to the NPU (100%, a single Neutron graph), for both SDK versions.

For each resolution <RES> in {128x128, 256x256, 320x256}:

  • assets/quantized_tflite_model_mcu/scrfd_kps_500m_full_integer_quant_<RES>.tflite - base int8 model
  • assets/rt1170/scrfd_kps_500m_full_integer_quant_<RES>_tflite.h - model byte array for i.MX RT1170 (CPU)
  • assets/rt1170/scrfd_kps_500m_full_integer_quant_<RES>_tflite_info.h - pre/post-processing constants
  • assets/rt700/<neutron_sdk_version>/scrfd_kps_500m_full_integer_quant_<RES>_npu64_tflite.h - model byte array for i.MX RT700, for <neutron_sdk_version> in {3.2.2, 3.2.3}

The CPU target (i.MX RT1170) has no NPU toolchain, so its headers live directly under assets/rt1170/. The Neutron (NPU) headers are versioned by the eIQ Neutron SDK used to compile them and therefore live in a version-named subdirectory (assets/rt700/<neutron_sdk_version>/), mirroring the assets/imx95/<version>/ layout used for the MPU targets.

Each header declares the array as scrfd_kps_data with its length in scrfd_kps_data_len, aligned to 16 bytes. The i.MX RT700 headers additionally place the array in the .modeldata linker section via the __PLACEMENT macro.

Pre- and post-processing constants are taken from the *_tflite_info.h headers. Input is RGB, normalized with mean 0 and std 255 (that is, pixels scaled to [0, 1]):

Constant128x128256x256320x256
Input width x height128x128256x256320x256
Boxes at stride 851220482560
Boxes at stride 16128512640
Boxes at stride 3232128160

The model has 9 output tensors - per-stride scores, bounding-box distances and keypoint distances for the small (stride 8), medium (stride 16) and large (stride 32) levels - and regresses 5 landmarks per detected box.

Runnable MCU examples are provided by eIQ Media Processing Pipeline (MPP), not by this repository. See the eIQ MPP User's Guide.

License

This model, including the NXP-retrained weights, the quantized and compiled assets and the scripts in this repository, is released under the MIT License (see LICENSE). The original InsightFace SCRFD source code is also released under the MIT License.

Citation

If you use this model, please cite both this work and the original model:

  • J. Guo, J. Deng, A. Lattas and S. Zafeiriou, "Sample and Computation Redistribution for Efficient Face Detection," International Conference on Learning Representations (ICLR), 2022. arXiv:2105.04714.
  • S. Yang, P. Luo, C. C. Loy and X. Tang, "WIDER FACE: A Face Detection Benchmark," Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
@inproceedings{guo2022sample,
  title={Sample and Computation Redistribution for Efficient Face Detection},
  author={Guo, Jia and Deng, Jiankang and Lattas, Alexandros and Zafeiriou, Stefanos},
  booktitle={International Conference on Learning Representations},
  year={2022}
}

@inproceedings{yang2016wider,
  title={WIDER FACE: A Face Detection Benchmark},
  author={Yang, Shuo and Luo, Ping and Loy, Chen Change and Tang, Xiaoou},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2016}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · object-detection

Можно запустить

Подбираем GPU…

Ревизия весов
0dc6bbd

0 моделей