qualcomm/FastSam-X
111.8k
1---2library_name: pytorch3license: agpl-3.04tags:5- android6pipeline_tag: image-segmentation7 8---9 1011 12# FastSam-X: Optimized for Qualcomm Devices13 14The 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.15 16This is based on the implementation of FastSam-X found [here](https://github.com/CASIA-LMC-Lab/FastSAM).17This 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.63.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).18 19Qualcomm 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.20 21## Getting Started22Due to licensing restrictions, we cannot distribute pre-exported model assets for this model.23Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.63.0/src/qai_hub_models/models/fastsam_x) Python library to compile and export the model with your own:24- Custom weights (e.g., fine-tuned checkpoints)25- Custom input shapes26- Target device and runtime configurations27 28See our repository for [FastSam-X on GitHub](https://github.com/qualcomm/ai-hub-models/blob/v0.63.0/src/qai_hub_models/models/fastsam_x) for usage instructions.29 30 31## Model Details32 33**Model Type:** Model_use_case.semantic_segmentation34 35**Model Stats:**36- Inference latency: RealTime37- Input resolution: 640x64038- Model checkpoint: fastsam-x.pt39- Model size (float): 276 MB40- Number of parameters: 72.2M41 42## Performance Summary43| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit44|---|---|---|---|---|---|---45| FastSam-X | ONNX | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 18.493 ms | 13 - 253 MB | NPU46| FastSam-X | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 26.058 ms | 13 - 235 MB | NPU47| FastSam-X | ONNX | float | Snapdragon® X2 Elite | 23.662 ms | 17 - 17 MB | NPU48| FastSam-X | ONNX | float | Snapdragon® X Elite | 44.703 ms | 140 - 140 MB | NPU49| FastSam-X | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 33.662 ms | 17 - 323 MB | NPU50| FastSam-X | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 87.074 ms | 17 - 408 MB | NPU51| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 81.853 ms | 5 - 14 MB | NPU52| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 44.315 ms | 0 - 612 MB | NPU53| FastSam-X | ONNX | float | Qualcomm® QCS8450 | 87.074 ms | 17 - 408 MB | NPU54| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 70.394 ms | 12 - 20 MB | NPU55| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 44.703 ms | 140 - 140 MB | NPU56| FastSam-X | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 26.058 ms | 13 - 235 MB | NPU57| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 13.599 ms | 6 - 358 MB | NPU58| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 19.247 ms | 6 - 348 MB | NPU59| FastSam-X | ONNX | w8a16 | Snapdragon® X2 Elite | 14.729 ms | 9 - 9 MB | NPU60| FastSam-X | ONNX | w8a16 | Snapdragon® X Elite | 31.022 ms | 71 - 71 MB | NPU61| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 21.375 ms | 2 - 438 MB | NPU62| FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 1 Mobile | 45.905 ms | 0 - 439 MB | NPU63| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 152.763 ms | 6 - 12 MB | NPU64| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 30.06 ms | 6 - 12 MB | NPU65| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 30.863 ms | 0 - 80 MB | NPU66| FastSam-X | ONNX | w8a16 | Qualcomm® QCS8450 | 45.905 ms | 0 - 439 MB | NPU67| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 29.836 ms | 6 - 12 MB | NPU68| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 31.022 ms | 71 - 71 MB | NPU69| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 600.685 ms | 0 - 486 MB | NPU70| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 55.911 ms | 8 - 423 MB | NPU71| FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 19.247 ms | 6 - 348 MB | NPU72| FastSam-X | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 55.911 ms | 8 - 423 MB | NPU73| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 20.026 ms | 7 - 446 MB | NPU74| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Elite For Galaxy Mobile | 30.062 ms | 6 - 439 MB | NPU75| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® X2 Elite | 25.069 ms | 9 - 9 MB | NPU76| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® X Elite | 49.056 ms | 132 - 132 MB | NPU77| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Gen 3 Mobile | 35.43 ms | 0 - 525 MB | NPU78| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-8275 | 49.133 ms | 6 - 12 MB | NPU79| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 48.331 ms | 0 - 699 MB | NPU80| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-9075 | 45.91 ms | 6 - 12 MB | NPU81| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-X7181 | 49.056 ms | 132 - 132 MB | NPU82| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-6690 | 1008.939 ms | 0 - 575 MB | NPU83| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-7790 | 89.626 ms | 9 - 483 MB | NPU84| FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-8750 | 30.062 ms | 6 - 439 MB | NPU85| FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 7 Gen 4 Mobile | 89.626 ms | 9 - 483 MB | NPU86| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 17.634 ms | 5 - 218 MB | NPU87| FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 24.957 ms | 5 - 209 MB | NPU88| FastSam-X | QNN_DLC | float | Snapdragon® X2 Elite | 23.236 ms | 5 - 5 MB | NPU89| FastSam-X | QNN_DLC | float | Snapdragon® X Elite | 43.784 ms | 5 - 5 MB | NPU90| FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 32.599 ms | 5 - 294 MB | NPU91| FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 82.024 ms | 4 - 376 MB | NPU92| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 80.207 ms | 5 - 17 MB | NPU93| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 42.426 ms | 5 - 7 MB | NPU94| FastSam-X | QNN_DLC | float | Qualcomm® QCS8450 | 82.024 ms | 4 - 376 MB | NPU95| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 69.026 ms | 7 - 18 MB | NPU96| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 43.784 ms | 5 - 5 MB | NPU97| FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 24.957 ms | 5 - 209 MB | NPU98| FastSam-X | QNN_DLC | float | Qualcomm® SA8295P | 76.323 ms | 0 - 287 MB | NPU99| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 11.81 ms | 2 - 321 MB | NPU100| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 17.068 ms | 2 - 317 MB | NPU101| FastSam-X | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 13.927 ms | 2 - 2 MB | NPU102| FastSam-X | QNN_DLC | w8a16 | Snapdragon® X Elite | 30.528 ms | 2 - 2 MB | NPU103| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 20.45 ms | 2 - 407 MB | NPU104| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 1 Mobile | 41.166 ms | 2 - 405 MB | NPU105| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 147.106 ms | 2 - 9 MB | NPU106| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 28.913 ms | 2 - 10 MB | NPU107| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 29.842 ms | 2 - 5 MB | NPU108| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8775P | 26.699 ms | 1 - 307 MB | NPU109| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8650P | 26.699 ms | 1 - 307 MB | NPU110| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8255P | 26.699 ms | 1 - 307 MB | NPU111| FastSam-X | QNN_DLC | w8a16 | Qualcomm® QCS8450 | 41.166 ms | 2 - 405 MB | NPU112| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 27.2 ms | 1 - 7 MB | NPU113| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 30.528 ms | 2 - 2 MB | NPU114| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 618.255 ms | 3 - 459 MB | NPU115| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 54.139 ms | 2 - 393 MB | NPU116| FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 17.068 ms | 2 - 317 MB | NPU117| FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8295P | 44.427 ms | 0 - 307 MB | NPU118| FastSam-X | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 54.139 ms | 2 - 393 MB | NPU119| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 19.383 ms | 2 - 416 MB | NPU120| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Elite For Galaxy Mobile | 28.926 ms | 0 - 406 MB | NPU121| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® X2 Elite | 24.374 ms | 2 - 2 MB | NPU122| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® X Elite | 47.905 ms | 2 - 2 MB | NPU123| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Gen 3 Mobile | 34.155 ms | 2 - 500 MB | NPU124| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-8275 | 47.992 ms | 2 - 10 MB | NPU125| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 48.048 ms | 3 - 4 MB | NPU126| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® SA8775P | 43.823 ms | 1 - 399 MB | NPU127| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® SA8650P | 43.823 ms | 1 - 399 MB | NPU128| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® SA8255P | 43.823 ms | 1 - 399 MB | NPU129| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-9075 | 44.064 ms | 4 - 11 MB | NPU130| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-X7181 | 47.905 ms | 2 - 2 MB | NPU131| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-6690 | 1041.133 ms | 3 - 532 MB | NPU132| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-7790 | 83.179 ms | 2 - 449 MB | NPU133| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-8750 | 28.926 ms | 0 - 406 MB | NPU134| FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 7 Gen 4 Mobile | 83.179 ms | 2 - 449 MB | NPU135| FastSam-X | TFLITE | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 17.031 ms | 0 - 256 MB | NPU136| FastSam-X | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 24.645 ms | 6 - 251 MB | NPU137| FastSam-X | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 32.194 ms | 3 - 412 MB | NPU138| FastSam-X | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 84.318 ms | 0 - 492 MB | NPU139| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 79.849 ms | 4 - 159 MB | NPU140| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 42.51 ms | 4 - 8 MB | NPU141| FastSam-X | TFLITE | float | Qualcomm® SA8775P | 67.463 ms | 5 - 249 MB | NPU142| FastSam-X | TFLITE | float | Qualcomm® SA8650P | 67.463 ms | 5 - 249 MB | NPU143| FastSam-X | TFLITE | float | Qualcomm® SA8255P | 67.463 ms | 5 - 249 MB | NPU144| FastSam-X | TFLITE | float | Qualcomm® QCS8450 | 84.318 ms | 0 - 492 MB | NPU145| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 68.058 ms | 4 - 158 MB | NPU146| FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 24.645 ms | 6 - 251 MB | NPU147| FastSam-X | TFLITE | float | Qualcomm® SA7255P | 278.858 ms | 5 - 249 MB | NPU148| FastSam-X | TFLITE | float | Qualcomm® SA8295P | 75.585 ms | 5 - 324 MB | NPU149 150## License151* The license for the original implementation of FastSam-X can be found152 [here](https://github.com/CASIA-LMC-Lab/FastSAM/blob/main/LICENSE).153 154## References155* [Fast Segment Anything](https://arxiv.org/abs/2306.12156)156* [Source Model Implementation](https://github.com/CASIA-LMC-Lab/FastSAM)157 158## Community159* Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.160* For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).161 