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.50, ONNX Runtime 1.27.1 | Download |
| QNN_DLC | float | Universal | QAIRT 2.50 | Download |
| TFLITE | float | Universal | QAIRT 2.50 | 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® 8 Elite Gen 5 For Galaxy Mobile | 2.65 ms | 1 - 214 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.059 ms | 2 - 213 MB | NPU |
| decoder | ONNX | float | Snapdragon® X2 Elite | 2.75 ms | 4 - 4 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.208 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.144 ms | 0 - 243 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 9.469 ms | 5 - 230 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 6.169 ms | 4 - 8 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.842 ms | 0 - 13 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8450 | 9.469 ms | 5 - 230 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 6.754 ms | 4 - 7 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 6.208 ms | 11 - 11 MB | NPU |
| decoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 3.059 ms | 2 - 213 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 2.385 ms | 4 - 193 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.795 ms | 0 - 182 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.802 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.833 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.705 ms | 4 - 220 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 7.583 ms | 0 - 212 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 5.658 ms | 4 - 11 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 5.344 ms | 4 - 18 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8650P | 6.389 ms | 0 - 196 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8255P | 6.389 ms | 0 - 196 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 | 7.583 ms | 0 - 212 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 6.211 ms | 6 - 12 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 5.833 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 2.795 ms | 0 - 182 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.7 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 2.233 ms | 0 - 182 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.605 ms | 0 - 178 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.393 ms | 0 - 209 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 7.23 ms | 0 - 207 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 5.25 ms | 0 - 20 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 4.845 ms | 0 - 17 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8650P | 5.89 ms | 0 - 188 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8255P | 5.89 ms | 0 - 188 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 | 7.23 ms | 0 - 207 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 5.758 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 2.605 ms | 0 - 178 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8295P | 7.191 ms | 0 - 210 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 749.116 ms | 6 - 1245 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 74.715 ms | 8 - 1135 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 433.712 ms | 12 - 12 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 980.171 ms | 18 - 18 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 887.804 ms | 17 - 1422 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 210.449 ms | 20 - 1167 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 1164.38 ms | 12 - 16 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 1143.366 ms | 0 - 22 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8450 | 210.449 ms | 20 - 1167 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 1081.107 ms | 12 - 15 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 980.171 ms | 18 - 18 MB | NPU |
| encoder | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 74.715 ms | 8 - 1135 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 640.208 ms | 0 - 1427 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 678.312 ms | 0 - 1297 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 413.828 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 834.33 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 81.021 ms | 12 - 1644 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 204.136 ms | 10 - 1344 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 983.872 ms | 12 - 31 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 968.952 ms | 12 - 15 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8650P | 100.287 ms | 1 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8255P | 100.287 ms | 1 - 1549 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 | 204.136 ms | 10 - 1344 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 916.19 ms | 12 - 30 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 834.33 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 678.312 ms | 0 - 1297 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 247.644 ms | 0 - 1100 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 499.066 ms | 4 - 1409 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 537.961 ms | 4 - 1315 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 604.699 ms | 0 - 3328 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 269.172 ms | 4 - 1289 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 784.72 ms | 0 - 50 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 768.45 ms | 0 - 4 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8650P | 100.639 ms | 0 - 1665 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8255P | 100.639 ms | 0 - 1665 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 | 269.172 ms | 4 - 1289 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 731.358 ms | 0 - 49 MB | NPU |
| encoder | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 537.961 ms | 4 - 1315 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8295P | 241.465 ms | 4 - 1136 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.
