--- library_name: pytorch license: other tags: - android pipeline_tag: image-segmentation --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/web-assets/model_demo.png) # MediaPipe-Selfie-Segmentation: Optimized for Qualcomm Devices Light-weight model that segments a person from the background in square or landscape selfie and video conference imagery. This is based on the implementation of MediaPipe-Selfie-Segmentation found [here](https://github.com/google/mediapipe/tree/master/mediapipe/modules/selfie_segmentation). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/qai_hub_models/models/mediapipe_selfie) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary). Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device. ## Getting Started There are two ways to deploy this model on your device: ### Option 1: Download Pre-Exported Models Below are pre-exported model assets ready for deployment. | Runtime | Precision | Chipset | SDK Versions | Download | |---|---|---|---|---| | ONNX | float | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-onnx-float.zip) | ONNX | w8a16 | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-onnx-w8a16.zip) | ONNX | w8a8 | Universal | QAIRT 2.42, ONNX Runtime 1.24.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-onnx-w8a8.zip) | QNN_DLC | float | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-qnn_dlc-float.zip) | QNN_DLC | w8a16 | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-qnn_dlc-w8a16.zip) | QNN_DLC | w8a8 | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-qnn_dlc-w8a8.zip) | TFLITE | float | Universal | QAIRT 2.43, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-tflite-float.zip) | TFLITE | w8a8 | Universal | QAIRT 2.43, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/mediapipe_selfie/releases/v0.48.0/mediapipe_selfie-tflite-w8a8.zip) For more device-specific assets and performance metrics, visit **[MediaPipe-Selfie-Segmentation on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/mediapipe_selfie)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/qai_hub_models/models/mediapipe_selfie) Python library to compile and export the model with your own: - Custom weights (e.g., fine-tuned checkpoints) - Custom input shapes - Target device and runtime configurations This option is ideal if you need to customize the model beyond the default configuration provided here. See our repository for [MediaPipe-Selfie-Segmentation on GitHub](https://github.com/qualcomm/ai-hub-models/blob/main/qai_hub_models/models/mediapipe_selfie) for usage instructions. ## Model Details **Model Type:** Model_use_case.semantic_segmentation **Model Stats:** - Model checkpoint: Square - Input resolution (Square): 256x256 - Input resolution (Landscape): 144x256 - Number of output classes: 6 - Number of parameters: 106K - Model size (float): 447 KB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | MediaPipe-Selfie-Segmentation | ONNX | float | Snapdragon® X2 Elite | 0.381 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Snapdragon® X Elite | 0.919 ms | 2 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 0.524 ms | 0 - 37 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Qualcomm® QCS8550 (Proxy) | 0.783 ms | 1 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Qualcomm® QCS9075 | 0.98 ms | 1 - 4 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.413 ms | 0 - 24 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.368 ms | 0 - 31 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® X2 Elite | 0.401 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® X Elite | 1.005 ms | 1 - 1 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 0.549 ms | 0 - 41 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Qualcomm® QCS6490 | 30.509 ms | 14 - 17 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Qualcomm® QCS8550 (Proxy) | 0.831 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Qualcomm® QCS9075 | 0.963 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Qualcomm® QCM6690 | 11.682 ms | 15 - 23 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.447 ms | 0 - 37 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 7.999 ms | 15 - 23 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.384 ms | 0 - 37 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® X2 Elite | 0.18 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® X Elite | 0.479 ms | 1 - 1 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.245 ms | 0 - 36 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Qualcomm® QCS6490 | 9.853 ms | 7 - 11 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.366 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Qualcomm® QCS9075 | 0.515 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Qualcomm® QCM6690 | 5.975 ms | 7 - 15 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.208 ms | 0 - 30 MB | NPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 4.128 ms | 0 - 8 MB | CPU | MediaPipe-Selfie-Segmentation | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.191 ms | 0 - 30 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Snapdragon® X2 Elite | 0.46 ms | 1 - 1 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Snapdragon® X Elite | 0.856 ms | 1 - 1 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 0.458 ms | 0 - 36 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 1.797 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 0.686 ms | 1 - 17 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® SA8775P | 0.973 ms | 1 - 28 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® QCS9075 | 0.858 ms | 1 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 0.941 ms | 0 - 39 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® SA7255P | 1.797 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Qualcomm® SA8295P | 1.294 ms | 0 - 25 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.359 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.323 ms | 1 - 30 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 0.379 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® X Elite | 0.754 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 0.423 ms | 0 - 36 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCS6490 | 1.816 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCS8275 (Proxy) | 1.327 ms | 0 - 27 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCS8550 (Proxy) | 0.604 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® SA8775P | 3.31 ms | 0 - 27 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCS9075 | 0.745 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCM6690 | 2.085 ms | 0 - 141 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® QCS8450 (Proxy) | 0.758 ms | 0 - 39 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® SA7255P | 1.327 ms | 0 - 27 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Qualcomm® SA8295P | 1.104 ms | 0 - 24 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.331 ms | 0 - 27 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 0.612 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.268 ms | 0 - 31 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® X2 Elite | 0.233 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® X Elite | 0.383 ms | 0 - 0 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.184 ms | 0 - 32 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 0.818 ms | 2 - 4 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.686 ms | 0 - 24 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.265 ms | 0 - 16 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8775P | 0.451 ms | 0 - 25 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 0.354 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 0.828 ms | 0 - 22 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.343 ms | 0 - 34 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA7255P | 0.686 ms | 0 - 24 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8295P | 0.631 ms | 0 - 21 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.146 ms | 0 - 22 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.261 ms | 0 - 23 MB | NPU | MediaPipe-Selfie-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.132 ms | 0 - 25 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 0.46 ms | 0 - 36 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 1.817 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 0.69 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® SA8775P | 1.014 ms | 0 - 28 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® QCS9075 | 0.868 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 0.946 ms | 0 - 39 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® SA7255P | 1.817 ms | 0 - 26 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Qualcomm® SA8295P | 1.327 ms | 0 - 25 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.365 ms | 0 - 30 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.319 ms | 0 - 30 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.177 ms | 0 - 31 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCS6490 | 0.69 ms | 0 - 3 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.709 ms | 0 - 23 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.267 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® SA8775P | 0.467 ms | 0 - 24 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCS9075 | 0.399 ms | 0 - 2 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCM6690 | 0.856 ms | 0 - 21 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.353 ms | 0 - 32 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® SA7255P | 0.709 ms | 0 - 23 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Qualcomm® SA8295P | 0.64 ms | 0 - 20 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.155 ms | 0 - 22 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.266 ms | 0 - 21 MB | NPU | MediaPipe-Selfie-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.139 ms | 0 - 25 MB | NPU ## License * The license for the original implementation of MediaPipe-Selfie-Segmentation can be found [here](https://github.com/google/mediapipe/blob/master/LICENSE). ## References * [Image segmentation guide](https://developers.google.com/mediapipe/solutions/vision/image_segmenter/) * [Source Model Implementation](https://github.com/google/mediapipe/tree/master/mediapipe/modules/selfie_segmentation) ## Community * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI. * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).