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.24.3 Download
QNN_DLC float Universal QAIRT 2.43 Download
TFLITE float Universal QAIRT 2.43, TFLite 2.19.1 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.948 ms 0 - 243 MB NPU
decoder ONNX float Snapdragon® X2 Elite 3.023 ms 11 - 11 MB NPU
decoder ONNX float Snapdragon® X Elite 7.621 ms 11 - 11 MB NPU
decoder ONNX float Snapdragon® 8 Gen 3 Mobile 5.008 ms 5 - 350 MB NPU
decoder ONNX float Qualcomm® QCS8550 (Proxy) 7.11 ms 0 - 15 MB NPU
decoder ONNX float Qualcomm® QCS9075 8.436 ms 4 - 7 MB NPU
decoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 3.655 ms 0 - 222 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 2.379 ms 3 - 203 MB NPU
decoder QNN_DLC float Snapdragon® X2 Elite 2.849 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 5.973 ms 4 - 4 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 3.844 ms 0 - 311 MB NPU
decoder QNN_DLC float Qualcomm® QCS8275 (Proxy) 12.991 ms 1 - 283 MB NPU
decoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 5.527 ms 4 - 6 MB NPU
decoder QNN_DLC float Qualcomm® SA8775P 6.478 ms 0 - 284 MB NPU
decoder QNN_DLC float Qualcomm® QCS9075 6.913 ms 4 - 10 MB NPU
decoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 9.63 ms 2 - 227 MB NPU
decoder QNN_DLC float Qualcomm® SA7255P 12.991 ms 1 - 283 MB NPU
decoder QNN_DLC float Qualcomm® SA8295P 8.029 ms 0 - 196 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 2.801 ms 0 - 267 MB NPU
decoder TFLITE float Snapdragon® 8 Elite Gen 5 Mobile 2.387 ms 0 - 206 MB NPU
decoder TFLITE float Snapdragon® 8 Gen 3 Mobile 3.904 ms 0 - 237 MB NPU
decoder TFLITE float Qualcomm® QCS8275 (Proxy) 13.052 ms 0 - 201 MB NPU
decoder TFLITE float Qualcomm® QCS8550 (Proxy) 5.649 ms 0 - 8 MB NPU
decoder TFLITE float Qualcomm® SA8775P 6.692 ms 0 - 203 MB NPU
decoder TFLITE float Qualcomm® QCS9075 6.943 ms 0 - 19 MB NPU
decoder TFLITE float Qualcomm® QCS8450 (Proxy) 9.518 ms 0 - 224 MB NPU
decoder TFLITE float Qualcomm® SA7255P 13.052 ms 0 - 201 MB NPU
decoder TFLITE float Qualcomm® SA8295P 8.088 ms 0 - 200 MB NPU
decoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 2.939 ms 0 - 205 MB NPU
encoder ONNX float Snapdragon® 8 Elite Gen 5 Mobile 84.094 ms 20 - 1522 MB NPU
encoder ONNX float Snapdragon® X2 Elite 96.11 ms 14 - 14 MB NPU
encoder ONNX float Snapdragon® X Elite 172.164 ms 12 - 12 MB NPU
encoder ONNX float Snapdragon® 8 Gen 3 Mobile 125.916 ms 20 - 3043 MB NPU
encoder ONNX float Qualcomm® QCS8550 (Proxy) 177.901 ms 12 - 40 MB NPU
encoder ONNX float Qualcomm® QCS9075 200.498 ms 12 - 15 MB NPU
encoder ONNX float Snapdragon® 8 Elite For Galaxy Mobile 100.485 ms 9 - 1390 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 48.926 ms 12 - 1324 MB NPU
encoder QNN_DLC float Snapdragon® X2 Elite 51.713 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 100.189 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 66.047 ms 10 - 1628 MB NPU
encoder QNN_DLC float Qualcomm® QCS8275 (Proxy) 209.31 ms 0 - 1210 MB NPU
encoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 97.222 ms 12 - 15 MB NPU
encoder QNN_DLC float Qualcomm® SA8775P 103.074 ms 1 - 1209 MB NPU
encoder QNN_DLC float Qualcomm® QCS9075 121.864 ms 12 - 30 MB NPU
encoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 469.913 ms 11 - 1740 MB NPU
encoder QNN_DLC float Qualcomm® SA7255P 209.31 ms 0 - 1210 MB NPU
encoder QNN_DLC float Qualcomm® SA8295P 474.209 ms 0 - 1258 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 49.637 ms 12 - 1215 MB NPU
encoder TFLITE float Snapdragon® 8 Elite Gen 5 Mobile 104.259 ms 32 - 1233 MB NPU
encoder TFLITE float Snapdragon® 8 Gen 3 Mobile 167.58 ms 17 - 1923 MB NPU
encoder TFLITE float Qualcomm® QCS8275 (Proxy) 360.435 ms 29 - 1180 MB NPU
encoder TFLITE float Qualcomm® QCS8550 (Proxy) 216.954 ms 33 - 37 MB NPU
encoder TFLITE float Qualcomm® SA8775P 240.406 ms 33 - 1227 MB NPU
encoder TFLITE float Qualcomm® QCS9075 289.564 ms 32 - 109 MB NPU
encoder TFLITE float Qualcomm® QCS8450 (Proxy) 670.636 ms 23 - 2068 MB NPU
encoder TFLITE float Qualcomm® SA7255P 360.435 ms 29 - 1180 MB NPU
encoder TFLITE float Qualcomm® SA8295P 523.394 ms 19 - 1181 MB NPU
encoder TFLITE float Snapdragon® 8 Elite For Galaxy Mobile 131.152 ms 32 - 1235 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