Skip to content

Latest commit

 

History

History

README.md

COCO Format

Note: images and annotations in this tutorial are modified from COCO dataset.

Resources

Homework

  1. update your forked repo from my repo(ref)
  2. following 01_git, create a new branch LAST#_07coco (ex: pan667_07coco) in your forked repo
  3. activate the environment you created in 03_conda
  4. read and understand what COCO format is
  5. download 2017 Train/Val annotations here and use python to load instances_val2017.json (hint: use json package)
  6. explore the data, for example checking keys and data types, to see if you thoroughly understand the format (hint: you can cross-validate with the doc COCO format)
  7. use Python to load annotations.txt and write a LAST#.py to convert it to COCO format LAST#.json (hint: use syntax with open to load txt and read lines, use json package to save the result file)
    • don't need to care about info
    • for images, ignore license, flickr_url, coco_url, and date_captured
    • for annotations, use RLE format for segmentation (hint: use (official tools)[https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocotools/mask.py] which should be already installed with detectron2), find area and bbox yourself, and simply set iscrowd to 0
    • for categories, simply copy from instances_val2017.json
  8. run python demo.py -f pan667.json -r ~/PerceptionTutorials/07_COCO/ (repalce with your path) to plot a demo, you should see a demo.jpg looking like the following:
    demo.jpg
  9. (NOT REQUIRED) document your code with googledoc style (ref: 05_docstring)
  10. run black with line length 100, isort, and flake8 on LAST#.py
  11. move LAST#.py and LAST#.json to submissions
  12. stage changes (DO NOT ADD demo.jpg), commit with the message "learning coco", push and submit a pr