Coco-like-dataset-creator
Convert Data created with labelme to coco format data set. This repo is aimed at creating a full dataset which include the following subsets:
1. train set ~60% of the input images by default
2. test set ~20% of the input images bt default
3. validation set ~20% of the input images.
The output has been tasted (so far all I can tell is that the training began) on facebookresearch/maskrcnn-benchmark for instance segmentation.
create the class with the file: CreateDastaSet.py
Installation
I have based this script on the labelme labelme2coco script therefore follow the labelme installation instraction at wkentaro/labelme
How to Create the Dataset
-
Use the wkentaro/labelme to annotate your data
-
Edit CreateDataSet inputDict as follows -input = path\to\your\Inputfolder at the following format : (Bug therefore the fornat is required )
- Inputfoder
-subfolder1 - containing data - Imgs and annotations
-subfolder2 - containing data - Imgs and annotations -subfolder3 - containing data - Imgs and annotations - outputfoler= path\to\where\output\data\will\be\created
- labels = 'path\to\label.txt'
- Verify the output with the following notebook from [pycococreator] (https://github.com/waspinator/pycococreator)
- Inputfoder
-subfolder1 - containing data - Imgs and annotations
-
run the CreateDataSet.py script
TODO:
- 1. add annotations field BoundingBox
- 2. convert to work with iscrowded =0 , aka polygons dots
- 3. add support to appending exsiting dataset (MUST Backup Previous version to dir\old\setname+timeframe )
- 4. re-enble parser
- 5. solve directory in directory bug for list of json files gathering
- 6. add a change directory function to \usedforcreatingdataset of input images in order to avoid using them for appending the dataset.
- 7. use imantics - Annotation to calculate BBox and area in stade of labelme function
- 8. figure how to add rotated boundingboxes
Knowon Bugs :
- solved - appended empty annotations to the sets
- Input dircteroy has to be parent directory bug
- Image Resize doesn't mach with mask