Exemple #1
0
 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
Exemple #2
0
 def build_train_loader(cls, cfg: CfgNode):
     return build_detection_train_loader(cfg,
                                         mapper=DatasetMapper(cfg, True))