示例#1
0
    def get_default_cfg():
        """
        Override `get_default_cfg` for adding non common config.
        """
        from detectron2.config import get_cfg as get_d2_cfg

        cfg = get_d2_cfg()
        cfg = CfgNode.cast_from_other_class(
            cfg)  # upgrade from D2's CfgNode to D2Go's CfgNode

        cfg.SOLVER.AUTO_SCALING_METHODS = ["default_scale_d2_configs"]

        return cfg
示例#2
0
    def get_default_cfg():
        """
        Override `get_default_cfg` for adding non common config.
        """
        from detectron2.config import get_cfg as get_d2_cfg

        cfg = get_d2_cfg()
        cfg = CfgNode.cast_from_other_class(
            cfg)  # upgrade from D2's CfgNode to D2Go's CfgNode

        try:
            from d2go.runner import get_unintentional_added_configs_during_runner_import
            for key in get_unintentional_added_configs_during_runner_import():
                cfg.register_deprecated_key(key)
        except ImportError:
            pass

        cfg.SOLVER.AUTO_SCALING_METHODS = ["default_scale_d2_configs"]
        return cfg