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.45, ONNX Runtime 1.25.0 | 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® X2 Elite | 2.638 ms | 4 - 4 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.168 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.144 ms | 5 - 245 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 14.332 ms | 5 - 233 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.913 ms | 0 - 14 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8450 | 14.332 ms | 5 - 233 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 6.815 ms | 4 - 7 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.536 ms | 2 - 213 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Mobile | 3.184 ms | 1 - 235 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 3.184 ms | 1 - 235 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 6.168 ms | 11 - 11 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.964 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.704 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.734 ms | 4 - 225 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 11.619 ms | 0 - 252 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8275 | 12.566 ms | 0 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.279 ms | 4 - 109 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 6.257 ms | 0 - 194 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8650P | 6.257 ms | 0 - 194 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8255P | 6.257 ms | 0 - 194 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 | 11.619 ms | 0 - 252 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 6.062 ms | 4 - 10 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.539 ms | 4 - 196 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA7255P | 12.566 ms | 0 - 193 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 2.832 ms | 0 - 224 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.717 ms | 0 - 195 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 2.832 ms | 0 - 224 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 5.704 ms | 4 - 4 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.405 ms | 0 - 212 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 7.99 ms | 0 - 218 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8275 | 11.867 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 4.945 ms | 0 - 7 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 5.929 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8650P | 5.929 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8255P | 5.929 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 | 7.99 ms | 0 - 218 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 5.716 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.16 ms | 0 - 185 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA7255P | 11.867 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 2.588 ms | 0 - 183 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8295P | 7.25 ms | 0 - 183 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 2.588 ms | 0 - 183 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 91.725 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 166.555 ms | 14 - 14 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 125.57 ms | 12 - 1102 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 411.144 ms | 13 - 1119 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 177.059 ms | 12 - 16 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8450 | 411.144 ms | 13 - 1119 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 178.482 ms | 12 - 15 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 81.762 ms | 8 - 1033 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Mobile | 98.908 ms | 8 - 919 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 98.908 ms | 8 - 919 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 166.555 ms | 14 - 14 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 45.919 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 102.883 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 66.157 ms | 0 - 1317 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 327.581 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8275 | 207.441 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 100.844 ms | 12 - 15 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 100.324 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8650P | 100.324 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8255P | 100.324 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 | 327.581 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 101.248 ms | 12 - 30 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 40.255 ms | 0 - 1248 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA7255P | 207.441 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 49.634 ms | 0 - 1119 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 324.885 ms | 1 - 1557 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 49.634 ms | 0 - 1119 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 102.883 ms | 12 - 12 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 172.777 ms | 33 - 2313 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 518.348 ms | 0 - 1941 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8275 | 358.191 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 223.083 ms | 33 - 37 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 242.001 ms | 34 - 1114 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8650P | 242.001 ms | 34 - 1114 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8255P | 242.001 ms | 34 - 1114 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 | 518.348 ms | 0 - 1941 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 246.161 ms | 32 - 109 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 96.851 ms | 32 - 1095 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA7255P | 358.191 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 129.438 ms | 32 - 1113 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8295P | 371.6 ms | 34 - 1161 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 129.438 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.
