Skip to content

Commit

Permalink
Fix NVlabs#67 buggy planes
Browse files Browse the repository at this point in the history
  • Loading branch information
botbw authored Jan 23, 2024
1 parent 7cf1fd1 commit 13d83b7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions eg3d/training/volumetric_rendering/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,24 @@ def generate_planes():
Defines planes by the three vectors that form the "axes" of the
plane. Should work with arbitrary number of planes and planes of
arbitrary orientation.
Fix: https://github.com/NVlabs/eg3d/issues/67
Using col vector representation (torch.linalg.inv will change it into row vector and right mul row coordinates)
xyz -> xyz
xyz -> xzy
xyz -> zyx
[:2] will generate xy, xz, zy
"""
return torch.tensor([[[1, 0, 0],
return torch.tensor([[[1, 0, 0],
[0, 1, 0],
[0, 0, 1]],
[[1, 0, 0],
[0, 0, 1],
[0, 1, 0]],
[[0, 0, 1],
[1, 0, 0],
[0, 1, 0]]], dtype=torch.float32)
[0, 0, 1],
[0, 1, 0],
[1, 0, 0]], dtype=torch.float32)

def project_onto_planes(planes, coordinates):
"""
Expand Down Expand Up @@ -250,4 +258,4 @@ def sample_pdf(self, bins, weights, N_importance, det=False, eps=1e-5):
# anyway, therefore any value for it is fine (set to 1 here)

samples = bins_g[...,0] + (u-cdf_g[...,0])/denom * (bins_g[...,1]-bins_g[...,0])
return samples
return samples

0 comments on commit 13d83b7

Please sign in to comment.