banner
hughie

hughie

热爱技术的小菜鸟, 记录一下所学所感

FastSAM - Achieve the performance of SAM at 50 times the speed.

Tool Sharing#

FastSAM is a CNN Segment Anything model trained using only 2% of the SA-1B dataset. FastSAM achieves performance comparable to the SAM method at 50 times the speed.

19-fastsam

Features#

FastSAM is officially introduced as being 50 times faster than SAM while achieving the same performance. The model is based on the YoloV8 architecture and has much lower training costs compared to SAM.

Deployment#

  • Installation

    git clone https://github.com/CASIA-IVA-Lab/FastSAM.git && cd FastSAM
    pip install git+https://github.com/openai/CLIP.git
    
    conda create -n FastSAM python=3.9
    conda activate FastSAM
    
    pip install -r requirements.txt
    
  • Usage

    # Everything mode
    python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg
    
    # Text prompt segmentation with CLIP assistance
    python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg  --text_prompt "the yellow dog"
    
    # Box prompt mode
    python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg --box_prompt "[570,200,230,400]"
    
    # Click mode
    python Inference.py --model_path ./weights/FastSAM.pt --img_path ./images/dogs.jpg  --point_prompt "[[520,360],[620,300]]" --point_label "[1,0]"
    

Platform#

Official demo


Disclaimer#

This article is solely for the purpose of sharing tools.

This article is synchronized with HBlog.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.