Skip to content

A GIMP plug-in to allow for direct generation of semantic segementation masks for use in machine learning projects, using the power of the GIMP selection tools.

License

Notifications You must be signed in to change notification settings

kieranatkins/gimp-image-annotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gimp-image-annotator

gimp-image-annotator or GIÀ, a lightweight GIMP plug-in to alllow for computer vision-assisted image annotation using the powerful GIMP selection toolbox.

Installation

Follow the guide here: https://en.wikibooks.org/wiki/GIMP/Installing_Plugins to find how to install GIMP plug-ins on your system, save the file image-annotator.py in GIMP's plug-in folder.

In GIMP v2.x, the plug-in system relies on deprecated python2. On Windows, a version of python2 is included in the installation of GIMP, so you only need to follow the plug-in installation. On Linux, we recommend using the Flatpak version of GIMP, as it comes with the correct python2 binaries inlcluded. On Linux, the plug-in may need to be made executable with the command chmod a+x /path/to/image-annotator.py in order to be seen by GIMP.

Using the software

Once installed, navigate to Toolbox then Image Annotator, add the labels you want, select one, use GIMP's selection tools (e.g. The Fuzzy Select tool - a guide can be found here: https://docs.gimp.org/en/gimp-tools-selection.html) to select an area (use Quick Mask or Shift+Q to quickly see the mask you have created). Make sure antialisaing and feathering is off, you cannot turn it off for rectangle select however it isn't used. Once you have your desired selected area, press Save selected mask. Repeat until all objects are annotated.

How do I use the data?

gimp-image-annotator saves a binary mask of each annotation, with class of mask stored in the _annotations.json file. The _annotations.json file is structured as followed

    [{
      "label": "label",
      "id": "0",
      "filename": "image.png"
    }]

The masks can be inputted using most image processing software. For example in opencv-python it would be:

    import cv2
    mask = cv2.imread(PATH, cv2.IMREAD_GRAYSCALE)

About

A GIMP plug-in to allow for direct generation of semantic segementation masks for use in machine learning projects, using the power of the GIMP selection tools.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages