Deals with weight initialization that were created before 3.0.0rc5.
(data: dict)
| 124 | |
| 125 | @staticmethod |
| 126 | def from_dict_legacy(data: dict) -> WeightInitialization: |
| 127 | """Deals with weight initialization that were created before 3.0.0rc5.""" |
| 128 | import deeplabcut.pose_estimation_pytorch.modelzoo.utils as utils |
| 129 | |
| 130 | conversion_array = data.get("conversion_array") |
| 131 | if conversion_array is not None: |
| 132 | conversion_array = np.array(conversion_array, dtype=int) |
| 133 | |
| 134 | return WeightInitialization( |
| 135 | snapshot_path=utils.get_super_animal_snapshot_path( |
| 136 | dataset=data["dataset"], |
| 137 | model_name="hrnet_w32", |
| 138 | ), |
| 139 | detector_snapshot_path=utils.get_super_animal_snapshot_path( |
| 140 | dataset=data["dataset"], |
| 141 | model_name="fasterrcnn_resnet50_fpn_v2", |
| 142 | ), |
| 143 | with_decoder=data["with_decoder"], |
| 144 | memory_replay=data["memory_replay"], |
| 145 | conversion_array=conversion_array, |
| 146 | bodyparts=data.get("bodyparts"), |
| 147 | ) |
| 148 | |
| 149 | @staticmethod |
| 150 | def build( |
no test coverage detected