MediaPipe-Selfie-Segmentation-INT8
Semantic Segmentation
INT8
post
MediaPipe-Selfie-Segmentation: Semantic Segmentation

MediaPipe-Selfie-Segmentation is a real-time human segmentation model within Google's MediaPipe framework, optimized for efficient background separation. Leveraging deep learning, lightweight architecture, and hardware acceleration, it supports multi-resolution input on mobile and edge devices. Core features include precise subject extraction, background replacement/blurring, and applications in video conferencing (e.g., virtual backgrounds), AR filters (e.g., dynamic effects), and photo editing. With general and landscape versions, it balances low computational resource consumption with high-quality output, establishing itself as an industry benchmark for lightweight portrait segmentation.

Source model

  • Input shape: 1x3x256x256
  • Number of parameters: 0.11M
  • Model size: 0.65M
  • Output shape: 1x1x256x256

The source model can be found here.

Performance Reference

Device

Backend
Precision
Inference Time
Accuracy Loss
File Size
Model Optimization

Click Model Conversion Reference in the Performance Reference panel on the right to view the model conversion steps.

Inference with AidLite SDK

The model performance benchmarks and inference example code provided on Model Farm are all based on the APLUX AidLite SDK

SDK installation

For details, please refer to the AidLite Developer Documentation

  • Install AidLite SDK
# install aidlite sdk c++ api
sudo aid-pkg -i aidlite-sdk

# install aidlite sdk python api
python3 -m pip install pyaidlite -i https://mirrors.aidlux.com --trusted-host mirrors.aidlux.com
  • Verify AidLite SDK
# aidlite sdk c++ check
python3 -c "import aidlite; print(aidlite.get_library_version())"

# aidlite sdk python check
python3 -c "import aidlite; print(aidlite.get_py_library_version())"

Inference example

  • Click Model & Test Code to download model files and inference codes. The file structure showed below:
/model_farm_{model_name}_aidlite
    
    |__ models # folder where model files are stored

    |__ python # aidlite python model inference example

    |__ cpp # aidlite cpp model inference example

    |__ README.md
License
Source Model:APACHE-2.0
Deployable Model:APLUX-MODEL-FARM-LICENSE
Performance Reference

Device

Backend
Precision
Inference Time
Accuracy Loss
File Size