MCPcopy Index your code
hub / github.com/DSL-Lab/StreamSplat / _build_depth_anything

Method _build_depth_anything

model/depth_wrapper.py:21–28  ·  view source on GitHub ↗
(self, model_name)

Source from the content-addressed store, hash-verified

19 self._freeze()
20
21 def _build_depth_anything(self, model_name):
22 from importlib import import_module
23 da2_hub = import_module(".depth_anything.depth_anything_v2.dpt", package=__package__)
24 model_fn = getattr(da2_hub, "DepthAnythingV2")
25 model = model_fn(**model_configs[model_name])
26 checkpoint_path = os.path.join(os.path.dirname(__file__), f"../checkpoints/depth_anything_v2_{model_name}.pth")
27 model.load_state_dict(torch.load(checkpoint_path, map_location='cpu', weights_only=True))
28 return model
29
30 def _freeze(self):
31 # logger.warning(f"======== Freezing Dinov2Wrapper ========")

Callers 1

__init__Method · 0.95

Calls 1

load_state_dictMethod · 0.45

Tested by

no test coverage detected