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.622 ms | 0 - 244 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Mobile | 3.134 ms | 0 - 234 MB | NPU |
| decoder | ONNX | float | Snapdragon® X2 Elite | 2.686 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.359 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.359 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.146 ms | 0 - 263 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 5.972 ms | 0 - 15 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.134 ms | 0 - 234 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS9075 | 7.345 ms | 4 - 7 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.535 ms | 3 - 192 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 2.856 ms | 0 - 190 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.991 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.708 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.708 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.704 ms | 4 - 225 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 5.327 ms | 4 - 6 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 6.228 ms | 1 - 192 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 6.228 ms | 1 - 192 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 6.228 ms | 1 - 192 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA7255P | 12.586 ms | 1 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.7 ms | 0 - 195 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.856 ms | 0 - 190 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS9075 | 6.363 ms | 4 - 10 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 11.541 ms | 0 - 224 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.145 ms | 0 - 192 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 2.592 ms | 0 - 189 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.41 ms | 0 - 210 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 4.967 ms | 0 - 8 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 5.93 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 5.93 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 5.93 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA7255P | 11.877 ms | 0 - 185 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8295P | 7.262 ms | 0 - 183 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.592 ms | 0 - 189 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS9075 | 5.954 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 8.045 ms | 0 - 217 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 80.351 ms | 20 - 1519 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Mobile | 96.875 ms | 8 - 1394 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 101.697 ms | 14 - 14 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 167.909 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 167.909 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 120.888 ms | 20 - 3034 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 171.47 ms | 12 - 32 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 96.875 ms | 8 - 1394 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS9075 | 198.958 ms | 12 - 15 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 41.397 ms | 12 - 1244 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 48.646 ms | 10 - 1124 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 45.794 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 102.913 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 102.913 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 65.629 ms | 0 - 1317 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 99.402 ms | 10 - 13 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 100.321 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 100.321 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 100.321 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA7255P | 207.539 ms | 1 - 1127 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 325.068 ms | 0 - 1556 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 48.646 ms | 10 - 1124 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS9075 | 120.717 ms | 14 - 32 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 329.911 ms | 12 - 1342 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 109.604 ms | 32 - 1086 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 129.101 ms | 25 - 1105 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 166.461 ms | 33 - 2313 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 218.803 ms | 38 - 42 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 242.262 ms | 34 - 1115 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 242.262 ms | 34 - 1115 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 242.262 ms | 34 - 1115 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA7255P | 377.475 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8295P | 372.998 ms | 22 - 1145 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 129.101 ms | 25 - 1105 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS9075 | 299.389 ms | 32 - 109 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 537.18 ms | 0 - 1926 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.
