config_utils
sleap.gui.config_utils
¶
Functions:
| Name | Description |
|---|---|
apply_cfg_transforms_to_key_val_dict |
Transforms data from form to correct data types before converting to object. |
filter_cfg |
Filter out keys that start with underscore to get training config. |
find_backbone_name_from_key_val_dict |
Find the backbone model name from the config dictionary. |
get_backbone_from_omegaconf |
Get the backbone model name from the config. |
get_head_from_omegaconf |
Get the head model name from the config. |
get_keyval_dict_from_omegaconf |
Get a flat dictionary from an OmegaConf object. |
get_omegaconf_from_gui_form |
Get an OmegaConf object from a flat dictionary. |
get_skeleton_from_config |
Create Sleap-io Skeleton objects from config. |
resolve_strides_from_key_val_dict |
Find the valid max and output strides from the config dictionary. |
apply_cfg_transforms_to_key_val_dict(key_val_dict)
¶
Transforms data from form to correct data types before converting to object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_val_dict
|
Flat dictionary from :py:class: |
required |
Source code in sleap/gui/config_utils.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
filter_cfg(cfg)
¶
Filter out keys that start with underscore to get training config.
Source code in sleap/gui/config_utils.py
6 7 8 9 10 11 12 13 | |
find_backbone_name_from_key_val_dict(key_val_dict)
¶
Find the backbone model name from the config dictionary.
Source code in sleap/gui/config_utils.py
56 57 58 59 60 61 62 63 | |
get_backbone_from_omegaconf(cfg)
¶
Get the backbone model name from the config.
Source code in sleap/gui/config_utils.py
40 41 42 43 44 45 | |
get_head_from_omegaconf(cfg)
¶
Get the head model name from the config.
Source code in sleap/gui/config_utils.py
48 49 50 51 52 53 | |
get_keyval_dict_from_omegaconf(cfg, parent_key='', sep='.')
¶
Get a flat dictionary from an OmegaConf object.
Source code in sleap/gui/config_utils.py
16 17 18 19 20 21 22 23 24 25 | |
get_omegaconf_from_gui_form(flat_dict)
¶
Get an OmegaConf object from a flat dictionary.
Source code in sleap/gui/config_utils.py
28 29 30 31 32 33 34 35 36 37 | |
get_skeleton_from_config(skeleton_config)
¶
Create Sleap-io Skeleton objects from config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skeleton_config
|
OmegaConf
|
OmegaConf object containing the skeleton config. |
required |
Returns:
| Type | Description |
|---|---|
|
Returns a list of |
Source code in sleap/gui/config_utils.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
resolve_strides_from_key_val_dict(key_val_dict, backbone_name)
¶
Find the valid max and output strides from the config dictionary.
Source code in sleap/gui/config_utils.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |