COCO “Common Objects In Context” is a file format for storing datasets for computer vision. You can find detailed description here.
COCO files can be really large and this script helps to solve that problem by providing a tool for splitting them into multiple files (one per each image) and also merging them back together.
- To run tests:
python -m tests
- To split COCO file into smaller ones:
bin/coco_mingler -i <path> -o <outputdir>
# Example:
bin/coco_mingler -i data/instances_minitrain2017.json -o tmp/images
Files will end up in tmp/images
if -o
is not specified
- To merge files into one COCO file
bin/coco_mingler -m <path_to_directory> -o <outputfile>
# Example:
bin/coco_mingler -m tmp/images -o tmp/merged.json