This repo contains the code to implement,
- SAM
- fastSAM
- fastSAM-s models for box detection tasks.
Currently fastSAM.ipynb is partially ready for public consumption
- Google Colab
- Local Environment
- Make sure you have python version >=3.10
python3 --version
- Create a python virtual environment (prefereably in the working directory)
python3 -m venv .venv
- Activate the python environment according to your shell
- Install pip dependencies
pip install -r requirements.txt
- Run The Notebook in VSCode with Python and Jupyter Extensions or In the Jupyter Environment
- Set the
INITIALIZED
variable accordingly
- Make sure you have python version >=3.10
WIP - Detailed Documentation at SAM Documentation
- When you are running on Google Colab modify the COLAB and INITIALIZED variables accordingly then you can execute run all 🥂
-
There seems to be an error in tkinter import resolving in venv of a python3.11 version, use python3.8 -> 3.10 to resolve this issue. - Use python version 3.10 or 3.11 for maximum compatibility
pip install -r requirements.txt
will take a long time at first in local testing depending on the python version you choose. Sit back and have a coffee.
source : https://pypi.org/project/segment-anything-fast/
Two model versions of the model are available with different sizes. Click the links below to download the checkpoint for the corresponding model type.
default
orFastSAM
: YOLOv8x based Segment Anything Model | Baidu Cloud (pwd: 0000).- FastSAM-s: YOLOv8s based Segment Anything Model.