/ Модель

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

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

ultraface-ultraslim-imx

Поиск объектовИзображение → bounding_boxes3 профессии
171скачиваний за 30 дней0лайковвеса обновлены10 ноя 2026

Описание модели

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

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

Ultraface Ultraslim — компактная модель обнаружения лиц, разработанная NXP на основе Ultraface slim из проекта Ultra-Light-Fast-Generic-Face-Detector-1MB. Она предназначена для обработки RGB-изображений на устройствах с ограниченными ресурсами: микроконтроллерах и встраиваемых MPU платформ NXP. Модель принимает изображение размером 128×128 пикселей в формате int8 и выдаёт оценки классов и координаты рамок для 172 якорных обнаружений. Веса квантизованы до int8; варианты подготовлены для LiteRT и TensorFlow Lite Micro и оптимизированы для ряда NXP i.MX и MCX устройств.

Уменьшенная конфигурация использует меньше памяти и вычислений, но обнаруживает преимущественно достаточно крупные лица. В графе модели отсутствуют декодирование рамок, пороговая фильтрация и подавление немаксимумов, поэтому для получения итоговых рамок требуется внешняя постобработка. Модель не распознаёт личности и не оценивает возраст, пол или эмоции; качество может зависеть от позы, освещения, перекрытий и представленности групп в обучающих данных. Лицензия — MIT.

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

  • обнаружение лиц на кадрах с камер устройств i.MX
  • поиск крупных лиц в RGB-изображении на микроконтроллере
  • подсчёт лиц после внешней постобработки детекций
  • встраиваемая детекция лиц с низкими требованиями к памяти

Ограничения

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

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

Ultraface ultraslim

Overview

Ultraface is a lightweight face detection model designed for edge computing devices. Given an RGB image, it regresses bounding boxes (4 coordinates) and a confidence score for each detected face.

This repository contains the ultraslim variant: a cut-down version of the original Ultraface model targeted at systems with very little memory (e.g. MCUs). Compared to the standard Ultraface model it uses a 128x128 input instead of 320x240, removes the finest output level (so it only detects reasonably large faces), and removes the non-maximum-suppression / confidence-threshold / top-k post-processing from the graph, returning the raw anchor detections instead (these steps are performed in example.py / evaluate.py). It is 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 a fixed 128x128 input resolution.
  • i.MX RT MCUs and MCX-N947 (i.MX RT1170, i.MX RT700, MCX-N947) as TensorFlow Lite Micro C byte-array headers.

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 is only a face detection model. It does not perform face recognition/identification.

Key Features

  • Very small (~374 KB int8) and extremely fast face detector for 128x128 inputs.
  • Suitable for memory-constrained MCU/MPU targets.
  • Fully quantized int8 model with int8 input and int8 output.
  • 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 running TensorFlow Lite Micro (i.MX RT1170, MCX-N947, i.MX RT700) as C headers.

Model Description

This is a quantized and compiled version of the Ultraface slim face detector from Ultra-Light-Fast-Generic-Face-Detector-1MB, cut down to a smaller "ultraslim" configuration and optimized for NXP i.MX MPUs and MCUs.

