library_name: pytorch
license: other
tags:
- foundation
- android
pipeline_tag: image-segmentation
MobileSam: Optimized for Qualcomm Devices
Transformer based encoder-decoder where prompts specify what to segment in an image thereby allowing segmentation without the need for additional training. The image encoder generates embeddings and the lightweight decoder operates on the embeddings for point and mask based image segmentation.
This is based on the implementation of MobileSam found here. This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the Qualcomm® AI Hub Models library to export with custom configurations. More details on model performance across various devices, can be found here.
Qualcomm AI Hub Models uses Qualcomm AI Hub Workbench to compile, profile, and evaluate this model. Sign up 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.3 | Download |
| QNN_DLC | float | Universal | QAIRT 2.45 | Download |
| TFLITE | float | Universal | QAIRT 2.45 | Download |
For more device-specific assets and performance metrics, visit MobileSam on Qualcomm® AI Hub.
Option 2: Export with Custom Configurations
Use the Qualcomm® AI Hub Models 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 MobileSam on GitHub for usage instructions.
Model Details
Model Type: Model_use_case.semantic_segmentation
Model Stats:
- Model checkpoint: vit_t
- Input resolution: 720p (720x1280)
- Number of parameters (sam_encoder): 6.95M
- Model size (sam_encoder) (float): 26.6 MB
- Number of parameters (sam_decoder): 6.16M
- Model size (sam_decoder) (float): 23.7 MB
Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |
|---|---|---|---|---|---|---|
| decoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.952 ms | 0 - 242 MB | NPU |
| decoder | ONNX | float | Snapdragon® X2 Elite | 3.024 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 7.626 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.959 ms | 5 - 263 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 7.123 ms | 0 - 15 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS9075 | 8.456 ms | 4 - 7 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.668 ms | 0 - 225 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.116 ms | 3 - 191 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.545 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.204 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.361 ms | 4 - 213 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 11.707 ms | 0 - 183 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 4.833 ms | 4 - 6 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 5.854 ms | 1 - 187 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS9075 | 5.891 ms | 4 - 10 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 10.547 ms | 0 - 212 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA7255P | 11.707 ms | 0 - 183 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.323 ms | 0 - 188 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.579 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.605 ms | 0 - 191 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.754 ms | 0 - 243 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 12.829 ms | 0 - 214 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 5.552 ms | 0 - 8 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 6.614 ms | 0 - 216 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS9075 | 6.864 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 9.278 ms | 0 - 217 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA7255P | 12.829 ms | 0 - 214 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8295P | 8.823 ms | 0 - 191 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.99 ms | 0 - 190 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 87.786 ms | 20 - 1524 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 95.657 ms | 14 - 14 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 171.215 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 126.694 ms | 16 - 3038 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 177.246 ms | 12 - 42 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS9075 | 201.575 ms | 12 - 15 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 101.243 ms | 9 - 1396 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 45.026 ms | 12 - 1312 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 48.595 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 98.363 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 66.345 ms | 11 - 1559 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 209.768 ms | 1 - 1193 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 95.439 ms | 8 - 10 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 101.195 ms | 0 - 1601 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS9075 | 120.536 ms | 12 - 30 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 316.624 ms | 5 - 1574 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA7255P | 209.768 ms | 1 - 1193 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 262.029 ms | 0 - 1210 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 49.203 ms | 11 - 1209 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 109.458 ms | 32 - 1085 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 170.601 ms | 23 - 2317 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 360.275 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 226.445 ms | 33 - 37 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 242.284 ms | 33 - 1114 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS9075 | 294.179 ms | 32 - 109 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 514.248 ms | 0 - 1934 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA7255P | 360.275 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8295P | 373.937 ms | 33 - 1160 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 130.308 ms | 32 - 1113 MB | NPU |
License
- The license for the original implementation of MobileSam can be found here.
References
Community
- Join our AI Hub Slack community to collaborate, post questions and learn more about on-device AI.
- For questions or feedback please reach out to us.
