(self, opt: Options, **model_kwargs)
| 24 | |
| 25 | class SplatModel(StaticEncoder): |
| 26 | def __init__(self, opt: Options, **model_kwargs): |
| 27 | super().__init__(opt) |
| 28 | self.opt = opt |
| 29 | self.model = SplatPredictor(opt, **model_kwargs) |
| 30 | if hasattr(opt, 'compile') and opt.compile: |
| 31 | self.model = torch.compile(self.model) |
| 32 | self.gaussian_renderer = gaussian_renderer_dynamic.render |
| 33 | self.background = torch.tensor(opt.background_color, dtype=torch.float32, device="cuda") |
| 34 | |
| 35 | # LPIPS loss |
| 36 | if self.opt.lambda_lpips > 0: |
| 37 | self.lpips_loss = LPIPS(net='vgg') |
| 38 | self.lpips_loss.requires_grad_(False) |
| 39 | self.lpips_loss.eval() |
| 40 | if hasattr(opt, 'compile') and opt.compile: |
| 41 | self.lpips_loss = torch.compile(self.lpips_loss) |
| 42 | |
| 43 | def train(self, mode=True): |
| 44 | super().train(mode) |
nothing calls this directly
no test coverage detected