def build_transform(cfg): tfs = [] for icfg in cfg: tf = build_from_cfg(icfg, TRANSFORMS) tfs.append(tf) aug = Compose(tfs) return aug
def build_backbone(cfg, default_args=None): backbone = build_from_cfg(cfg, BACKBONES, default_args) return backbone
def build_model(cfg, default_args=None): model = build_from_cfg(cfg, MODELS, default_args) return model
def build_loss(cfg, default_args=None): loss = build_from_cfg(cfg, LOSSES, default_args) return loss
def build_criterion(cfg, default_args=None): criterion = build_from_cfg(cfg, CRITERIA, default_args) return criterion
def build_grid(cfg, default_args=None): grid = build_from_cfg(cfg, GRIDS, default_args) return grid
def build_head(cfg, default_args=None): head = build_from_cfg(cfg, HEADS, default_args) return head
def build_neck(cfg, default_args=None): neck = build_from_cfg(cfg, NECKS, default_args) return neck
def build_optimizer(cfg, default_args=None): optimizer = build_from_cfg(cfg, torch_optim, default_args, 'module') return optimizer
def build_lr_scheduler(cfg, default_args=None): lr_scheduler = build_from_cfg(cfg, LR_SCHEDULERS, default_args) return lr_scheduler
def build_runner(cfg, default_args=None): runner = build_from_cfg(cfg, RUNNERS, default_args) return runner
def build_dataset(cfg, default_args=None): dataset = build_from_cfg(cfg, DATASETS, default_args) return dataset
def build_sampler(cfg, default_args): sampler = build_from_cfg(cfg, SAMPLERS, default_args) return sampler
def build_dataloader(cfg, default_args): loader = build_from_cfg(cfg, DATALOADERS, default_args) return loader