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

Function _test_loader_from_config

detectron2/data/build.py:387–403  ·  view source on GitHub ↗

Uses the given `dataset_name` argument (instead of the names in cfg), because the standard practice is to evaluate each test set individually (not combining them).

(cfg, dataset_name, mapper=None)

Source from the content-addressed store, hash-verified

385
386
387def _test_loader_from_config(cfg, dataset_name, mapper=None):
388 """
389 Uses the given `dataset_name` argument (instead of the names in cfg), because the
390 standard practice is to evaluate each test set individually (not combining them).
391 """
392 dataset = get_detection_dataset_dicts(
393 [dataset_name],
394 filter_empty=False,
395 proposal_files=[
396 cfg.DATASETS.PROPOSAL_FILES_TEST[list(cfg.DATASETS.TEST).index(dataset_name)]
397 ]
398 if cfg.MODEL.LOAD_PROPOSALS
399 else None,
400 )
401 if mapper is None:
402 mapper = DatasetMapper(cfg, False)
403 return {"dataset": dataset, "mapper": mapper, "num_workers": cfg.DATALOADER.NUM_WORKERS}
404
405
406@configurable(from_config=_test_loader_from_config)

Callers

nothing calls this directly

Calls 2

DatasetMapperClass · 0.85

Tested by

no test coverage detected