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

Method forward

model/splat_model_inference.py:37–58  ·  view source on GitHub ↗
(self, data, step_ratio=0.0)

Source from the content-addressed store, hash-verified

35 return decoder_out
36
37 def forward(self, data, step_ratio=0.0):
38 # data: [B, V, C, H, W]
39 input_frames = data['frames'] # [B, V, C, H, W], input features
40 input_depths = data['depths'] # [B, V, C, H, W], input features
41 timestamps = data['timestamps'] # [B, V], input timestamps
42 timestamps = torch.as_tensor(timestamps, dtype=torch.float32, device=input_frames.device)
43 timestamps = timestamps / timestamps[..., -1].unsqueeze(-1)
44 anchor_time = torch.tensor([0.0, 1.0], device=input_frames.device)
45 results = {}
46 decoder_out = self.forward_gaussians(input_frames, input_depths, timestamps) # dict
47 with autocast('cuda', enabled=False):
48 render_pkg = self.gaussian_renderer(decoder_out["pred_gs"], self.background,
49 opt=self.opt, timestamps=timestamps,
50 anchor_time=anchor_time,
51 override_opacity=False, training=self.training,
52 )
53
54 results['pred_frames'] = render_pkg["render"]
55 results['input_frames'] = input_frames
56 results['timestamps'] = timestamps
57
58 return results
59

Callers

nothing calls this directly

Calls 1

forward_gaussiansMethod · 0.95

Tested by

no test coverage detected