Clone sam1 and sam2 and set up the environment:
git cl https://github.com/facebookresearch/segment-anything
git clone https://github.com/facebookresearch/segment-anything-2.git
cd segment-anything
python -m venv --system-site-packages env
source env/bin/activate
pip install -e .
pip install -e ../segment-anything-2Download gimpsegany gimp plugin release: https://github.com/Shriinivas/gimpsegany/releases/download/v1.0.0/gimp-segany-gimp3.zip, and unzip it to the gimp plugin folder
You should have:
❯ ls ~/.config/GIMP/3.0/plug-ins/seganyplugin ✘ INT 18:39:51
segany_settings.json seganybridge.py seganyplugin.pyDownload the model:
See: https://github.com/facebookresearch/segment-anything?tab=readme-ov-file#model-checkpoints
Test:
/mnt/nvme/op/segment-anything main ❯ source env/bin/activate 18:44:39
# 6GB of vram is not sufficient. So I disabled GPU totally.
/mnt/nvme/op/segment-anything main ❯ export CUDA_VISIBLE_DEVICES=''
/mnt/nvme/op/segment-anything main ❯ python ~/.config/GIMP/3.0/plug-ins/seganyplugin/seganybridge.py vit_b ~/Downloads/sam_vit_b_01ec64.pth
SAM1 Model loaded successfully!
Success!!Then start GIMP:
❯ export CUDA_VISIBLE_DEVICES=''
❯ gimp