Converts annotation mask images to COCO json
python3
numpy
opencv-python
git clone https://github.com/usmanzahidi/MaskToCOCOJson.git
usage: main.py [-i PATH] [-m PATH] [-f JSONFILE]
-i rgb image folder path
-m annotation mask images folder
-f json output file name
define mask image's class names, ids and respective colours in class_definition.json
python main.py -i ./images/ -m ./annotations/ -f ./annotations/annotations.json
Once json file is generated, annotations can be tested by using Coco-viewer from https://github.com/trsvchn/coco-viewer