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