Config

Config

Adapted from Detectron2 (https://github.com/facebookresearch/detectron2)

class ezflow.config.config.CfgNode(init_dict=None, key_list=None, new_allowed=False)[source]

Container class for configs

dump(*args, **kwargs)[source]

Dump to a string.

to_dict(cfg_node=None, key_list=[])[source]

Convert a config node to dictionary

ezflow.config.config.configurable(init_func=None, *, from_config=None)[source]

Decorate a function or a class’s __init__ method so that it can be called with a CfgNode object using a from_config() function that translates CfgNode to arguments.

Retrieve

Adapted from Detectron2 (https://github.com/facebookresearch/detectron2)

ezflow.config.retrieve.get_cfg(cfg_path, custom=False, grp='models')[source]

Returns a config object for a model in model zoo.

Parameters

config_path (str) – Complete config file path

Returns

CfgNode or omegaconf.DictConfig: a config object

ezflow.config.retrieve.get_cfg_obj()[source]

Returns a CfgNode object

ezflow.config.retrieve.get_cfg_path(cfg_path, grp='models')[source]

Returns the complete path to a config file present in ezflow

Parameters

cfg_path (str) – Config file path relative to ezflow’s “configs/{grp}” directory

Returns

The complete path to the config file.

Return type

str