Luxonis
    Our new model ZOO works with DepthAI V3. Find out more in our documentation.
    0 Likes
    Model Details
    Model Description
    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. FastSAM significantly reduces computational demands while maintaining competitive performance, making it a practical choice for a variety of vision tasks. We implement here the s version of the model.
    • Developed by: Ultralytics
    • Shared by:
    • Model type: Computer Vision
    • License:
    • Resources for more information:
    Training Details
    Training Data
    The model was trained on only 2% of the dataset. Segment Anything 1 Billion (SA-1B) is a dataset designed for training general-purpose object segmentation models from open world images.
    Testing Details
    Testing details are only available for the bigger FastSAM x variant.
    Technical Specifications
    Input/Output Details
    • Input:
      • Name: image
        • Info: NCHW BGR un-normalized image
    • Output:
      • Name: Multiple (please consult NN archive config.json)
        • Info: Unprocessed outputs of a multitude of detections, masks and protos
    Model Architecture
    • Backbone: CSPDarknet53
    • Head: Anchor-free object segmentation head from YOLOv8 seg model (pruned of concatenation)
    Consult the for more information.
    Throughput
    Model variant: fastsam-s:512x288
    • Input shape: [1, 3, 288, 512] • Output shapes: [[1, 6, 36, 64], [1, 6, 18, 32], [1, 6, 9, 16], [1, 32, 36, 64], [1, 32, 18, 32], [1, 32, 9, 16], [1, 32, 72, 128]]
    • Params (M): 11.780 • GFLOPs: 8.037
    PlatformPrecisionThroughput (infs/sec)Power Consumption (W)
    RVC2FP1614.15N/A
    RVC4INT8491.724.25
    * Benchmarked with , using 2 threads (and the DSP runtime in balanced mode for RVC4).
    * Parameters and FLOPs are obtained from the package.
    Quantization
    RVC4 version of the model was quantized using a custom dataset. This was created by taking a full 128-image dataset.
    Utilization
    Models converted for RVC Platforms can be used for inference on OAK devices. DepthAI pipelines are used to define the information flow linking the device, inference model, and the output parser (as defined in model head(s)). Below, we present the most crucial utilization steps for the particular model. Please consult the docs for more information.
    Install DAIv3 and depthai-nodes libraries:
    pip install depthai
    pip install depthai-nodes
    
    Define model:
    model_description = dai.NNModelDescription(
        "luxonis/fastsam-s:512x288"
    )
    
    nn = pipeline.create(ParsingNeuralNetwork).build(
        <CameraNode>, model_description
    )
    
    Inspect model head(s):
    • FastSAMParser that outputs message (mask of each of the segmented objects).
    Get parsed output(s):
    while pipeline.isRuning():
        parser_output: SegmentationMask = parser_output_queue.get()
    
    Notes
    CLIP textual and visual models are used for text prompting, to determine image segments corresponding to the given text prompt. Both these models are encoders, the difference between them is that textual CLIP is used to encode an input text, whereas visual CLIP is used to encode images (or segments of images). To learn more about various prompting methods, please refer to the .
    Example
    You can quickly run the model using our script. It automatically downloads the model, creates a DepthAI pipeline, runs the inference, and displays the results using our DepthAI visualizer tool. To try it out, run:
    python3 main.py \
        --model luxonis/fastsam-s:512x288 \
        -overlay
    
    FastSAM s
    A segment anything type of a model.
    License
    GNU Affero General Public License v3.0
    Commercial use
    Downloads
    296
    Tasks
    Semantic Segmentation
    Model Types
    ONNX
    Model Variants
    NameVersionAvailable ForCreated AtDeploy
    RVC2, RVC410 months ago
    Luxonis - Robotic vision made simple.
    XYouTubeLinkedInGitHub