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.59 ms 4 - 190 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite Mobile 2.889 ms 4 - 188 MB NPU
decoder QNN_DLC float Snapdragon® X2 Elite 3.121 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 5.562 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® X Elite 5.562 ms 16 - 16 MB NPU
decoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 3.723 ms 3 - 214 MB NPU
decoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 5.387 ms 16 - 18 MB NPU
decoder QNN_DLC float Qualcomm® QCS9075 6.744 ms 16 - 34 MB NPU
decoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 10.052 ms 4 - 220 MB NPU
decoder QNN_DLC float Qualcomm® SA8295P 8.161 ms 0 - 194 MB NPU
decoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 2.889 ms 4 - 188 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite Gen 5 Mobile 0.889 ms 1 - 109 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite Mobile 1.024 ms 1 - 90 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X2 Elite 1.351 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X Elite 2.366 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® X Elite 2.366 ms 4 - 4 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Gen 3 Mobile 1.318 ms 4 - 116 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS6490 8.331 ms 3 - 9 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS8550 (Proxy) 1.994 ms 4 - 122 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS9075 2.413 ms 1 - 7 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCM6690 9.402 ms 4 - 275 MB NPU
decoder QNN_DLC w8a8 Qualcomm® QCS8450 (Proxy) 2.588 ms 0 - 110 MB NPU
decoder QNN_DLC w8a8 Qualcomm® SA8295P 2.967 ms 4 - 87 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 8 Elite For Galaxy Mobile 1.024 ms 1 - 90 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 2.52 ms 4 - 211 MB NPU
decoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 2.52 ms 4 - 211 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 87.92 ms 12 - 2381 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite Mobile 101.234 ms 12 - 1703 MB NPU
encoder QNN_DLC float Snapdragon® X2 Elite 95.987 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 171.373 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® X Elite 171.373 ms 12 - 12 MB NPU
encoder QNN_DLC float Snapdragon® 8 Gen 3 Mobile 132.265 ms 12 - 1951 MB NPU
encoder QNN_DLC float Qualcomm® QCS8550 (Proxy) 172.918 ms 12 - 15 MB NPU
encoder QNN_DLC float Qualcomm® QCS9075 227.893 ms 12 - 42 MB NPU
encoder QNN_DLC float Qualcomm® QCS8450 (Proxy) 347.29 ms 12 - 1883 MB NPU
encoder QNN_DLC float Qualcomm® SA8295P 249.585 ms 0 - 1638 MB NPU
encoder QNN_DLC float Snapdragon® 8 Elite For Galaxy Mobile 101.234 ms 12 - 1703 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite Gen 5 Mobile 34.916 ms 3 - 1784 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite Mobile 40.707 ms 3 - 1711 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X2 Elite 42.545 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X Elite 79.823 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® X Elite 79.823 ms 3 - 3 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Gen 3 Mobile 54.151 ms 0 - 2214 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS6490 631.023 ms 3 - 12 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS8550 (Proxy) 76.767 ms 3 - 1385 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS9075 92.959 ms 5 - 14 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCM6690 1229.427 ms 3 - 2709 MB NPU
encoder QNN_DLC w8a8 Qualcomm® QCS8450 (Proxy) 135.488 ms 3 - 2235 MB NPU
encoder QNN_DLC w8a8 Qualcomm® SA8295P 92.316 ms 0 - 1758 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 8 Elite For Galaxy Mobile 40.707 ms 3 - 1711 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 97.937 ms 3 - 2385 MB NPU
encoder QNN_DLC w8a8 Snapdragon® 7 Gen 4 Mobile 97.937 ms 3 - 2385 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