| 611 | return condition |
| 612 | |
| 613 | def combine(self, pred_gs): |
| 614 | static_xyz = pred_gs.pop("xyz_static") |
| 615 | dynamic_xyz = pred_gs.pop("xyz_dynamic") |
| 616 | dynamic_xyz = dynamic_xyz.reshape(*static_xyz.shape[:2], self.opt.forder, 3) |
| 617 | pred_gs["xyz"] = torch.cat([static_xyz[:, :, None], dynamic_xyz], dim=2) |
| 618 | pred_gs["rot"] = torch.cat([pred_gs.pop("rot_static")[:, :, None], pred_gs.pop("rot_dynamic")[:, :, None]], dim=2) |
| 619 | if "opacity_dynamic" in pred_gs.keys(): |
| 620 | pred_gs["opacity"] = torch.cat([pred_gs["opacity"], pred_gs.pop("opacity_dynamic")], dim=-1) |
| 621 | return pred_gs |
| 622 | |
| 623 | def forward(self, frames, depths, cond_times=None): |
| 624 | frames = torch.cat([frames[:, 0:1], frames[:, -1:]], dim=1) # [B, 2, C, H, W] |