|
| 1 | + |
| 2 | +For a few datasets that detectron2 natively supports, |
| 3 | +the datasets are assumed to exist in a directory called |
| 4 | +"datasets/", under the directory where you launch the program. |
| 5 | +They need to have the following directory structure: |
| 6 | + |
| 7 | +## Expected dataset structure for COCO instance/keypoint detection: |
| 8 | + |
| 9 | +``` |
| 10 | +coco/ |
| 11 | + annotations/ |
| 12 | + instances_{train,val}2017.json |
| 13 | + person_keypoints_{train,val}2017.json |
| 14 | + {train,val}2017/ |
| 15 | + # image files that are mentioned in the corresponding json |
| 16 | +``` |
| 17 | + |
| 18 | +You can use the 2014 version of the dataset as well. |
| 19 | + |
| 20 | +Some of the builtin tests (`dev/run_*_tests.sh`) uses a tiny version of the COCO dataset, |
| 21 | +which you can download with `./prepare_for_tests.sh`. |
| 22 | + |
| 23 | +## Expected dataset structure for PanopticFPN: |
| 24 | + |
| 25 | +``` |
| 26 | +coco/ |
| 27 | + annotations/ |
| 28 | + panoptic_{train,val}2017.json |
| 29 | + panoptic_{train,val}2017/ |
| 30 | + # png annotations |
| 31 | + panoptic_stuff_{train,val}2017/ # generated by the script mentioned below |
| 32 | +``` |
| 33 | + |
| 34 | +Install panopticapi by: |
| 35 | +``` |
| 36 | +pip install git+https://github.com/cocodataset/panopticapi.git |
| 37 | +``` |
| 38 | +Then, run `python prepare_panoptic_fpn.py`, to extract semantic annotations from panoptic annotations. |
| 39 | + |
| 40 | +## Expected dataset structure for LVIS instance segmentation: |
| 41 | +``` |
| 42 | +coco/ |
| 43 | + {train,val,test}2017/ |
| 44 | +lvis/ |
| 45 | + lvis_v0.5_{train,val}.json |
| 46 | + lvis_v0.5_image_info_test.json |
| 47 | +``` |
| 48 | + |
| 49 | +Install lvis-api by: |
| 50 | +``` |
| 51 | +pip install git+https://github.com/lvis-dataset/lvis-api.git |
| 52 | +``` |
| 53 | + |
| 54 | +## Expected dataset structure for cityscapes: |
| 55 | +``` |
| 56 | +cityscapes/ |
| 57 | + gtFine/ |
| 58 | + train/ |
| 59 | + aachen/ |
| 60 | + color.png, instanceIds.png, labelIds.png, polygons.json, |
| 61 | + labelTrainIds.png |
| 62 | + ... |
| 63 | + val/ |
| 64 | + test/ |
| 65 | + leftImg8bit/ |
| 66 | + train/ |
| 67 | + val/ |
| 68 | + test/ |
| 69 | +``` |
| 70 | +Install cityscapes scripts by: |
| 71 | +``` |
| 72 | +pip install git+https://github.com/mcordts/cityscapesScripts.git |
| 73 | +``` |
| 74 | + |
| 75 | +Note: |
| 76 | +labelTrainIds.png are created by `cityscapesscripts/preparation/createTrainIdLabelImgs.py`. |
| 77 | +They are not needed for instance segmentation. |
| 78 | + |
| 79 | +## Expected dataset structure for Pascal VOC: |
| 80 | +``` |
| 81 | +VOC20{07,12}/ |
| 82 | + Annotations/ |
| 83 | + ImageSets/ |
| 84 | + JPEGImages/ |
| 85 | +``` |
0 commit comments