MediaPipe-Selfie-Segmentation
Semantic Segmentation
INT8
W8A16
FP16
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

When the user has fine-tuned the source model, the model conversion process must be performed again.

Users can refer to either of the following two methods to complete the model conversion:

  • Using AIMO for model conversion: Click Model Conversion Reference in the Performance Reference section on the right to view the conversion steps.

  • Using Qualcomm QNN for model conversion: Please refer to the Qualcomm QNN Documentation.

Model Inference

The model performance benchmarks and example code provided by Model Farm are all implemented based on the AIDLux AidLite SDK.

For models in .bin format, you can use either of the following two inference engines to run inference on Qualcomm chips:

Inference using APLUX AidLite: please refer to the APLUX AidLite Developer Documentation

Inference using Qualcomm QNN: Please refer to the Qualcomm QNN Documentation

Inference Example Code

The inference example code is implemented using the AidLite SDK.

Click Model & Code to download the model files and the inference code package. The file structure is as follows:

/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