This project is the toolbox to convert your own dataset to COCO dataset.
Please install the environment by anaconda
conda install -c conda-forge opencv cython pylab matplotlib
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py install
Edit your settings.json to adapt your own dataset.
envs //Basic environment
DataPath //Your own dataset path
ImgFmt //Your own dataset image format
IgnoreSize //ignore the small region which the size is below than IgnoreSize
category //Your dataset category description
id //Category id
name //Category name
supercategory //Super Category. For example: For category: boy,girl,man,woman. Their super category is human.
info //Just modify it whatever you like
<DataPath>
gt+<category name1>
image1.<ImgFmt>
image2.<ImgFmt>
image3.<ImgFmt>
gt+<category name2>
image1.<ImgFmt>
image2.<ImgFmt>
image3.<ImgFmt>
gt+<category name3>
image1.<ImgFmt>
image2.<ImgFmt>
image3.<ImgFmt>
SourceIMG
image1.<ImgFmt>
image2.<ImgFmt>
image3.<ImgFmt>
Please run gt2json.py, if anything above is done.