MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / register_coco

Function register_coco

examples/FasterRCNN/dataset/coco.py:221–239  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

219
220
221def 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
242if __name__ == '__main__':

Callers 4

sotabench.pyFile · 0.90
predict.pyFile · 0.90
train.pyFile · 0.90
data.pyFile · 0.90

Calls 3

COCODetectionClass · 0.85
registerMethod · 0.80
register_metadataMethod · 0.80

Tested by

no test coverage detected