(self, batch: dotdict)
| 152 | log('Server image sum:', self.image.sum()) |
| 153 | |
| 154 | def render(self, batch: dotdict): |
| 155 | batch = self.dataset.get_viewer_batch(batch) |
| 156 | batch = to_cuda(add_batch(add_iter(batch, self.iter, self.runner.total_iter))) |
| 157 | |
| 158 | # Forward pass |
| 159 | self.runner.maybe_jit_model(batch) |
| 160 | with torch.inference_mode(self.runner.test_using_inference_mode), torch.no_grad(), torch.cuda.amp.autocast(enabled=self.runner.test_use_amp, cache_enabled=self.runner.test_amp_cached): |
| 161 | output = self.model(batch) |
| 162 | |
| 163 | image = self.runner.visualizer.generate_type(output, batch, self.visualization_type)[0][0] # RGBA (should we use alpha?) |
| 164 | image = image[..., :3] |
| 165 | image = (image.clip(0, 1) * 255).type(torch.uint8).flip(0) # transform |
| 166 | return image # H, W, 3 |
no test coverage detected