/ Модель

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

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

selfie-segmenter-imx

Сегментация изображенийИзображение → mask3 профессии

Квантованная NXP версия MediaPipe Selfie Segmenter выделяет человека на изображениях для изменения фона и периферийной обработки на устройствах i.MX.

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

Бенчмарки

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

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

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

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

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

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

Это квантованная версия MediaPipe Selfie Segmenter, подготовленная NXP для запуска на устройствах i.MX. Модель принимает нормализованное RGB-изображение и возвращает одноканальную маску вероятности принадлежности каждого пикселя к человеку. Архитектура основана на MobileNetV3 с модифицированными блоками декодера сегментации; доступны варианты с разрешением 256×256 и 256×144. Веса и активации квантованы до int8, при этом вход и выход представлены как float32.

Модель предназначена для отделения человека от фона, например для замены или изменения фона фотографии и обработки портретного видео на периферийных устройствах. Вариант Landscape рассчитан на более быструю работу, включая реальное время на поддерживаемых CPU и NPU; вариант General использует большее разрешение и описан как более точный. Репозиторий содержит форматы TFLite и конфигурации для платформ i.MX 8M Plus, i.MX 93, i.MX 95 и i.MX 952. Исходную модель разработали авторы Google/MediaPipe; NXP выполнила конвертацию, квантование и подготовку для целевых платформ. Лицензия репозитория — MIT.

Модель сегментирует человека и фон, но не распознаёт людей. Она может работать хуже, если человек находится примерно дальше четырёх метров от камеры или в кадре несколько людей разного масштаба. Также унаследованы возможные смещения исходного обучающего набора MediaPipe, которые NXP не оценивала.

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

  • создание маски человека для замены фона на фотографии
  • размытие или изменение фона в видеозвонке на устройстве i.MX
  • сегментация портретного кадра на периферийном устройстве
  • обработка селфи в приложении с фоновыми эффектами

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Selfie Segmenter (MediaPipe)

Overview

Selfie Segmenter segments the portrait of a person and can be used to replace or modify the background of an image. Given a normalized RGB image, the model returns a single-channel grayscale mask where each pixel value expresses the probability that the corresponding pixel belongs to the foreground (a person). Its architecture is based on MobileNetV3 with added customized decoder blocks for segmentation.

There are two variants of the same model: General (256x256) and Landscape (256x144). The general variant is more accurate than the landscape variant since its input image is larger and more features can be extracted. The landscape variant runs faster and achieves real-time performance on both CPU (XNNPack delegate) and NPU (VX Delegate and Ethos-U Delegate).

This repository ships both variants, quantized to int8 for deployment on NXP i.MX platforms (i.MX 8M Plus, i.MX 93, i.MX 95 and i.MX 952). It also contains the scripts used to regenerate these assets (recipe.sh) and an inference example (example.py).

Key Features

  • Fully quantized int8 model ready for edge deployment, with float32 input and float32 output.
  • Lightweight MobileNetV3-based backbone with customized segmentation decoder.
  • Two input resolutions: general (256x256) and landscape (256x144).
  • Outputs a per-pixel grayscale foreground mask in the range [0.0, 1.0].
  • Compatible with i.MX 8M Plus (CPU/VX NPU delegate), i.MX 93 (Ethos-U65 NPU) and i.MX 95 / i.MX 952 (eIQ Neutron NPU).

Model Description

This is a quantized version of the MediaPipe Selfie Segmenter model, optimized for NXP i.MX platforms.

Modifications

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

  • Format conversion: the original MediaPipe float16 *.tflite model is converted to a TensorFlow SavedModel (*.pb) using tflite2tensorflow, then re-exported to TFLite.
  • Quantization: full int8 post-training quantization (weights and activations); the model keeps float32 input and float32 output. Calibration is performed with 68 images from the COCO 2017 validation dataset that do not belong to the original (proprietary) MediaPipe training dataset.
  • Compilation (i.MX 93): compiled with the Vela compiler, 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 and 3.2.1 for i.MX 95, and 3.1.3, 3.2.1 and 3.2.3 for i.MX 952.

Original model available at: https://developers.google.com/mediapipe/solutions/vision/image_segmenter.

Model Information

InformationValue (General)Value (Landscape)
Input shapeRGB image (1, 256, 256, 3), float32RGB image (1, 144, 256, 3), float32
Input value range[0.0, 1.0] (normalized as pixel / 255)[0.0, 1.0] (normalized as pixel / 255)
Input example
Output shapeGrayscale mask (1, 256, 256, 1), float32Grayscale mask (1, 144, 256, 1), float32
Output value range[0.0, 1.0][0.0, 1.0]
Output example
FLOPS127.7 M OPS (63.84 M MACs)71.6 M OPS (35.78 M MACs)
File size (int8)~216 KB~216 KB
Source frameworkMediaPipe (TensorFlow Lite)MediaPipe (TensorFlow Lite)

Supported Hardware and Software Configurations

All 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). Each link points to a directory containing both variants (general and landscape). 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 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

The hardware-independent int8 models are also provided for host (x86) inference and as the input to the compilers above: assets/quantized_tflite_model/.

