Пример #1
0
def getVisualModel(cfgFile):
    cfg = get_cfg()
    add_attribute_config(cfg)
    cfg.merge_from_file(cfgFile)
    cfg.MODEL.RESNETS.RES5_DILATION = 1
    cfg.freeze()
    model = build_model(cfg)
    DetectionCheckpointer(model,
                          save_dir="./test").resume_or_load(cfg.MODEL.WEIGHTS,
                                                            resume=True)
    return model
Пример #2
0
def setup(args):
    """
    Create configs and perform basic setups.
    """
    cfg = get_cfg()
    add_attribute_config(cfg)
    cfg.merge_from_file(args.config_file)
    cfg.merge_from_list(args.opts)
    cfg.freeze()
    default_setup(cfg, args)
    return cfg
Пример #3
0
def setup(args):
    """
    Create configs and perform basic setups.
    """
    cfg = get_cfg()
    add_attribute_config(cfg)
    cfg.merge_from_file(args.config_file)
    cfg.merge_from_list(args.opts)
    # force the final residual block to have dilations 1
    cfg.MODEL.RESNETS.RES5_DILATION = 1
    cfg.freeze()
    default_setup(cfg, args)
    return cfg
def resetup(args):
    """
    Create configs and perform basic setups.
    """
    cfg = get_cfg()
    add_attribute_config(cfg)
    cfg.merge_from_file(args.config_file)
    cfg.merge_from_list(args.opts)
    # force the final residual block to have dilations 1
#     cfg.MODEL.RESNETS.RES5_DILATION = 1
    cfg.MODEL.WEIGHTS = 'output_X101/X-101.pth'
    cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0 # I do thresh filter in my code
    cfg.freeze()
    default_setup(cfg, args)
    return cfg