Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 1.76 KB

README.md

File metadata and controls

25 lines (21 loc) · 1.76 KB

COCO to Yolo Downloader (Images, Annoatations, Negatives)

  • Downloads COCO dataset by multiple image categories in parallel threads, converts COCO annotations to YOLO format and stored in respective .txt files
  • Download Negative images which excludes the categories in categories_to_download.txt
  • Can include custom class numbers to be added to annoation, just add desired numbers to categories_to_download.txt
  • Can limit downloads based on per class

Requirements:

  • pip3 install pycococtools
  • COCO Dataset "instances_train2017.json" file from here

Run:

  • Update categories_to_download.txt file with category names and calss numbers that you want to add.
  • To download coco dataset with limit of 5000 images per class:
 python3 main.py -o download -l 5000
  • To download negatives from coco dataset with limit of 1000:
python3 main.py -o negatives -l 1000
  • By default annotations along with images are stored in annotations folder, you can change it here
  • Image download will be skipped if already exists. However, annotations will always be appended to the existing file so it's advisable to delete *.txt file before a re-run
  • Do not delete or modify coco-names.txt