Limitations and Biases

This model inherits all limitations from the original MediaPipe Selfie Segmenter model. Additional limitations:

  • Task scope: Person/background segmentation only. The model does not identify or recognize individuals and should not be used for any form of surveillance or identity recognition.
  • Distance and multi-person scenes: The model is not expected to work well for people too far away from the camera (~4 meters) or for scenes with multiple people across different scales.
  • Dataset bias: The original model was trained by MediaPipe on a proprietary dataset that is not provided; any biases present in that dataset (for example with respect to pose, lighting, skin tone or demographic group) are inherited by this model and were not assessed by NXP.

For more information, see the MediaPipe Selfie Segmenter model card.

Training

The model was trained by Google/MediaPipe on a proprietary dataset which is not provided. NXP did not retrain the model; NXP's contribution is limited to quantization and compilation as described in Modifications. Calibration during quantization uses a subset of the COCO dataset [1] that does not belong to the original training dataset.

Evaluation

Because ground truths for the original (proprietary) training/validation data are not available, this model was not evaluated for accuracy against labeled data. As an alternative, cosine similarity between the MediaPipe FP16 model and the quantized int8 model was computed on the test dataset (Selfie) from the Selfie-Image-Detection-Dataset (3,931 images), on a host PC. This repository does not include an evaluate.py script; no accuracy or performance numbers are reported here.

Download and Run

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/

To download the model, quantize it, and compile it for all supported platforms, run:

bash recipe.sh [VELA_TAG] [NEUTRON_VERSION_IMX95] [NEUTRON_VERSION_IMX952]

For example, to build the second toolchain versions:

bash recipe.sh lf-6.18.37_2.1.0 3.2.1 3.2.3

This will:

  1. Download the MediaPipe Selfie Segmenter float16 models (general and landscape).
  2. Convert and quantize both to int8 TFLite (assets/quantized_tflite_model/).
  3. Compile them with Vela for i.MX 93 (Ethos-U65 NPU).
  4. Convert them with the eIQ Neutron SDK for i.MX 95 and i.MX 952.

An example of running inference is in example.py (run on a PC):

# Run on PC:
python3 example.py -m assets/quantized_tflite_model/selfie_segmenter_int8.tflite -i data/example_input.jpg -o data/example_output.jpg

example.py accepts -m/--model (default assets/quantized_tflite_model/selfie_segmenter_int8.tflite), -i/--input (default data/example_input.jpg), -o/--output (default data/example_output.jpg) and -t/--threshold (default 0.1, the confidence threshold for the foreground mask).

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.

Below is an NNStreamer pipeline example for the Selfie Segmenter model on i.MX 8M Plus with NPU acceleration (VX Delegate). The output shows the input camera video and the segmentation mask side by side:

gst-launch-1.0 --no-position v4l2src device=/dev/video3 ! \
  video/x-raw,width=640,height=480,framerate=30/1 ! \
  aspectratiocrop aspect-ratio=1/1 ! \
  imxvideoconvert_g2d ! video/x-raw,width=480,height=480 ! \
  tee name=t t. ! queue max-size-buffers=2 leaky=2 ! \
  imxvideoconvert_g2d ! video/x-raw,width=256,height=256,format=RGBA ! \
  videoconvert ! video/x-raw,format=RGB ! \
  tensor_converter ! \
  tensor_transform mode=arithmetic option=typecast:float32,div:255.0 ! \
  tensor_filter framework=tensorflow-lite model=selfie_segmenter_int8.tflite \
  custom=Delegate:External,ExtDelegateLib:libvx_delegate.so ! \
  tensor_decoder mode=image_segment option1=snpe-depth option2=0 ! \
  imxvideoconvert_g2d ! \
  video/x-raw,width=480,height=480,format=RGBA ! \
  mix. t. ! queue max-size-buffers=2 leaky=2 ! \
  imxcompositor_g2d name=mix latency=30000000 min-upstream-latency=30000000 \
                             sink_1::ypos=0 sink_1::width=480 sink_1::height=480 \
                             sink_0::ypos=0 sink_0::xpos=480 sink_0::width=480 sink_0::height=480 ! \
  waylandsink

segmentation nnstreamer

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 MediaPipe Selfie Segmenter model is released under the Apache-2.0 License (https://www.apache.org/licenses/LICENSE-2.0.html).

Citation

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

@misc{mediapipe_selfie_segmenter,
  title = {MediaPipe Image Segmenter: Selfie Segmentation},
  author = {Hou, Tingbo and Pisarchyk, Siargey and Raveendran, Karthik},
  howpublished = {Google MediaPipe},
  year = {2021},
  url = {https://developers.google.com/mediapipe/solutions/vision/image_segmenter}
}

@inproceedings{lin2014microsoft,
  title={Microsoft COCO: Common Objects in Context},
  author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Dollar, Piotr and Zitnick, C Lawrence},
  booktitle={European Conference on Computer Vision},
  year={2014},
  organization={Springer}
}

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

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

GPU в ailist

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

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

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

Ревизия весов
2263f96

0 моделей