def build_inference_based_loaders( cfg: CfgNode, model: torch.nn.Module) -> List[InferenceBasedLoader]: loaders = [] ratios = [] for dataset_spec in cfg.BOOTSTRAP_DATASETS: dataset_cfg = get_bootstrap_dataset_config().clone() dataset_cfg.merge_from_other_cfg(CfgNode(dataset_spec)) loader = build_inference_based_loader(cfg, dataset_cfg, model) loaders.append(loader) ratios.append(dataset_cfg.RATIO) return loaders, ratios
def build_inference_based_loaders( cfg: CfgNode, model: torch.nn.Module ) -> Tuple[List[InferenceBasedLoader], List[float]]: loaders = [] ratios = [] embedder = build_densepose_embedder(cfg).to(device=model.device) # pyre-ignore[16] for dataset_spec in cfg.BOOTSTRAP_DATASETS: dataset_cfg = get_bootstrap_dataset_config().clone() dataset_cfg.merge_from_other_cfg(CfgNode(dataset_spec)) loader = build_inference_based_loader(cfg, dataset_cfg, model, embedder) loaders.append(loader) ratios.append(dataset_cfg.RATIO) return loaders, ratios