Skip to content

Commit

Permalink
Make the triplane available when call synthesis(). Useful for buildin…
Browse files Browse the repository at this point in the history
…g loss function of live3D portrait.
  • Loading branch information
YanniZhangYZ committed Sep 28, 2023
1 parent 7cf1fd1 commit a33fe63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eg3d/gen_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def generate_images(
cam2world_pose = LookAtPoseSampler.sample(3.14/2, 3.14/2, torch.tensor([0, 0, 0.2], device=device), radius=2.7, device=device)
intrinsics = FOV_to_intrinsics(fov_deg, device=device)

# Generate images.
# Generate images of the different people with three different views
for seed_idx, seed in enumerate(seeds):
print('Generating image for seed %d (%d/%d) ...' % (seed, seed_idx, len(seeds)))
z = torch.from_numpy(np.random.RandomState(seed).randn(1, G.z_dim)).to(device)
Expand Down
2 changes: 1 addition & 1 deletion eg3d/training/triplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def synthesis(self, ws, c, neural_rendering_resolution=None, update_emas=False,
rgb_image = feature_image[:, :3]
sr_image = self.superresolution(rgb_image, feature_image, ws, noise_mode=self.rendering_kwargs['superresolution_noise_mode'], **{k:synthesis_kwargs[k] for k in synthesis_kwargs.keys() if k != 'noise_mode'})

return {'image': sr_image, 'image_raw': rgb_image, 'image_depth': depth_image}
return {'image': sr_image, 'image_raw': rgb_image, 'image_depth': depth_image, 'triplane': planes}

def sample(self, coordinates, directions, z, c, truncation_psi=1, truncation_cutoff=None, update_emas=False, **synthesis_kwargs):
# Compute RGB features, density for arbitrary 3D coordinates. Mostly used for extracting shapes.
Expand Down

0 comments on commit a33fe63

Please sign in to comment.