ultralytics / JSON2YOLO

Convert JSON annotations into YOLO format.

Home Page:https://docs.ultralytics.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

conversion to yolov5

laviadin opened this issue · comments

commented

Is this code good for converting coco json to yolov5 format?

@laviadin yes this repo can convert COCO JSON to YOLOv5 format!

commented

how is it done?

@laviadin you just specify your directory containing your JSONs here and run:

if __name__ == '__main__':
source = 'COCO'
if source == 'COCO':
convert_coco_json('../../Downloads/coco/annotations/') # directory with *.json

It is giving me error as:
IndexError: list index out of range

@laviadin It seems that the error might be occurring due to an issue with the JSON file's contents or format. Ensure that the JSON files adhere to the COCO format, and verify that the required fields are present in each JSON file. Also, please make sure to use the latest version of the repository. If the issue persists, feel free to provide more details, and we will be happy to assist further.