MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / Predictor

Class Predictor

preprocess_depth_davis.py:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 return results
128
129class Predictor(torch.nn.Module):
130 def __init__(self, opt: Options, **model_kwargs):
131 super().__init__()
132 self.opt = opt
133 self.depth_prior = DepthAnythingWrapper(opt.depth_model_name)
134
135 def forward(self, frames, depths, cond_times=None):
136 with torch.no_grad():
137 predicted_depth = self.depth_prior(depths).detach() # [B, H, W]
138 predicted_depth = F.interpolate(predicted_depth[:, None], size=frames.shape[-2:], mode="bilinear", align_corners=True)
139 return predicted_depth # [B, C, H, W]
140
141def run_inference(opt: Options):
142 train_dataset = DAVISDataset(opt, training=True)

Callers 1

run_inferenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected