Mask Calibration Tool
This project is a simple tool to modify mask annotations.
Dataset Format
The format of the dataset is as follows:
- Images and masks are stored under the same directory.
- The mask of an image "name.jpg" is "name_mask.jpg".
- The image extensions only support ".jpg", ".jpeg", and ".png". The mask extension only supports ".jpg".
Requirements
- Python3
- Pillow
- numpy
- OpenCV2
- matplotlib
pip install Pillow numpy opencv-python matplotlib
Getting Started
- Run the python script
python mask_annotator.py
- Load a directory of images and masks.
- Click on the list to switch between images
- Left-click image to enclose a polygon. Right-click on the image to delete points. When a polygon is encolsed, the color turns from red to blue.
- When the polygon is enclosed, left-clicking the image prompts the mask inside the polygon to switch among three modes: (1) original mask (2) all 0s (3) all 1s; right-clicking the image changes the mask to the mode chosen.
- Switching into another image automatically replaces the original mask by the modified one. To save the mask manually, press "Save" button. (If the mask is modified and not saved, a "* " will be marked on the title bar)
- Press "Restore" button will restore the mask to the original one.