ConvertCOCO

ConvertCOCO

Description

This project is the toolbox to convert your own dataset to COCO dataset.

Installation

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

Usage

Configuration

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

Structure of dataset path

<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>  

Generate gt.json

Please run gt2json.py, if anything above is done.

Visit original content creator repository
https://github.com/MELSunny/ConvertCOCO

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *