MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / from_dict

Method from_dict

deeplabcut/core/weight_init.py:103–123  ·  view source on GitHub ↗
(data: dict)

Source from the content-addressed store, hash-verified

101
102 @staticmethod
103 def from_dict(data: dict) -> WeightInitialization:
104 if "snapshot_path" not in data:
105 return WeightInitialization.from_dict_legacy(data)
106
107 detector_snapshot_path = data.get("detector_snapshot_path")
108 if detector_snapshot_path is not None:
109 detector_snapshot_path = Path(detector_snapshot_path)
110
111 conversion_array = data.get("conversion_array")
112 if conversion_array is not None:
113 conversion_array = np.array(conversion_array, dtype=int)
114
115 return WeightInitialization(
116 snapshot_path=Path(data["snapshot_path"]),
117 detector_snapshot_path=detector_snapshot_path,
118 dataset=data.get("dataset"),
119 with_decoder=data["with_decoder"],
120 memory_replay=data["memory_replay"],
121 conversion_array=conversion_array,
122 bodyparts=data.get("bodyparts"),
123 )
124
125 @staticmethod
126 def from_dict_legacy(data: dict) -> WeightInitialization:

Callers

nothing calls this directly

Calls 3

from_dict_legacyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected