def setup(args, config): """ Create configs and perform basic setups. """ from detectron2.config import CfgNode # detectron2 default cfg # cfg = get_cfg() cfg = CfgNode() cfg.OUTPUT_DIR = "./output" cfg.SEED = -1 cfg.CUDNN_BENCHMARK = False cfg.DATASETS = CfgNode() cfg.SOLVER = CfgNode() cfg.DATALOADER = CfgNode() cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = True cfg.DATALOADER.SAMPLER_TRAIN = "TrainingSampler" cfg.MODEL = CfgNode() cfg.MODEL.KEYPOINT_ON = False cfg.MODEL.LOAD_PROPOSALS = False cfg.MODEL.WEIGHTS = "" # cfg.merge_from_file(args.config_file) cfg.merge_from_list(args.opts) cfg = detection2_utils.D2Utils.cfg_merge_from_easydict(cfg, config) cfg.freeze() default_setup( cfg, args ) # if you don't like any of the default setup, write your own setup code return cfg
def create_cfg(): """ Create configs and perform basic setups. """ from detectron2.config import CfgNode # detectron2 default cfg # cfg = get_cfg() cfg = CfgNode() cfg.OUTPUT_DIR = "./output" cfg.SEED = -1 cfg.CUDNN_BENCHMARK = False cfg.DATASETS = CfgNode() cfg.SOLVER = CfgNode() cfg.DATALOADER = CfgNode() cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = True cfg.DATALOADER.SAMPLER_TRAIN = "TrainingSampler" cfg.MODEL = CfgNode() cfg.MODEL.KEYPOINT_ON = False cfg.MODEL.LOAD_PROPOSALS = False cfg.MODEL.WEIGHTS = "" cfg.freeze() return cfg