def setup(args): """ Create configs and perform basic setups. """ cfg = get_cfg() add_hoircnn_default_config(cfg) cfg.merge_from_file(args.config_file) cfg.merge_from_list(args.opts) cfg.freeze() default_setup(cfg, args) return cfg
def setup_cfg(args): # load config from file and command-line arguments cfg = get_cfg() add_hoircnn_default_config(cfg) cfg.merge_from_file(args.config_file) cfg.merge_from_list(args.opts) # Set score_threshold for builtin models cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = args.confidence_threshold cfg.MODEL.ROI_HEADS.HOI_SCORE_THRESH_TEST = args.confidence_threshold # Set novel objects cfg.ZERO_SHOT.NOVEL_CLASSES += args.novel_object if args.novel_object else [] cfg.freeze() return cfg