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.42, 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® 8 Elite Gen 5 Mobile 2.622 ms 2 - 238 MB NPU
decoder ONNX float Snapdragon® X2 Elite 2.692 ms 208 - 208 MB NPU
decoder ONNX float Snapdragon® X Elite 6.197 ms 149 - 149 MB NPU
decoder ONNX float Snapdragon® 8 Gen 3 Mobile 4.172 ms 0 - 260 MB NPU
decoder ONNX float Qualcomm® QCS8550 (Proxy) 5.929 ms 0 - 41 MB NPU
decoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 3.133 ms 0 - 234 MB NPU
decoder ONNX float Qualcomm® QCS9075 7.279 ms 4 - 49 MB NPU
decoder ONNX float Qualcomm® QCS8750 3.133 ms 0 - 234 MB NPU
decoder ONNX float Qualcomm® QCS7181 6.197 ms 149 - 149 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 2.528 ms 4 - 194 MB NPU
decoder QNN_DLC float Snapdragon® X2 Elite 3.033 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 6.674 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 4.532 ms 4 - 222 MB NPU
decoder QNN_DLC float Qualcomm® QCS8275 13.911 ms 2 - 194 MB NPU
decoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 6.312 ms 4 - 6 MB NPU
decoder QNN_DLC float Qualcomm® SA8775P 7.26 ms 1 - 195 MB NPU
decoder QNN_DLC float Qualcomm® SA8650P 7.26 ms 1 - 195 MB NPU
decoder QNN_DLC float Qualcomm® SA8255P 7.26 ms 1 - 195 MB NPU
decoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 10.89 ms 0 - 225 MB NPU
decoder QNN_DLC float Qualcomm® SA7255P 13.911 ms 2 - 194 MB NPU
decoder QNN_DLC float Qualcomm® SA8295P 9.245 ms 0 - 195 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 2.996 ms 0 - 190 MB NPU
decoder QNN_DLC float Qualcomm® QCS9075 6.858 ms 4 - 10 MB NPU
decoder QNN_DLC float Qualcomm® QCS8750 2.996 ms 0 - 190 MB NPU
decoder QNN_DLC float Qualcomm® QCS7181 6.674 ms 4 - 4 MB NPU
decoder TFLITE float Snapdragon® 8 Elite Gen 5 Mobile 2.142 ms 0 - 192 MB NPU
decoder TFLITE float Snapdragon® 8 Gen 3 Mobile 3.403 ms 0 - 212 MB NPU
decoder TFLITE float Qualcomm® QCS8275 11.88 ms 0 - 186 MB NPU
decoder TFLITE float Qualcomm® QCS8550 (Proxy) 4.967 ms 0 - 18 MB NPU
decoder TFLITE float Qualcomm® SA8775P 5.944 ms 0 - 188 MB NPU
decoder TFLITE float Qualcomm® SA8650P 5.944 ms 0 - 188 MB NPU
decoder TFLITE float Qualcomm® SA8255P 5.944 ms 0 - 188 MB NPU
decoder TFLITE float Qualcomm® QCS8450 (Proxy) 8.009 ms 0 - 218 MB NPU
decoder TFLITE float Qualcomm® SA7255P 11.88 ms 0 - 186 MB NPU
decoder TFLITE float Qualcomm® SA8295P 7.272 ms 1 - 183 MB NPU
decoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 2.595 ms 0 - 184 MB NPU
decoder TFLITE float Qualcomm® QCS9075 5.902 ms 0 - 19 MB NPU
decoder TFLITE float Qualcomm® QCS8750 2.595 ms 0 - 184 MB NPU
encoder ONNX float Snapdragon® 8 Elite Gen 5 Mobile 87.726 ms 20 - 1015 MB NPU
encoder ONNX float Snapdragon® X2 Elite 93.916 ms 201 - 201 MB NPU
encoder ONNX float Snapdragon® X Elite 170.109 ms 169 - 169 MB NPU
encoder ONNX float Snapdragon® 8 Gen 3 Mobile 125.651 ms 21 - 1193 MB NPU
encoder ONNX float Qualcomm® QCS8550 (Proxy) 175.807 ms 12 - 29 MB NPU
encoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 105.399 ms 8 - 1521 MB NPU
encoder ONNX float Qualcomm® QCS9075 199.5 ms 12 - 57 MB NPU
encoder ONNX float Qualcomm® QCS8750 105.399 ms 8 - 1521 MB NPU
encoder ONNX float Qualcomm® QCS7181 170.109 ms 169 - 169 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 41.597 ms 12 - 1244 MB NPU
encoder QNN_DLC float Snapdragon® X2 Elite 45.742 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 103.635 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 66.235 ms 12 - 1331 MB NPU
encoder QNN_DLC float Qualcomm® QCS8275 207.678 ms 2 - 1126 MB NPU
encoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 100.871 ms 12 - 481 MB NPU
encoder QNN_DLC float Qualcomm® SA8775P 100.273 ms 1 - 1550 MB NPU
encoder QNN_DLC float Qualcomm® SA8650P 100.273 ms 1 - 1550 MB NPU
encoder QNN_DLC float Qualcomm® SA8255P 100.273 ms 1 - 1550 MB NPU
encoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 328.932 ms 12 - 1342 MB NPU
encoder QNN_DLC float Qualcomm® SA7255P 207.678 ms 2 - 1126 MB NPU
encoder QNN_DLC float Qualcomm® SA8295P 325.055 ms 0 - 1556 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 48.691 ms 12 - 1127 MB NPU
encoder QNN_DLC float Qualcomm® QCS9075 121.179 ms 12 - 30 MB NPU
encoder QNN_DLC float Qualcomm® QCS8750 48.691 ms 12 - 1127 MB NPU
encoder QNN_DLC float Qualcomm® QCS7181 103.635 ms 12 - 12 MB NPU
encoder TFLITE float Snapdragon® 8 Elite Gen 5 Mobile 94.193 ms 32 - 1086 MB NPU
encoder TFLITE float Snapdragon® 8 Gen 3 Mobile 168.241 ms 24 - 2313 MB NPU
encoder TFLITE float Qualcomm® QCS8275 364.551 ms 33 - 1119 MB NPU
encoder TFLITE float Qualcomm® QCS8550 (Proxy) 221.19 ms 34 - 38 MB NPU
encoder TFLITE float Qualcomm® SA8775P 241.191 ms 21 - 1102 MB NPU
encoder TFLITE float Qualcomm® SA8650P 241.191 ms 21 - 1102 MB NPU
encoder TFLITE float Qualcomm® SA8255P 241.191 ms 21 - 1102 MB NPU
encoder TFLITE float Qualcomm® QCS8450 (Proxy) 520.217 ms 0 - 1935 MB NPU
encoder TFLITE float Qualcomm® SA7255P 364.551 ms 33 - 1119 MB NPU
encoder TFLITE float Qualcomm® SA8295P 372.359 ms 34 - 1161 MB NPU
encoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 131.397 ms 33 - 1107 MB NPU
encoder TFLITE float Qualcomm® QCS9075 293.282 ms 32 - 109 MB NPU
encoder TFLITE float Qualcomm® QCS8750 131.397 ms 33 - 1107 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