File size: 11,729 Bytes
01a0a41 5727858 01a0a41 fbb96d2 01a0a41 b504f57 01a0a41 f0b3ea8 673bd8a 01a0a41 4b65a8c c125946 f0b3ea8 c125946 f0b3ea8 c125946 f0b3ea8 c125946 f0b3ea8 c125946 f0b3ea8 c125946 f0b3ea8 c125946 94d4192 01a0a41 396f835 4b65a8c 94d4192 01a0a41 4b65a8c 01a0a41 dc89166 01a0a41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | ---
library_name: pytorch
license: other
tags:
- android
pipeline_tag: image-segmentation
---

# FastSam-X: Optimized for Qualcomm Devices
The Fast Segment Anything Model (FastSAM) is a novel, real-time CNN-based solution for the Segment Anything task. This task is designed to segment any object within an image based on various possible user interaction prompts. The model performs competitively despite significantly reduced computation, making it a practical choice for a variety of vision tasks.
This is based on the implementation of FastSam-X found [here](https://github.com/CASIA-LMC-Lab/FastSAM).
This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/fastsam_x) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) 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.45, ONNX Runtime 1.27.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.60.0/fastsam_x-onnx-float.zip)
| ONNX | w8a16 | Universal | QAIRT 2.45, ONNX Runtime 1.27.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.60.0/fastsam_x-onnx-w8a16.zip)
| QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.60.0/fastsam_x-qnn_dlc-float.zip)
| QNN_DLC | w8a16 | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.60.0/fastsam_x-qnn_dlc-w8a16.zip)
| TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.60.0/fastsam_x-tflite-float.zip)
For more device-specific assets and performance metrics, visit **[FastSam-X on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/fastsam_x)**.
### Option 2: Export with Custom Configurations
Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/fastsam_x) 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 [FastSam-X on GitHub](https://github.com/qualcomm/ai-hub-models/blob/v0.60.0/src/qai_hub_models/models/fastsam_x) for usage instructions.
## Model Details
**Model Type:** Model_use_case.semantic_segmentation
**Model Stats:**
- Inference latency: RealTime
- Input resolution: 640x640
- Model checkpoint: fastsam-x.pt
- Model size (float): 276 MB
- Number of parameters: 72.2M
## Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
|---|---|---|---|---|---|---
| FastSam-X | ONNX | float | Snapdragon® X2 Elite | 24.581 ms | 17 - 17 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® X Elite | 47.017 ms | 140 - 140 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 36.479 ms | 1 - 319 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 100.223 ms | 1 - 400 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 84.659 ms | 5 - 13 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 49.427 ms | 15 - 18 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® QCS8450 | 100.223 ms | 1 - 400 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 72.433 ms | 11 - 19 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 47.017 ms | 140 - 140 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 27.6 ms | 13 - 245 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Elite Mobile | 27.6 ms | 13 - 245 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 20.044 ms | 12 - 265 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® X2 Elite | 15.553 ms | 9 - 9 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® X Elite | 33.689 ms | 71 - 71 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 24.645 ms | 0 - 452 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 1 Mobile | 56.545 ms | 9 - 462 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 183.5 ms | 6 - 11 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 33.821 ms | 6 - 12 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 34.202 ms | 0 - 81 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® QCS8450 | 56.545 ms | 9 - 462 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 31.286 ms | 6 - 11 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 33.689 ms | 71 - 71 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 692.601 ms | 0 - 546 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 61.253 ms | 8 - 431 MB | NPU
| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 19.867 ms | 6 - 364 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite Mobile | 19.867 ms | 6 - 364 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 12.921 ms | 6 - 370 MB | NPU
| FastSam-X | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 61.253 ms | 8 - 431 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® X2 Elite | 23.1 ms | 5 - 5 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® X Elite | 44.037 ms | 5 - 5 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 32.798 ms | 5 - 303 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 91.529 ms | 5 - 389 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 80.408 ms | 5 - 16 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 279.924 ms | 1 - 215 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 43.181 ms | 5 - 7 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8775P | 68.471 ms | 1 - 213 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8650P | 68.471 ms | 1 - 213 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8255P | 68.471 ms | 1 - 213 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® QCS8450 | 91.529 ms | 5 - 389 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 68.265 ms | 5 - 15 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 44.037 ms | 5 - 5 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 25.252 ms | 0 - 221 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA7255P | 279.924 ms | 1 - 215 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8295P | 77.684 ms | 0 - 298 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 25.252 ms | 0 - 221 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 17.981 ms | 1 - 233 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 15.164 ms | 2 - 2 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® X Elite | 31.387 ms | 2 - 2 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 22.319 ms | 2 - 419 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 1 Mobile | 48.903 ms | 2 - 417 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 178.827 ms | 2 - 8 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 30.656 ms | 2 - 9 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 86.223 ms | 1 - 320 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 31.329 ms | 2 - 5 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8775P | 28.445 ms | 0 - 322 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8650P | 28.445 ms | 0 - 322 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8255P | 28.445 ms | 0 - 322 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® QCS8450 | 48.903 ms | 2 - 417 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 31.742 ms | 1 - 7 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 31.387 ms | 2 - 2 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 655.926 ms | 3 - 481 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 53.476 ms | 2 - 398 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 18.238 ms | 2 - 332 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA7255P | 86.223 ms | 1 - 320 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8295P | 45.07 ms | 0 - 319 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite Mobile | 18.238 ms | 2 - 332 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 12.218 ms | 2 - 333 MB | NPU
| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 53.476 ms | 2 - 398 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 32.55 ms | 3 - 417 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 94.487 ms | 5 - 506 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 80.236 ms | 4 - 159 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 279.398 ms | 5 - 257 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 43.235 ms | 4 - 7 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8775P | 67.958 ms | 5 - 258 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8650P | 67.958 ms | 5 - 258 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8255P | 67.958 ms | 5 - 258 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® QCS8450 | 94.487 ms | 5 - 506 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 67.971 ms | 4 - 158 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 25.727 ms | 4 - 263 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA7255P | 279.398 ms | 5 - 257 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8295P | 77.149 ms | 5 - 335 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Elite Mobile | 25.727 ms | 4 - 263 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 17.404 ms | 0 - 262 MB | NPU
## License
* The license for the original implementation of FastSam-X can be found
[here](https://github.com/CASIA-LMC-Lab/FastSAM/blob/main/LICENSE).
## References
* [Fast Segment Anything](https://arxiv.org/abs/2306.12156)
* [Source Model Implementation](https://github.com/CASIA-LMC-Lab/FastSAM)
## Community
* Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
* For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
|