def build_train_loader(cls, cfg: CfgNode): data_loader = build_detection_train_loader(cfg, mapper=DatasetMapper(cfg, True)) if not has_inference_based_loaders(cfg): return data_loader model = cls.build_model(cfg) model.to(cfg.BOOTSTRAP_MODEL.DEVICE) DetectionCheckpointer(model).resume_or_load(cfg.BOOTSTRAP_MODEL.WEIGHTS, resume=False) inference_based_loaders, ratios = build_inference_based_loaders(cfg, model) loaders = [data_loader] + inference_based_loaders ratios = [1.0] + ratios combined_data_loader = build_combined_loader(cfg, loaders, ratios) sample_counting_loader = SampleCountingLoader(combined_data_loader) return sample_counting_loader
def build_test_loader(cls, cfg: CfgNode, dataset_name): return build_detection_test_loader(cfg, dataset_name, mapper=DatasetMapper(cfg, False))
def build_train_loader(cls, cfg: CfgNode): return build_detection_train_loader(cfg, mapper=DatasetMapper(cfg, True))