| 139 | return {'image': sr_image, 'image_raw': rgb_image, 'image_depth': depth_image, "image_mask": mask_image} |
| 140 | |
| 141 | def sample(self, coordinates, directions, z, c, truncation_psi=1, truncation_cutoff=None, update_emas=False, **synthesis_kwargs): |
| 142 | # Compute RGB features, density for arbitrary 3D coordinates. Mostly used for extracting shapes. |
| 143 | ws = self.mapping(z, c, truncation_psi=truncation_psi, truncation_cutoff=truncation_cutoff, update_emas=update_emas) |
| 144 | planes = self.backbone.synthesis(ws, update_emas=update_emas, **synthesis_kwargs) |
| 145 | planes = planes.view(len(planes), 3, 32 * self.rendering_kwargs['triplane_depth'], planes.shape[-2], planes.shape[-1]) |
| 146 | return self.renderer.run_model(planes, self.decoder, coordinates, directions, self.rendering_kwargs) |
| 147 | |
| 148 | def sample_mixed(self, coordinates, directions, ws, truncation_psi=1, truncation_cutoff=None, update_emas=False, **synthesis_kwargs): |
| 149 | # Same as sample, but expects latent vectors 'ws' instead of Gaussian noise 'z' |