--- library_name: pytorch license: agpl-3.0 tags: - android pipeline_tag: image-segmentation --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_x/web-assets/model_demo.png) # 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.64.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 Due to licensing restrictions, we cannot distribute pre-exported model assets for this model. Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.64.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 See our repository for [FastSam-X on GitHub](https://github.com/qualcomm/ai-hub-models/blob/v0.64.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® 8 Elite Gen 5 For Galaxy Mobile | 18.493 ms | 13 - 253 MB | NPU | FastSam-X | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 26.058 ms | 13 - 235 MB | NPU | FastSam-X | ONNX | float | Snapdragon® X2 Elite | 23.662 ms | 17 - 17 MB | NPU | FastSam-X | ONNX | float | Snapdragon® X Elite | 44.703 ms | 140 - 140 MB | NPU | FastSam-X | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 33.662 ms | 17 - 323 MB | NPU | FastSam-X | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 87.074 ms | 17 - 408 MB | NPU | FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-8275 | 81.853 ms | 5 - 14 MB | NPU | FastSam-X | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 44.315 ms | 0 - 612 MB | NPU | FastSam-X | ONNX | float | Qualcomm® QCS8450 | 87.074 ms | 17 - 408 MB | NPU | FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 70.394 ms | 12 - 20 MB | NPU | FastSam-X | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 44.703 ms | 140 - 140 MB | NPU | FastSam-X | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 26.058 ms | 13 - 235 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 13.599 ms | 6 - 358 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 19.247 ms | 6 - 348 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® X2 Elite | 14.729 ms | 9 - 9 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® X Elite | 31.022 ms | 71 - 71 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 21.375 ms | 2 - 438 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® 8 Gen 1 Mobile | 45.905 ms | 0 - 439 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 152.763 ms | 6 - 12 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 30.06 ms | 6 - 12 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 30.863 ms | 0 - 80 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® QCS8450 | 45.905 ms | 0 - 439 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 29.836 ms | 6 - 12 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 31.022 ms | 71 - 71 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 600.685 ms | 0 - 486 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 55.911 ms | 8 - 423 MB | NPU | FastSam-X | ONNX | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 19.247 ms | 6 - 348 MB | NPU | FastSam-X | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 55.911 ms | 8 - 423 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 20.026 ms | 7 - 446 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Elite For Galaxy Mobile | 30.062 ms | 6 - 439 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® X2 Elite | 25.069 ms | 9 - 9 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® X Elite | 49.056 ms | 132 - 132 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 8 Gen 3 Mobile | 35.43 ms | 0 - 525 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-8275 | 49.133 ms | 6 - 12 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 48.331 ms | 0 - 699 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-9075 | 45.91 ms | 6 - 12 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-X7181 | 49.056 ms | 132 - 132 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-6690 | 1008.939 ms | 0 - 575 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-7790 | 89.626 ms | 9 - 483 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-8750 | 30.062 ms | 6 - 439 MB | NPU | FastSam-X | ONNX | w8a16_mixed_int16 | Snapdragon® 7 Gen 4 Mobile | 89.626 ms | 9 - 483 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 17.657 ms | 5 - 217 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 25.008 ms | 0 - 203 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® X2 Elite | 23.284 ms | 5 - 5 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® X Elite | 44.028 ms | 5 - 5 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 32.45 ms | 5 - 293 MB | NPU | FastSam-X | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 79.823 ms | 1 - 374 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-8275 | 79.839 ms | 5 - 17 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 42.046 ms | 5 - 7 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® SA8775P | 68.089 ms | 0 - 205 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® SA8650P | 68.089 ms | 0 - 205 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® SA8255P | 68.089 ms | 0 - 205 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® QCS8450 | 79.823 ms | 1 - 374 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 68.704 ms | 5 - 16 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 44.028 ms | 5 - 5 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 25.008 ms | 0 - 203 MB | NPU | FastSam-X | QNN_DLC | float | Qualcomm® SA8295P | 76.375 ms | 0 - 287 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 11.935 ms | 2 - 321 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 17.012 ms | 0 - 315 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® X2 Elite | 13.954 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® X Elite | 30.433 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 20.609 ms | 2 - 407 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® 8 Gen 1 Mobile | 41.05 ms | 2 - 406 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS6490 | 147.853 ms | 2 - 9 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-8275 | 29.049 ms | 1 - 8 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 29.439 ms | 2 - 4 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8775P | 26.694 ms | 1 - 307 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8650P | 26.694 ms | 1 - 307 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8255P | 26.694 ms | 1 - 307 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® QCS8450 | 41.05 ms | 2 - 406 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-9075 | 27.04 ms | 1 - 8 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ IQ-X7181 | 30.433 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-6690 | 600.542 ms | 2 - 460 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-7790 | 53.713 ms | 2 - 394 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® Dragonwing™ Q-8750 | 17.012 ms | 0 - 315 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Qualcomm® SA8295P | 44.459 ms | 0 - 308 MB | NPU | FastSam-X | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 53.713 ms | 2 - 394 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 19.21 ms | 2 - 414 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Elite For Galaxy Mobile | 28.741 ms | 0 - 407 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® X2 Elite | 24.45 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® X Elite | 47.723 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 8 Gen 3 Mobile | 34.243 ms | 2 - 501 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-8275 | 47.998 ms | 2 - 10 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 46.76 ms | 2 - 7 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® SA8650P | 43.823 ms | 1 - 399 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® SA8255P | 43.823 ms | 1 - 399 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-9075 | 43.674 ms | 4 - 11 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ IQ-X7181 | 47.723 ms | 2 - 2 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-6690 | 1033.378 ms | 3 - 532 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-7790 | 83.484 ms | 2 - 448 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Qualcomm® Dragonwing™ Q-8750 | 28.741 ms | 0 - 407 MB | NPU | FastSam-X | QNN_DLC | w8a16_mixed_int16 | Snapdragon® 7 Gen 4 Mobile | 83.484 ms | 2 - 448 MB | NPU | FastSam-X | TFLITE | float | Snapdragon® 8 Elite Gen 5 For Galaxy Mobile | 17.031 ms | 0 - 256 MB | NPU | FastSam-X | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 24.645 ms | 6 - 251 MB | NPU | FastSam-X | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 32.194 ms | 3 - 412 MB | NPU | FastSam-X | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 84.318 ms | 0 - 492 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-8275 | 79.849 ms | 4 - 159 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 42.51 ms | 4 - 8 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® SA8775P | 67.463 ms | 5 - 249 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® SA8650P | 67.463 ms | 5 - 249 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® SA8255P | 67.463 ms | 5 - 249 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® QCS8450 | 84.318 ms | 0 - 492 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 68.058 ms | 4 - 158 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 24.645 ms | 6 - 251 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® SA7255P | 278.858 ms | 5 - 249 MB | NPU | FastSam-X | TFLITE | float | Qualcomm® SA8295P | 75.585 ms | 5 - 324 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).