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
# based on the limit established for the COCO dataset). _C.TEST.DETECTIONS_PER_IMAGE = 100 _C.TEST.AUG = CN({"ENABLED": False}) _C.TEST.AUG.MIN_SIZES = (400, 500, 600, 700, 800, 900, 1000, 1100, 1200) _C.TEST.AUG.MAX_SIZE = 4000 _C.TEST.AUG.FLIP = True _C.TEST.PRECISE_BN = CN({"ENABLED": False}) _C.TEST.PRECISE_BN.NUM_ITER = 200 # ---------------------------------------------------------------------------- # # Misc options # ---------------------------------------------------------------------------- # # Directory where output files are written _C.OUTPUT_DIR = "./output" # Set seed to negative to fully randomize everything. # Set seed to positive to use a fixed seed. Note that a fixed seed does not # guarantee fully deterministic behavior. _C.SEED = -1 # Benchmark different cudnn algorithms. # If input images have very different sizes, this option will have large overhead # for about 10k iterations. It usually hurts total time, but can benefit for certain models. # If input images have the same or similar sizes, benchmark is often helpful. _C.CUDNN_BENCHMARK = False # The period (in terms of steps) for minibatch visualization at train time. # Set to 0 to disable. _C.VIS_PERIOD = 0 # global config is for quick hack purposes. # You can set them in command line or config files,