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.635 ms | 209 - 209 MB | NPU |
| decoder | ONNX | float | Snapdragon® X Elite | 6.168 ms | 147 - 147 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.15 ms | 2 - 234 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 14.299 ms | 5 - 225 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 5.917 ms | 0 - 19 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8450 | 14.299 ms | 5 - 225 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Mobile | 3.173 ms | 0 - 234 MB | NPU |
| decoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.531 ms | 3 - 210 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS9075 | 7.129 ms | 4 - 49 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS8750 | 3.173 ms | 0 - 234 MB | NPU |
| decoder | ONNX | float | Qualcomm® QCS7181 | 6.168 ms | 147 - 147 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X2 Elite | 2.97 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® X Elite | 5.722 ms | 4 - 4 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 3.732 ms | 4 - 223 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 11.626 ms | 0 - 251 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8275 | 12.614 ms | 0 - 192 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 5.307 ms | 4 - 132 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8450 | 11.626 ms | 0 - 251 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 2.833 ms | 0 - 225 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA8295P | 7.714 ms | 0 - 190 MB | NPU |
| decoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.526 ms | 4 - 196 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® SA7255P | 12.614 ms | 0 - 192 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS9075 | 6.49 ms | 4 - 10 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS8750 | 2.833 ms | 0 - 225 MB | NPU |
| decoder | QNN_DLC | float | Qualcomm® QCS7181 | 5.722 ms | 4 - 4 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.42 ms | 0 - 214 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 7.991 ms | 0 - 217 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8275 | 11.888 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 4.937 ms | 0 - 8 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8775P | 38.522 ms | 1 - 34 MB | GPU |
| decoder | TFLITE | float | Qualcomm® SA8650P | 38.522 ms | 1 - 34 MB | GPU |
| decoder | TFLITE | float | Qualcomm® SA8255P | 38.522 ms | 1 - 34 MB | GPU |
| decoder | TFLITE | float | Qualcomm® QCS8450 | 7.991 ms | 0 - 217 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 2.591 ms | 0 - 183 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA8295P | 7.261 ms | 0 - 183 MB | NPU |
| decoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.159 ms | 0 - 187 MB | NPU |
| decoder | TFLITE | float | Qualcomm® SA7255P | 11.888 ms | 0 - 186 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS9075 | 5.969 ms | 0 - 19 MB | NPU |
| decoder | TFLITE | float | Qualcomm® QCS8750 | 2.591 ms | 0 - 183 MB | NPU |
| encoder | ONNX | float | Snapdragon® X2 Elite | 91.844 ms | 201 - 201 MB | NPU |
| encoder | ONNX | float | Snapdragon® X Elite | 170.625 ms | 170 - 170 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 125.122 ms | 21 - 1099 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 407.007 ms | 22 - 1118 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8550 (Proxy) | 172.174 ms | 12 - 45 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8450 | 407.007 ms | 22 - 1118 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Mobile | 99.607 ms | 9 - 922 MB | NPU |
| encoder | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 81.662 ms | 8 - 1032 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS9075 | 195.438 ms | 12 - 57 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS8750 | 99.607 ms | 9 - 922 MB | NPU |
| encoder | ONNX | float | Qualcomm® QCS7181 | 170.625 ms | 170 - 170 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X2 Elite | 45.856 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® X Elite | 103.032 ms | 12 - 12 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 65.901 ms | 12 - 1329 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 329.08 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8275 | 207.642 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 99.176 ms | 12 - 891 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8450 | 329.08 ms | 12 - 1342 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 48.69 ms | 12 - 1129 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA8295P | 324.852 ms | 0 - 1556 MB | NPU |
| encoder | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 40.129 ms | 12 - 1260 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® SA7255P | 207.642 ms | 1 - 1126 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS9075 | 120.784 ms | 14 - 32 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS8750 | 48.69 ms | 12 - 1129 MB | NPU |
| encoder | QNN_DLC | float | Qualcomm® QCS7181 | 103.032 ms | 12 - 12 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 165.516 ms | 33 - 2325 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 512.784 ms | 0 - 1933 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8275 | 360.203 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 222.998 ms | 31 - 34 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8775P | 740.89 ms | 0 - 25 MB | CPU |
| encoder | TFLITE | float | Qualcomm® SA8650P | 740.89 ms | 0 - 25 MB | CPU |
| encoder | TFLITE | float | Qualcomm® SA8255P | 740.89 ms | 0 - 25 MB | CPU |
| encoder | TFLITE | float | Qualcomm® QCS8450 | 512.784 ms | 0 - 1933 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Mobile | 128.85 ms | 32 - 1106 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA8295P | 372.611 ms | 34 - 1161 MB | NPU |
| encoder | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 98.436 ms | 32 - 1097 MB | NPU |
| encoder | TFLITE | float | Qualcomm® SA7255P | 360.203 ms | 33 - 1120 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS9075 | 291.604 ms | 32 - 109 MB | NPU |
| encoder | TFLITE | float | Qualcomm® QCS8750 | 128.85 ms | 32 - 1106 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.
