A python lib with shell entry for managing json dataset files in coco format, support detection and keypoint working
python3 -m pip install cocotools
coco --install-completion
(using this for better shell completion)
python3 -m pip uninstall cocotools
-
create empty coco file from image directory
coco from-image-dir IMAGE_DIR [--with-box] [-o OUTPUT_FILE]
-
create coco file from human labeling result
coco convert-box-labeling LABEL_FILE IMAGE_DIR [-o OUTPUT_FILE]
The labeling file should be like this:
{ "img_name_1.jpg": { "data": [ { "bbox": [ 2.598000000000013, 97.862, 152.422, 155.886 ], "type": "car", "values": {}, "id": 1 }, { "bbox": [ 176.67099999999996, 114.31700000000001, 160.217, 129.905 ], "type": "car", "values": {}, "id": 2 } ] }, "img_name_2.jpg": { "data": [ { "bbox": [ 0, 508.394, 335.324, 497.577 ], "type": "person", "values": {}, "id": 1 } ] } }
Visualize box (and keypoints) result on detection (or ground truth) files
coco visualize COCO_FILE IMG_DIR
Show how many images/boxes/categories in a coco file
coco print-stat COCO_FILES...
coco evaluate [OPTIONS] GT_FILE DT_FILE
coco merge [-o, --output FILE] INPUTS_COCOS...
- using string id
coco to-str-id COCO_FILE
- using integer id
coco to-num-id COCO_FILE
split dataset into train (80%) and val (20%)
coco split-dataset COCO_FILE IMAGE_DIR
coco cmd "SOME PYTHON CODE"
using python code for more operationspython -m coco.badcase GT_COCO DT_COCO -i IMAGE_DIR
for visualizing badcase //1.python -m coco.distribution_analyze ref coco
for obtain channels which boxes similar with ref'sfrom coco import COCO
using lib in python code
- 0.2.0.1 using pypi for distribution
- 0.2.0.0 add badcase module for badcase box visualize add distribution_analyze module for analyze box distribution in one dataset
- 0.1.1.5 add keep_images option for filters
- 0.1.1.4 add debug argument
- 0.1.1.3 support detection file with num ids
- 0.1.1.2 add -e for evaluate
- 0.1.1.1 fix console entry
- 0.1.1 add argparse
- 0.1.0 initialize the repo