Python plug-in: run SMART (AI mask maker based on SAM2)

Hi,
I release complete version (ver. 0.2) of this plug-in.

INSTALATION PROCESS for Linux and Mac OS

  1. Install SMART
    Install SMART following Alberto’s instructions in below link.
    ART and AI-based tools | ART raw image processor
    This instructions premise the SMART installed directory as “$HOME/src/SMART”, the Python vertual environment directory as “$HOME/src/ART-AI-venv” and the path of Pyhon interpreter as “$HOME/src/ART-AI-venv/bin/python”.
    If you change these directories, please adjust the path name accordingly.

  2. Download my plug-in from following link and install it under plug-in directory of GIMP3 and make it executable.
    https://drive.google.com/file/d/1o-YfsPDD6iCIuarTjvDAW3pDr8HK5WDP/view?usp=drive_link

  3. Download model checkpoints
    From following link, download “sam2.1_hiera_base_plus.pt”, and, put it in the “models” directory under the SMART installed directory. You can use other models, however it needs to adjust the SMART scripts.
    GitHub - facebookresearch/sam2: The repository provides code for running inference with the Meta Segment Anything Model 2 (SAM 2), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.

  4. Adjust the path of my plug-in
    Adjust the path name of following parts in my plug-in to the appropriate name according of your environment.

elif platform.system() == "Linux":
    command = "/home/%USERNAME%/src/ART-AI-venv/bin/python"
    command1 = "/home/%USERNAME%/src/SMART/src/main.py"
elif platform.system() == "Darwin": #Mac OS
    command = "/Users/%USERNAME%/src/ART-AI-venv/bin/python"
    command1 = "/Users/%USERNAME%/src/SMART/src/main.py"
  1. If you use the Flatpak version of GIMP3 on Linux, use the following command to run the GIMP3.
flatpak run --socket=session-bus org.gimp.GIMP
--verbose

ATTENTION FOR SMART INSTALLATION

In some Linux distro, you may encounter troubles in installation of wxPython. And if your PC doesn’t have NVIDIA or AMD GPU, you may have trouble in installation of SAM2.

To solve these problems, please refer my posts in the link below.