MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / from_dict_legacy

Method from_dict_legacy

deeplabcut/core/weight_init.py:126–147  ·  view source on GitHub ↗

Deals with weight initialization that were created before 3.0.0rc5.

(data: dict)

Source from the content-addressed store, hash-verified

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(

Callers 1

from_dictMethod · 0.80

Calls 2

getMethod · 0.45

Tested by

no test coverage detected