Modifications

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

  • Architecture reduction: the input resolution is reduced to 128x128 (from 320x240), the finest output level is removed (so the model only detects reasonably large faces), and the in-graph non-maximum suppression / confidence-threshold / top-k post-processing is removed, so the graph produces a fixed-size (172, 6) tensor of raw anchor detections from the three coarsest output levels (ultraslim.patch).
  • Format conversion: the original PyTorch model is converted to a TensorFlow saved model (convert_tensorflow.py) and then to TensorFlow Lite.
  • Quantization (MPU model): full int8 post-training quantization, int8 input and int8 output, calibrated on 100 images sampled from a commercially-usable ImageNetV2 subset (WIDER FACE cannot be used for calibration due to licensing), normalized as (pixel - 127) / 128.
  • Compilation (i.MX 93): compiled with Vela (--accelerator-config ethos-u65-256 --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 separate int8 export of the same "ultraslim" network (assets/quantized_tflite_model_mcu/ultraface_ultraslim_int8_mcu.tflite), with the same int8 / int8 interface and no box decoding or NMS in the graph, compiled from the eIQ Neutron Compiler for MCX-N947 (--target mcxn94x) and i.MX RT700 (--target imxrt700) using eIQ Neutron SDK versions 3.2.2 and 3.2.3, then converted into C byte arrays with xxd -i. The i.MX RT1170 header wraps the plain int8 MCU model unchanged (no NPU compilation).
  • Post-processing: confidence thresholding and non-maximum suppression are performed outside the graph (see example.py / evaluate.py).

Original model available at: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB.

Model Information

InformationValue
Input shapeRGB image (1, 128, 128, 3), int8
Input example
Output shapeTensor of size (172, 6) with the raw detections of the three coarsest output levels (class scores + box coordinates). See example.py to decode it.
Output example
FLOPS38.0M
Number of parameters257,700
File size (int8)374 KB (assets/quantized_tflite_model/ultraface_ultraslim_int8.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). The same information is captured in release_manifest.json.

AssetRuntimePrecisionHW targetBSP & SDK versionsLink to asset
i.MX 8M Plus QuantizedLiteRTINT8i.MX 8M Plus-Download
i.MX 93 PrecompiledLiteRTINT8i.MX 93BSP lf-6.18.20_2.0.0, VELA_TAG = lf-6.18.20_2.0.0Download
i.MX 93 PrecompiledLiteRTINT8i.MX 93BSP lf-6.18.37_2.1.0, VELA_TAG = lf-6.18.37_2.1.0Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1Download
i.MX 95 PrecompiledLiteRTINT8i.MX 95BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1Download
i.MX 952 PrecompiledLiteRTINT8i.MX 952BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3Download
i.MX RT1170 C headerTensorFlow Lite MicroINT8i.MX RT1170MCUXpresso SDK 26.09.00Download
i.MX RT700 C headerTensorFlow Lite MicroINT8i.MX RT700Neutron SDK v3.2.2, MCUXpresso SDK 26.09.00Download
i.MX RT700 C headerTensorFlow Lite MicroINT8i.MX RT700Neutron SDK v3.2.3, MCUXpresso SDK 26.09.00Download
MCX-N947 C headerTensorFlow Lite MicroINT8MCX-N947Neutron SDK v3.2.2, MCUXpresso SDK 26.09.00Download
MCX-N947 C headerTensorFlow Lite MicroINT8MCX-N947Neutron SDK v3.2.3, MCUXpresso SDK 26.09.00Download

The i.MX 8M Plus asset is a symlink to, and byte-identical with, the hardware-independent int8 model in assets/quantized_tflite_model/. The hardware-independent int8 models for both the MPU interface and the MCU interface are also provided for host (x86) inference: assets/quantized_tflite_model/ and assets/quantized_tflite_model_mcu/ respectively.

Limitations and Biases

This model inherits all limitations from the original Ultraface model. Additional limitations:

  • Task scope: Face detection only. The model does not identify or recognize individuals and does not estimate attributes such as age, gender or emotion.
  • Small faces: Because the finest output level was removed and the input is only 128x128, this "ultraslim" variant cannot detect small or distant faces; it is only accurate when a face fills a reasonable fraction of the frame.
  • 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 model was trained on the WIDER FACE dataset by the original authors, according to the original source. NXP did not retrain this model; the weights are those of the original Ultraface slim release, modified, converted and quantized as described in Modifications.

Evaluation

evaluate.py evaluates the int8 quantized "ultraslim" model (assets/quantized_tflite_model/ultraface_ultraslim_int8.tflite) on the WIDER FACE validation set (3226 images) using the official WIDER FACE evaluation protocol (Average Precision at IoU 0.5 for the easy/medium/hard subsets). Unlike the "slim" variant, the ultraslim graph does not include non-maximum suppression, so confidence thresholding and NMS are applied in NumPy before scoring. The evaluation runs on a host PC (x86) with the LiteRT CPU runtime.

Download the WIDER FACE validation images (the ground-truth .mat files are provided in the ground_truth/ directory), then run:

# WIDER_val/ should contain the event sub-folders (e.g. 0--Parade/)
python evaluate.py -m assets/quantized_tflite_model/ultraface_ultraslim_int8.tflite -d WIDER_val -g ground_truth

Because the ultraslim model only detects large faces, scores on the full WIDER FACE validation set will be much lower than those of the full-size model.

Download and Run

Running the example

An example showing how to run detection on an image is in example.py (run on a PC):

python example.py -m assets/quantized_tflite_model/ultraface_ultraslim_int8.tflite -i example_input.jpg -o example_output.jpg

Because the ultraslim model only detects large faces, example.py crops a central region before resizing to 128x128 by default (configurable with --crop "x0,y0,x1,y1"; pass an empty string to disable).

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

Full on-device examples leveraging GStreamer/NNStreamer and this model can be found in nxp-nnstreamer-examples on GitHub.

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 the TFLite model fully quantized in int8 (int8 input, int8 output) and compile it for all supported platforms, run:

bash recipe.sh [VELA_TAG] [NEUTRON_MPU_VERSION] [NEUTRON_MCU_VERSION]

defaulting to lf-6.18.20_2.0.0, 3.2.3 and 3.2.3 respectively. The calibration dataset path (DATASET_PATH inside the script, a commercially-usable ImageNetV2 subset) must be set before running, since WIDER FACE cannot be redistributed/used for quantization due to licensing.

MCU targets (TensorFlow Lite Micro)

Besides the i.MX MPU files, this repository also ships Ultraface ultraslim for NXP MCUs running TensorFlow Lite Micro. The MCU has no file system, so the shippable artifact there is a C header file (model byte array) that gets compiled directly into the firmware image.

The MCU variant is a separate int8 export of the same "ultraslim" network (assets/quantized_tflite_model_mcu/ultraface_ultraslim_int8_mcu.tflite), with the same int8 / int8 interface as the MPU model, and no box decoding or non-maximum suppression in the graph, so the application performs the thresholding and NMS itself.

MCUCore / AcceleratorNeutron targetDirectory
i.MX RT1170Cortex-M7, CPU only-assets/rt1170/
MCX-N947Cortex-M33 + Neutron-16 NPUmcxn94xassets/mcxn947/3.2.2/, assets/mcxn947/3.2.3/
i.MX RT700Cortex-M33 + Neutron-64 NPUimxrt700assets/rt700/3.2.2/, assets/rt700/3.2.3/
assets/quantized_tflite_model_mcu/ultraface_ultraslim_int8_mcu.tflite       base int8 MCU model, 128x128

assets/rt1170/ultraface_slim_ultraslim_tflite.h                   i.MX RT1170 (CPU)
assets/rt1170/ultraface_slim_ultraslim_tflite_info.h               matching metadata header

assets/mcxn947/<version>/ultraface_slim_ultraslim_npu16_tflite.h   MCX-N947 (Neutron-16)
assets/mcxn947/<version>/ultraface_slim_ultraslim_npu16_tflite_info.h  matching metadata header

assets/rt700/<version>/ultraface_slim_ultraslim_npu64_tflite.h     i.MX RT700 (Neutron-64)
assets/rt700/<version>/ultraface_slim_ultraslim_npu64_tflite_info.h   matching metadata header

The i.MX RT1170 header uses the plain int8 model (no NPU), so it lives directly under assets/rt1170/. The two NPU headers are compiled with the eIQ Neutron Compiler and therefore live in a subdirectory named after the eIQ Neutron SDK version used. Both 3.2.2 and 3.2.3 are shipped for MCX-N947 and i.MX RT700; the compiled model payload is unchanged between the two versions (only the version stamp embedded in the banner comment differs), so either can be used.

Each *_tflite.h declares the model byte array (ultraface_data / ultraface_data_len) and is accompanied by the matching *_tflite_info.h metadata header, which exposes the pre/post processing constants the application needs.

Ready-to-run application examples that use this model are included in the eIQ Media Processing Pipeline (MPP):

License

This model, including the quantized and compiled assets and the scripts in this repository, is released under the MIT License (see LICENSE). The original Ultraface model is also released under the MIT License (see MODEL_LICENSE).

Citation

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

@inproceedings{yang2016wider,
  title={Wider face: A face detection benchmark},
  author={Yang, Shuo and Luo, Ping and Loy, Chen-Change and Tang, Xiaoou},
  booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
  pages={5525--5533},
  year={2016}
}

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

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

GPU в ailist

Универсальный рантайм

Нельзя запустить

Библиотека «litert» рантаймом не поддерживается.

Ревизия весов
e60d8da

0 моделей