MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / register_lvis_instances

Function register_lvis_instances

detectron2/data/datasets/lvis.py:24–37  ·  view source on GitHub ↗

Register a dataset in LVIS's json annotation format for instance detection and segmentation. Args: name (str): a name that identifies the dataset, e.g. "lvis_v0.5_train". metadata (dict): extra metadata associated with this dataset. It can be an empty dict. json_fil

(name, metadata, json_file, image_root)

Source from the content-addressed store, hash-verified

22
23
24def register_lvis_instances(name, metadata, json_file, image_root):
25 """
26 Register a dataset in LVIS's json annotation format for instance detection and segmentation.
27
28 Args:
29 name (str): a name that identifies the dataset, e.g. "lvis_v0.5_train".
30 metadata (dict): extra metadata associated with this dataset. It can be an empty dict.
31 json_file (str): path to the json instance annotation file.
32 image_root (str or path-like): directory which contains all the images.
33 """
34 DatasetCatalog.register(name, lambda: load_lvis_json(json_file, image_root, name))
35 MetadataCatalog.get(name).set(
36 json_file=json_file, image_root=image_root, evaluator_type="lvis", **metadata
37 )
38
39
40def load_lvis_json(json_file, image_root, dataset_name=None):

Callers 1

register_all_lvisFunction · 0.85

Calls 4

load_lvis_jsonFunction · 0.85
registerMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected