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.51, ONNX Runtime 1.30.0 Download
QNN_DLC float Universal QAIRT 2.51 Download
TFLITE float Universal QAIRT 2.51 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.538 ms 3 - 216 MB NPU
decoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 2.962 ms 1 - 211 MB NPU
decoder ONNX float Snapdragon® X2 Elite 2.602 ms 4 - 4 MB NPU
decoder ONNX float Snapdragon® X Elite 5.959 ms 11 - 11 MB NPU
decoder ONNX float Snapdragon® 8 Gen 3 Mobile 4.149 ms 0 - 243 MB NPU
decoder ONNX float Qualcomm® Dragonwing™ IQ-8275 5.789 ms 4 - 8 MB NPU
decoder ONNX float Qualcomm® Dragonwing™ IQ-9075 6.304 ms 4 - 8 MB NPU
decoder ONNX float Qualcomm® Dragonwing™ IQ-X7181 5.959 ms 11 - 11 MB NPU
decoder ONNX float Qualcomm® Dragonwing™ Q-8750 2.962 ms 1 - 211 MB NPU
decoder ONNX float Snapdragon® 8 Elite Extreme Gen 6 Mobile 2.066 ms 2 - 104 MB NPU
decoder ONNX float Snapdragon® 8 Elite Gen 6 Mobile 3.178 ms 2 - 218 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Gen 5 For Galaxy Mobile 2.509 ms 4 - 208 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 2.939 ms 0 - 201 MB NPU
decoder QNN_DLC float Snapdragon® X2 Elite 3.063 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 6.153 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 3.702 ms 4 - 221 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 1 Mobile 8.919 ms 0 - 210 MB NPU
decoder QNN_DLC float Qualcomm® Dragonwing™ IQ-8275 5.725 ms 4 - 11 MB NPU
decoder QNN_DLC float Qualcomm® Dragonwing™ QCS8550 (Proxy) 5.644 ms 4 - 6 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 8.919 ms 0 - 210 MB NPU
decoder QNN_DLC float Qualcomm® Dragonwing™ IQ-9075 6.359 ms 6 - 13 MB NPU
decoder QNN_DLC float Qualcomm® Dragonwing™ IQ-X7181 6.153 ms 4 - 4 MB NPU
decoder QNN_DLC float Qualcomm® Dragonwing™ Q-8750 2.939 ms 0 - 201 MB NPU
decoder QNN_DLC float Qualcomm® SA8295P 8.427 ms 0 - 185 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Extreme Gen 6 Mobile 2.041 ms 2 - 88 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Gen 6 Mobile 3.14 ms 1 - 198 MB NPU
decoder TFLITE float Snapdragon® 8 Elite Gen 5 For Galaxy Mobile 2.149 ms 0 - 184 MB NPU
decoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 2.475 ms 0 - 188 MB NPU
decoder TFLITE float Snapdragon® 8 Gen 3 Mobile 3.401 ms 0 - 211 MB NPU
decoder TFLITE float Snapdragon® 8 Gen 1 Mobile 7.073 ms 0 - 208 MB NPU
decoder TFLITE float Qualcomm® Dragonwing™ IQ-8275 4.91 ms 0 - 20 MB NPU
decoder TFLITE float Qualcomm® Dragonwing™ QCS8550 (Proxy) 4.749 ms 0 - 3 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.073 ms 0 - 208 MB NPU
decoder TFLITE float Qualcomm® Dragonwing™ IQ-9075 5.397 ms 0 - 20 MB NPU
decoder TFLITE float Qualcomm® Dragonwing™ Q-8750 2.475 ms 0 - 188 MB NPU
decoder TFLITE float Qualcomm® SA7255P 11.398 ms 0 - 182 MB NPU
decoder TFLITE float Qualcomm® SA8295P 6.987 ms 0 - 212 MB NPU
decoder TFLITE float Snapdragon® 8 Elite Extreme Gen 6 Mobile 1.715 ms 0 - 185 MB NPU
decoder TFLITE float Snapdragon® 8 Elite Gen 6 Mobile 2.605 ms 0 - 188 MB NPU
encoder ONNX float Snapdragon® 8 Elite Gen 5 For Galaxy Mobile 345.701 ms 44 - 947 MB NPU
encoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 367.359 ms 90 - 937 MB NPU
encoder ONNX float Snapdragon® X2 Elite 266.273 ms 132 - 132 MB NPU
encoder ONNX float Snapdragon® X Elite 394.605 ms 132 - 132 MB NPU
encoder ONNX float Snapdragon® 8 Gen 3 Mobile 172.741 ms 102 - 1345 MB NPU
encoder ONNX float Qualcomm® Dragonwing™ IQ-8275 245.365 ms 54 - 59 MB NPU
encoder ONNX float Qualcomm® Dragonwing™ IQ-9075 221.811 ms 59 - 63 MB NPU
encoder ONNX float Qualcomm® Dragonwing™ IQ-X7181 394.605 ms 132 - 132 MB NPU
encoder ONNX float Qualcomm® Dragonwing™ Q-8750 367.359 ms 90 - 937 MB NPU
encoder ONNX float Snapdragon® 8 Elite Extreme Gen 6 Mobile 93.162 ms 104 - 899 MB NPU
encoder ONNX float Snapdragon® 8 Elite Gen 6 Mobile 107.724 ms 106 - 687 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Gen 5 For Galaxy Mobile 34.306 ms 12 - 1310 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 48.612 ms 12 - 1214 MB NPU
encoder QNN_DLC float Snapdragon® X2 Elite 37.601 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 89.796 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 79.943 ms 12 - 1647 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 1 Mobile 303.774 ms 12 - 1291 MB NPU
encoder QNN_DLC float Qualcomm® Dragonwing™ IQ-8275 84.175 ms 12 - 31 MB NPU
encoder QNN_DLC float Qualcomm® Dragonwing™ QCS8550 (Proxy) 89.07 ms 12 - 16 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 303.774 ms 12 - 1291 MB NPU
encoder QNN_DLC float Qualcomm® Dragonwing™ IQ-9075 89.993 ms 12 - 30 MB NPU
encoder QNN_DLC float Qualcomm® Dragonwing™ IQ-X7181 89.796 ms 12 - 12 MB NPU
encoder QNN_DLC float Qualcomm® Dragonwing™ Q-8750 48.612 ms 12 - 1214 MB NPU
encoder QNN_DLC float Qualcomm® SA8295P 235.877 ms 0 - 1098 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Extreme Gen 6 Mobile 28.824 ms 12 - 1363 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Gen 6 Mobile 44.875 ms 7 - 1155 MB NPU
encoder TFLITE float Snapdragon® 8 Elite Gen 5 For Galaxy Mobile 402.643 ms 4 - 1799 MB NPU
encoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 435.122 ms 3 - 1210 MB NPU
encoder TFLITE float Snapdragon® 8 Gen 3 Mobile 490.256 ms 74 - 1562 MB NPU
encoder TFLITE float Snapdragon® 8 Gen 1 Mobile 194.572 ms 4 - 1342 MB NPU
encoder TFLITE float Qualcomm® Dragonwing™ IQ-8275 629.96 ms 0 - 50 MB NPU
encoder TFLITE float Qualcomm® Dragonwing™ QCS8550 (Proxy) 620.817 ms 0 - 37 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 194.572 ms 4 - 1342 MB NPU
encoder TFLITE float Qualcomm® Dragonwing™ IQ-9075 588.773 ms 0 - 49 MB NPU
encoder TFLITE float Qualcomm® Dragonwing™ Q-8750 435.122 ms 3 - 1210 MB NPU
encoder TFLITE float Qualcomm® SA7255P 976.008 ms 16 - 42 MB CPU
encoder TFLITE float Qualcomm® SA8295P 238.867 ms 4 - 1104 MB NPU
encoder TFLITE float Snapdragon® 8 Elite Extreme Gen 6 Mobile 31.975 ms 4 - 1434 MB NPU
encoder TFLITE float Snapdragon® 8 Elite Gen 6 Mobile 43.998 ms 4 - 1121 MB NPU

License

  • The license for the original implementation of MobileSam can be found here.

References

Community

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for qualcomm/MobileSam

Quantizations
1 model

Paper for qualcomm/MobileSam