Beispiel #1
0
    def build_detection_train_loader(cls, cfg, *args, mapper=None, **kwargs):
        logger.info("Building detection train loader ...")
        mapper = mapper or cls.get_mapper(cfg, is_train=True)
        logger.info("Using dataset mapper:\n{}".format(mapper))

        sampler_name = cfg.DATALOADER.SAMPLER_TRAIN
        if sampler_name == "WeightedTrainingSampler":
            data_loader = build_weighted_detection_train_loader(cfg, mapper=mapper)
        else:
            data_loader = d2_build_detection_train_loader(
                cfg, *args, mapper=mapper, **kwargs
            )

        if comm.is_main_process():
            tbx_writer = _get_tbx_writer(get_tensorboard_log_dir(cfg.OUTPUT_DIR))
            data_loader = cls.get_data_loader_vis_wrapper()(
                cfg, tbx_writer, data_loader
            )
        return data_loader
Beispiel #2
0
 def build_detection_train_loader(cls, *args, **kwargs):
     return d2_build_detection_train_loader(*args, **kwargs)