--- library_name: pytorch license: other tags: - android pipeline_tag: image-segmentation --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_s/web-assets/model_demo.png) # FastSam-S: 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-S 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/quic/ai-hub-models/blob/main/qai_hub_models/models/fastsam_s) 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.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_s/releases/v0.47.0/fastsam_s-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_s/releases/v0.47.0/fastsam_s-qnn_dlc-float.zip) | TFLITE | float | Universal | QAIRT 2.43, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/fastsam_s/releases/v0.47.0/fastsam_s-tflite-float.zip) For more device-specific assets and performance metrics, visit **[FastSam-S on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/fastsam_s)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/fastsam_s) 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-S on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/fastsam_s) for usage instructions. ## Model Details **Model Type:** Model_use_case.semantic_segmentation **Model Stats:** - Model checkpoint: fastsam-s.pt - Inference latency: RealTime - Input resolution: 640x640 - Number of parameters: 11.8M - Model size (float): 45.1 MB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | FastSam-S | ONNX | float | Snapdragon® X Elite | 8.597 ms | 19 - 19 MB | NPU | FastSam-S | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 5.956 ms | 14 - 280 MB | NPU | FastSam-S | ONNX | float | Qualcomm® QCS8550 (Proxy) | 8.023 ms | 0 - 26 MB | NPU | FastSam-S | ONNX | float | Qualcomm® QCS9075 | 13.16 ms | 12 - 15 MB | NPU | FastSam-S | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 4.481 ms | 11 - 236 MB | NPU | FastSam-S | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.367 ms | 0 - 211 MB | NPU | FastSam-S | ONNX | float | Snapdragon® X2 Elite | 4.337 ms | 20 - 20 MB | NPU | FastSam-S | QNN_DLC | float | Snapdragon® X Elite | 8.042 ms | 5 - 5 MB | NPU | FastSam-S | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 5.546 ms | 5 - 214 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 38.7 ms | 1 - 183 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 7.465 ms | 5 - 6 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® SA8775P | 11.283 ms | 0 - 188 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® QCS9075 | 10.878 ms | 5 - 15 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 15.096 ms | 4 - 211 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® SA7255P | 38.7 ms | 1 - 183 MB | NPU | FastSam-S | QNN_DLC | float | Qualcomm® SA8295P | 13.897 ms | 0 - 176 MB | NPU | FastSam-S | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 4.31 ms | 0 - 185 MB | NPU | FastSam-S | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.127 ms | 5 - 192 MB | NPU | FastSam-S | QNN_DLC | float | Snapdragon® X2 Elite | 4.477 ms | 5 - 5 MB | NPU | FastSam-S | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 5.092 ms | 3 - 121 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 37.683 ms | 4 - 82 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 6.838 ms | 4 - 6 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® SA8775P | 10.635 ms | 4 - 85 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® QCS9075 | 10.592 ms | 4 - 39 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 14.034 ms | 4 - 234 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® SA7255P | 37.683 ms | 4 - 82 MB | NPU | FastSam-S | TFLITE | float | Qualcomm® SA8295P | 13.114 ms | 4 - 195 MB | NPU | FastSam-S | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.869 ms | 3 - 97 MB | NPU | FastSam-S | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 2.893 ms | 0 - 201 MB | NPU ## License * The license for the original implementation of FastSam-S 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).