Add COCO datasets like "coco_train201x" to the registry, so you can refer to them with names in `cfg.DATA.TRAIN/VAL`. Note that train2017==trainval35k==train2014+val2014-minival2014, and val2017==minival2014.
(basedir)
| 219 | |
| 220 | |
| 221 | def register_coco(basedir): |
| 222 | """ |
| 223 | Add COCO datasets like "coco_train201x" to the registry, |
| 224 | so you can refer to them with names in `cfg.DATA.TRAIN/VAL`. |
| 225 | |
| 226 | Note that train2017==trainval35k==train2014+val2014-minival2014, and val2017==minival2014. |
| 227 | """ |
| 228 | |
| 229 | # 80 names for COCO |
| 230 | # For your own coco-format dataset, change this. |
| 231 | class_names = [ |
| 232 | "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier", "toothbrush"] # noqa |
| 233 | class_names = ["BG"] + class_names |
| 234 | |
| 235 | for split in ["train2017", "val2017", "train2014", "val2014", |
| 236 | "valminusminival2014", "minival2014", "val2017_100"]: |
| 237 | name = "coco_" + split |
| 238 | DatasetRegistry.register(name, lambda x=split: COCODetection(basedir, x)) |
| 239 | DatasetRegistry.register_metadata(name, 'class_names', class_names) |
| 240 | |
| 241 | |
| 242 | if __name__ == '__main__': |
no test coverage detected