Config
-
packnet_sfm.utils.config.
backwards_config
(config)[source] Add or update configuration for backwards compatibility (no need for it right now, pretrained models are up-to-date with configuration files).
- Parameters
config (CfgNode) – Model configuration
- Returns
config – Updated model configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
get_default_config
(cfg_default)[source] Get default configuration from file
-
packnet_sfm.utils.config.
merge_cfg_file
(config, cfg_file=None)[source] Merge configuration file
-
packnet_sfm.utils.config.
merge_cfgs
(original, override)[source] Updates CfgNode with information from another one
- Parameters
original (CfgNode) – Original configuration node
override (CfgNode) – Another configuration node used for overriding
- Returns
updated – Updated configuration node
- Return type
CfgNode
-
packnet_sfm.utils.config.
parse_test_config
(ckpt_file, cfg_default, cfg_file)[source] Parse model configuration for testing
- Parameters
ckpt_file (str) – Checkpoint file, with pretrained model
cfg_default (str) – Default configuration file, with default values
cfg_file (str) – Configuration file with updated information
- Returns
config (CfgNode) – Parsed model configuration
state_dict (dict) – Model state dict with pretrained weights
-
packnet_sfm.utils.config.
parse_test_file
(ckpt_file, cfg_file=None)[source] Parse model configuration for testing
- Parameters
ckpt_file (str) – Checkpoint file, with pretrained model
cfg_file – Configuration file, to update pretrained model configuration
- Returns
config (CfgNode) – Parsed model configuration
state_dict (dict) – Model state dict with pretrained weights
-
packnet_sfm.utils.config.
parse_train_config
(cfg_default, cfg_file)[source] Parse model configuration for training
- Parameters
cfg_default (str) – Default .py configuration file
cfg_file (str) – Configuration .yaml file to override the default parameters
- Returns
config – Parsed model configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
parse_train_file
(file)[source] Parse file for training
- Parameters
file (str) – File, can be either a .yaml for a yacs configuration file or a .ckpt for a pre-trained checkpoint file
- Returns
config (CfgNode) – Parsed model configuration
ckpt (str) – Parsed checkpoint file
-
packnet_sfm.utils.config.
prep_dataset
(config)[source] Expand dataset configuration to match split length
- Parameters
config (CfgNode) – Dataset configuration
- Returns
config – Updated dataset configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
prepare_test_config
(config)[source] Prepare model configuration for testing
- Parameters
config (CfgNode) – Model configuration
- Returns
config – Prepared model configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
prepare_train_config
(config)[source] Prepare model configuration for training
- Parameters
config (CfgNode) – Model configuration
- Returns
config – Prepared model configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
set_checkpoint
(config)[source] Set checkpoint information
- Parameters
config (CfgNode) – Model configuration
- Returns
config – Updated model configuration
- Return type
CfgNode
-
packnet_sfm.utils.config.
set_name
(config)[source] Set run name based on available information
- Parameters
config (CfgNode) – Model configuration
- Returns
name – Updated run name
- Return type
str