File size: 6,458 Bytes
01a0a41 5727858 01a0a41 fbb96d2 01a0a41 b504f57 01a0a41 f0b3ea8 673bd8a 01a0a41 f0b3ea8 4797e96 f0b3ea8 21b562b f0b3ea8 4797e96 f0b3ea8 4797e96 f0b3ea8 21b562b 94d4192 01a0a41 396f835 94d4192 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 | ---
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-IVA-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/main/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.42, ONNX Runtime 1.24.3 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.50.2/fastsam_x-onnx-float.zip)
| QNN_DLC | float | Universal | QAIRT 2.43 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.50.2/fastsam_x-qnn_dlc-float.zip)
| TFLITE | float | Universal | QAIRT 2.43, TFLite 2.19.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/releases/v0.50.2/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/main/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/main/src/qai_hub_models/models/fastsam_x) for usage instructions.
## Model Details
**Model Type:** Model_use_case.semantic_segmentation
**Model Stats:**
- Model checkpoint: fastsam-x.pt
- Inference latency: RealTime
- Input resolution: 640x640
- Number of parameters: 72.2M
- Model size (float): 276 MB
## Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
|---|---|---|---|---|---|---
| FastSam-X | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 18.211 ms | 15 - 262 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® X2 Elite | 23.872 ms | 139 - 139 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® X Elite | 46.675 ms | 138 - 138 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 36.155 ms | 4 - 333 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® QCS8550 (Proxy) | 46.493 ms | 0 - 166 MB | NPU
| FastSam-X | ONNX | float | Qualcomm® QCS9075 | 73.344 ms | 9 - 17 MB | NPU
| FastSam-X | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 27.544 ms | 10 - 248 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 17.33 ms | 5 - 228 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® X2 Elite | 22.921 ms | 5 - 5 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® X Elite | 43.776 ms | 5 - 5 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 32.763 ms | 5 - 307 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 279.79 ms | 2 - 219 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 43.153 ms | 5 - 16 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8775P | 68.446 ms | 1 - 216 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® QCS9075 | 70.399 ms | 5 - 15 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 91.808 ms | 0 - 393 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA7255P | 279.79 ms | 2 - 219 MB | NPU
| FastSam-X | QNN_DLC | float | Qualcomm® SA8295P | 77.502 ms | 0 - 297 MB | NPU
| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 25.363 ms | 5 - 223 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 16.917 ms | 4 - 269 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 32.545 ms | 4 - 436 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 279.356 ms | 4 - 265 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 42.369 ms | 4 - 40 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8775P | 67.915 ms | 4 - 265 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® QCS9075 | 70.495 ms | 4 - 158 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 93.277 ms | 5 - 525 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA7255P | 279.356 ms | 4 - 265 MB | NPU
| FastSam-X | TFLITE | float | Qualcomm® SA8295P | 76.867 ms | 0 - 339 MB | NPU
| FastSam-X | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 25.025 ms | 4 - 270 MB | NPU
## License
* The license for the original implementation of FastSam-X can be found
[here](https://github.com/CASIA-IVA-Lab/FastSAM/blob/main/LICENSE).
## References
* [Fast Segment Anything](https://arxiv.org/abs/2306.12156)
* [Source Model Implementation](https://github.com/CASIA-IVA-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).
|