GIMP Plugin to refine a selection using the neural network segment-anything2
-
Install python
-
Rename the folder to
selection_refiner
and place it in your Gimp Plugins directory. To find it, go inside GIMP toEdit
->Preferences
->Folders
->Plugins
. The folder must be namedselection_refiner
!!! -
make the python file executable, install dependencies and download model files with:
bash ./setup.sh
-
Install python
-
Rename the folder to
selection_refiner
and place it in your Gimp Plugins directory. To find it, go inside GIMP toEdit
->Preferences
->Folders
->Plugins
. The folder must be namedselection_refiner
!!! -
install dependencies and download model files by double clicking
setup.bat
- Select the item roughly (make sure the entire object is in the selection)
- In the top bar, go to
Select
->Refine Selection using SAM
There are 4 different segment-anything-2 models, [tiny
, small
, base
, large
]. At the moment, base
is used. If you want better quality or better speed, another one can be used. For this, uncomment the corresponding wget line in setup.sh
e.g.
#wget https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt
to
wget https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt
and change line 28 in selection_refiner.py
from
SAM_SIZE = "base"
to e.g.
SAM_SIZE = "large"