pycococreator is a set of tools to help create COCO datasets. It includes functions to generate annotations in uncompressed RLE ("crowd") and polygons in the format COCO requires.
Read more here https://patrickwasp.com/create-your-own-coco-style-dataset/
pip install git+git://github.com/waspinator/pycococreator.git@0.2.0