GIMP Labeling Assistance
Converting images labeled by GIMP to different formats
GNU Image Manipulation Program
GIMP (GNU Image Manipulation Program) is a free and open-source raster graphics editor used for image manipulation (retouching) and image editing, free-form drawing, transcoding between different image file formats, and more specialized tasks. It is not designed to be used for drawing.
Labeling Procedure
GIMP is a powerful photo editing software which has great potential to be used as a labeling software for semantic segmentation. To do so, we provide a procedure for labeling images using GIMP software,
- Load an image into the software.
- Review the image to find candidate classes.
- Create a layer for each class (make sure that the background is transparent)
- Use pen tool and select a color (make sure the "hardness" and "opacity" properties are set to 100.
- Draw the areas belong to the class associated to the selected layer.
- Change the layer and repeat the labeling steps.
- Save the image as "xcf" file format.
Program
This repository provides a CLI tool that converts XCF file to a new format suitable for labeling. The tool also make the users able to add their own handlers for addling support to other types of outputs. Currently, the tool supports two handlers,
- mask : convert the xcf files to a multiple folders named after extracted classes. Each folder contains the mask presenting the areas labeled as the associated class.
- coco : convert the xcf files to a single MS COCO file (JSON).
- class_map : convert the xcf files to images that each pixel labeled as its class index.
The cli tool can be initialized in two ways: (a) using config files, and (b) using commandline arguments.
Options
The CLI tool provides the following options,
| Options | Other forms | Description |
|---|---|---|
| --dir_in | --dir -d | Directory containing the images. |
| --file_out | --out -o | Output Directory |
| --handler | --type | Handler Type [initially "mask", "class_map" and "coco"] |
| --num_worker | -w | Number of Workers |
| --config | Configuration file path | |
| --name | -n | Set dataset name |
| --info | Set description | |
| --url | Set URL | |
| --version | Set version | |
| --year | Set Year | |
| --contrib | Set contributor | |
| --category | -c | Class Categories |
Installation
pip install cython
pip install git+https://github.com/waspinator/coco.git@2.1.0
pip install git+https://github.com/waspinator/pycococreator.git@0.2.0
pip install gimp-labeling-converter
Usage
Using options
gimp_labeling_converter --dir "/home/phm/my-dataset/labeled" \
--out "/home/phm/Documents/dataset" \
--type "mask" -w 5 \
-c "defect" -c "surface_defect" \
-n "Parham Test"
or
gimp_labeling_converter --dir "/home/phm/my-dataset/labeled" \
--out "/home/phm/Documents/dataset/test.json" \
--type "coco" -w 5 \
-c "defect" -c "surface_defect" \
-n "Parham Test" --info "Testing the coco handler" \
--url "linkedlist.com" \
--version "1.0.0" --year 2022 --contrib "Parham Nooralishahi"
Using config file
Assuming the config file named as "./coco.json",
gimp_labeling_converter --config "./coco.json"
Contact
Parham Nooralishahi - parham.nooralishahi@gmail.com | @phm
Metadata
Release files for gimp-labeling-converter 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gimp_labeling_converter-2.0.0.tar.gz | 11.0 kB | Without provenance | Details for gimp_labeling_converter-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gimp_labeling_converter-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for gimp_labeling_converter-2.0.0-py3-none-any.whl |
Total release size: 23.1 kB
Release files / gimp_labeling_converter-2.0.0.tar.gz
| Download URL | gimp_labeling_converter-2.0.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70187628898112ab5992f520e46f2fd725a988d29a34a553638f76db240b6a22
|
|
BLAKE2b-256 checksum How to use checksums |
567a075a68bce4951fd1b969494d8a47a6618c6cb385504e86583168af714363
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / gimp_labeling_converter-2.0.0-py3-none-any.whl
| Download URL | gimp_labeling_converter-2.0.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7159aad8d1c2f7e963e456565475a66dcc812cf2796accd35fca76a9aafbd3cc
|
|
BLAKE2b-256 checksum How to use checksums |
ec0b43739e1f11aae2c325e07e700f6aa6165349e03c448d8b6a112c705ef660
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for gimp-labeling-converter 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.