Segment-Anything-Model-2: Optimized for Qualcomm Devices

SAM 2, the successor to Meta's Segment Anything Model (SAM), is a cutting-edge tool designed for comprehensive object segmentation in both images and videos. It excels in handling complex visual data through a unified, promptable model architecture that supports real-time processing and zero-shot generalization.

This is based on the implementation of Segment-Anything-Model-2 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
QNN_DLC float Universal QAIRT 2.45 Download
QNN_DLC w8a8 Universal QAIRT 2.45 Download

For more device-specific assets and performance metrics, visit Segment-Anything-Model-2 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 Segment-Anything-Model-2 on GitHub for usage instructions.

Model Details

Model Type: Model_use_case.semantic_segmentation

Model Stats:

  • Model checkpoint: sam2.1_hiera_t
  • Input resolution: 720p (720x1280)
  • Number of parameters (encoder): 33.5M
  • Model size (encoder) (float): 128 MB
  • Number of parameters (decoder): 6.22M
  • Model size (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 3.153 ms 17 - 245 MB NPU
decoder ONNX float Snapdragon® 8 Gen 3 Mobile 4.754 ms 1 - 314 MB NPU
decoder ONNX float Qualcomm® QCS8550 (Proxy) 6.794 ms 16 - 23 MB NPU
decoder ONNX float Qualcomm® QCS9075 8.445 ms 16 - 19 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 2.609 ms 4 - 190 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Mobile 2.894 ms 4 - 186 MB NPU
decoder QNN_DLC float Snapdragon® X2 Elite 3.066 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 5.508 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 5.508 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 3.724 ms 4 - 213 MB NPU
decoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 5.328 ms 16 - 18 MB NPU
decoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 10.001 ms 4 - 218 MB NPU
decoder QNN_DLC float Qualcomm® SA8295P 8.186 ms 1 - 194 MB NPU
decoder QNN_DLC float Qualcomm® QCS9075 6.743 ms 16 - 34 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 2.894 ms 4 - 186 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite Gen 5 Mobile 0.89 ms 1 - 109 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite Mobile 1.012 ms 1 - 90 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X2 Elite 1.36 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X Elite 2.273 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X Elite 2.273 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Gen 3 Mobile 1.292 ms 0 - 107 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS6490 8.961 ms 3 - 9 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS8550 (Proxy) 2.017 ms 4 - 19 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite For Galaxy Mobile 1.012 ms 1 - 90 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS8450 (Proxy) 2.551 ms 0 - 109 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 2.684 ms 4 - 214 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCM6690 9.916 ms 4 - 272 MB NPU
decoder QNN_DLC w8a8 Qualcomm® SA8295P 2.978 ms 4 - 87 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS9075 2.407 ms 0 - 6 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 2.684 ms 4 - 214 MB NPU
encoder ONNX float Snapdragon® 8 Elite Gen 5 Mobile 79.657 ms 2 - 2223 MB NPU
encoder ONNX float Snapdragon® 8 Gen 3 Mobile 119.374 ms 1 - 1920 MB NPU
encoder ONNX float Qualcomm® QCS8550 (Proxy) 162.471 ms 0 - 99 MB NPU
encoder ONNX float Qualcomm® QCS9075 217.885 ms 12 - 27 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Gen 5 Mobile 83.761 ms 12 - 2384 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Mobile 97.831 ms 0 - 1690 MB NPU
encoder QNN_DLC float Snapdragon® X2 Elite 96.044 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 170.496 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 170.496 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 134.146 ms 12 - 1955 MB NPU
encoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 177.293 ms 8 - 14 MB NPU
encoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 343.674 ms 13 - 1882 MB NPU
encoder QNN_DLC float Qualcomm® SA8295P 249.633 ms 0 - 1638 MB NPU
encoder QNN_DLC float Qualcomm® QCS9075 229.033 ms 12 - 42 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 97.831 ms 0 - 1690 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite Gen 5 Mobile 35.091 ms 3 - 1782 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite Mobile 40.08 ms 3 - 1711 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X2 Elite 42.762 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X Elite 79.792 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X Elite 79.792 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Gen 3 Mobile 54.566 ms 3 - 2221 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS6490 632.146 ms 3 - 12 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS8550 (Proxy) 76.587 ms 3 - 6 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite For Galaxy Mobile 40.08 ms 3 - 1711 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS8450 (Proxy) 136.051 ms 3 - 2227 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 99.819 ms 3 - 2384 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCM6690 1251.26 ms 3 - 2713 MB NPU
encoder QNN_DLC w8a8 Qualcomm® SA8295P 92.435 ms 1 - 1759 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS9075 93.249 ms 3 - 12 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 99.819 ms 3 - 2384 MB NPU

License

  • The license for the original implementation of Segment-Anything-Model-2 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

Paper for qualcomm/Segment-Anything-Model-2