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.1 | Download |
| QNN_DLC | float | Universal | QAIRT 2.43 | Download |
| TFLITE | float | Universal | QAIRT 2.43, TFLite 2.17.0 | 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 (SAMEncoder): 6.95M
- Model size (SAMEncoder) (float): 26.6 MB
- Number of parameters (SAMDecoder): 6.16M
- Model size (SAMDecoder) (float): 23.7 MB
Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |
|---|---|---|---|---|---|---|
| MobileSAMDecoder | ONNX | float | Snapdragon® X Elite | 7.515 ms | 11 - 11 MB | NPU |
| MobileSAMDecoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.916 ms | 5 - 263 MB | NPU |
| MobileSAMDecoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 7.013 ms | 0 - 15 MB | NPU |
| MobileSAMDecoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.65 ms | 4 - 226 MB | NPU |
| MobileSAMDecoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.89 ms | 0 - 232 MB | NPU |
| MobileSAMDecoder | ONNX | float | Snapdragon® X2 Elite | 2.951 ms | 11 - 11 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Snapdragon® X Elite | 5.286 ms | 4 - 4 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.36 ms | 4 - 232 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 11.687 ms | 1 - 198 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 4.86 ms | 4 - 36 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® SA8775P | 5.887 ms | 0 - 200 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 8.484 ms | 0 - 220 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® SA7255P | 11.687 ms | 1 - 198 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Qualcomm® SA8295P | 7.197 ms | 0 - 193 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.595 ms | 0 - 198 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.154 ms | 3 - 202 MB | NPU |
| MobileSAMDecoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.662 ms | 4 - 4 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.875 ms | 0 - 235 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 13.024 ms | 0 - 203 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 5.6 ms | 0 - 26 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® SA8775P | 6.7 ms | 0 - 204 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 9.491 ms | 0 - 225 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® SA7255P | 13.024 ms | 0 - 203 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Qualcomm® SA8295P | 8.115 ms | 0 - 201 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.955 ms | 0 - 205 MB | NPU |
| MobileSAMDecoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.353 ms | 0 - 206 MB | NPU |
| MobileSAMEncoder | ONNX | float | Snapdragon® X Elite | 172.158 ms | 12 - 12 MB | NPU |
| MobileSAMEncoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 125.387 ms | 20 - 3042 MB | NPU |
| MobileSAMEncoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 175.157 ms | 12 - 31 MB | NPU |
| MobileSAMEncoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 102.261 ms | 9 - 1390 MB | NPU |
| MobileSAMEncoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 83.472 ms | 20 - 1524 MB | NPU |
| MobileSAMEncoder | ONNX | float | Snapdragon® X2 Elite | 94.261 ms | 14 - 14 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Snapdragon® X Elite | 100.191 ms | 12 - 12 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 66.146 ms | 12 - 1636 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 209.193 ms | 0 - 1209 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 96.518 ms | 13 - 15 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® SA8775P | 103.049 ms | 0 - 1209 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 470.295 ms | 13 - 1732 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® SA7255P | 209.193 ms | 0 - 1209 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Qualcomm® SA8295P | 474.267 ms | 0 - 1248 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 49.845 ms | 12 - 1217 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 48.339 ms | 10 - 1323 MB | NPU |
| MobileSAMEncoder | QNN_DLC | float | Snapdragon® X2 Elite | 51.495 ms | 12 - 12 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 127.145 ms | 2 - 1509 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 295.631 ms | 4 - 1269 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 175.109 ms | 4 - 8 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® SA8775P | 180.289 ms | 4 - 1269 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 584.211 ms | 0 - 3174 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® SA7255P | 295.631 ms | 4 - 1269 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Qualcomm® SA8295P | 502.945 ms | 4 - 1893 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 95.905 ms | 3 - 1261 MB | NPU |
| MobileSAMEncoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 78.087 ms | 4 - 1349 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.
