Convert annotation files between COCO, YOLO, VOC, and LabelMe formats with auto-detection and support for batch processing of folders.
Convert annotation formats between COCO, YOLO, VOC, and LabelMe. Use when user needs to convert annotation files between different formats for computer vision tasks.
# Convert COCO JSON to YOLO
python scripts/converter.py coco2yolo input.json output_dir/
# Convert YOLO txt to COCO
python scripts/converter.py yolo2coco input_dir/ output.json
# Convert VOC XML to COCO
python scripts/converter.py voc2coco input_dir/ output.json
# Auto-detect and convert
python scripts/converter.py convert input.json output.json --from coco --to yolo
# List supported formats
python scripts/converter.py formats
| Format | Extension | Description |
|---|---|---|
| COCO | .json | COCO JSON annotation |
| YOLO | .txt | YOLO darknet format |
| VOC | .xml | Pascal VOC XML |
| LabelMe | .json | LabelMe JSON |
$ python scripts/converter.py coco2yolo annotations.json yolo_labels/
Converting COCO to YOLO...
✓ Converted 150 annotations to yolo_labels/
$ python scripts/converter.py yolo2coco labels/ output.json --image-dir images/
Converting YOLO to COCO...
✓ Converted 150 annotations to output.json
pip install pillow tqdm
ZIP package — ready to use