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.27.1 | 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:
- Input resolution: 720p (720x1280)
- Model checkpoint: vit_t
- Model size (sam_decoder) (float): 23.7 MB
- Model size (sam_encoder) (float): 26.6 MB
- Number of parameters (sam_decoder): 6.16M
- Number of parameters (sam_encoder): 6.95M
Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |
|---|---|---|---|---|---|---|
| decoder | ONNX | float | Snapdragon® X2 Elite | 2.631 ms | 4 - 4 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.205 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.046 ms | 0 - 270 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 14.679 ms | 5 - 235 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 6.285 ms | 4 - 8 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.902 ms | 4 - 149 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8450 | 14.679 ms | 5 - 235 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 6.896 ms | 4 - 7 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 6.205 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 3.2 ms | 2 - 236 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Mobile | 3.2 ms | 2 - 236 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.536 ms | 4 - 217 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.929 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.933 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.768 ms | 4 - 221 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 11.738 ms | 0 - 220 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 5.763 ms | 4 - 11 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 12.753 ms | 1 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.462 ms | 4 - 6 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8775P | 6.377 ms | 0 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8650P | 6.377 ms | 0 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8255P | 6.377 ms | 0 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 | 11.738 ms | 0 - 220 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 6.208 ms | 4 - 10 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 5.933 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 2.859 ms | 4 - 226 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA7255P | 12.753 ms | 1 - 193 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.824 ms | 0 - 195 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 2.859 ms | 4 - 226 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.57 ms | 4 - 193 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.456 ms | 0 - 211 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 8.327 ms | 0 - 213 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 5.35 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 11.819 ms | 0 - 185 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 4.993 ms | 0 - 13 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 5.865 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8650P | 5.865 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8255P | 5.865 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 | 8.327 ms | 0 - 213 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 5.694 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 2.612 ms | 0 - 184 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA7255P | 11.819 ms | 0 - 185 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 2.612 ms | 0 - 184 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.197 ms | 0 - 184 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 58.844 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 116.8 ms | 13 - 13 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 82.792 ms | 61 - 1181 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 328.543 ms | 20 - 1188 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 111.548 ms | 12 - 16 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 117.242 ms | 12 - 30 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8450 | 328.543 ms | 20 - 1188 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 121.741 ms | 12 - 15 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 116.8 ms | 13 - 13 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 62.301 ms | 9 - 929 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Mobile | 62.301 ms | 9 - 929 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 52.463 ms | 8 - 1027 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 45.903 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 102.849 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 66.12 ms | 0 - 1315 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 328.88 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 91.963 ms | 12 - 30 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 207.594 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 100.663 ms | 12 - 15 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8775P | 100.335 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8650P | 100.335 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8255P | 100.335 ms | 0 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 | 328.88 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 101.207 ms | 14 - 32 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 102.849 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 49.202 ms | 10 - 1125 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA7255P | 207.594 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 324.884 ms | 0 - 1556 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 49.202 ms | 10 - 1125 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 40.35 ms | 11 - 1258 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 66.668 ms | 3 - 3193 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 310.589 ms | 4 - 1362 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 86.395 ms | 0 - 47 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 196.915 ms | 4 - 1633 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 90.801 ms | 4 - 8 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 100.654 ms | 0 - 1666 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8650P | 100.654 ms | 0 - 1666 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8255P | 100.654 ms | 0 - 1666 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 | 310.589 ms | 4 - 1362 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 101.13 ms | 0 - 45 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 47.785 ms | 2 - 1631 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA7255P | 196.915 ms | 4 - 1633 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 47.785 ms | 2 - 1631 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 39.872 ms | 3 - 1795 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.
