Skip to content

Commit

Permalink
swap gen_rays() axes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcp29 committed Feb 18, 2024
1 parent 6b949c2 commit 94bc27d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/performance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@


def gen_rays(cam_mat, w, h, f):
x, y = torch.meshgrid(
y, x = torch.meshgrid(
[torch.linspace(0, h - 1, h), torch.linspace(0, w - 1, w)], indexing="ij"
)
x = x - (h - 1) / 2
y = y - (w - 1) / 2
x = x - (w - 1) / 2
y = y - (h - 1) / 2
z = -torch.ones_like(x) * f
dirs = torch.stack([x, y, z], dim=-1).cuda()
dirs /= torch.norm(dirs, dim=-1, keepdim=True)
Expand All @@ -20,9 +20,9 @@ def gen_rays(cam_mat, w, h, f):

cam_mat = torch.Tensor(
[
[2.7091104e-01, 5.6272650e-01, 7.8099048e-01],
[-1.4769979e-01, 8.2602328e-01, -5.4393965e-01],
[-9.5120555e-01, 3.2007132e-02, 3.0689341e-01],
[5.6272650e-01, 2.7091104e-01, 7.8099048e-01],
[8.2602328e-01, -1.4769979e-01, -5.4393965e-01],
[3.2007132e-02, -9.5120555e-01, 3.0689341e-01],
]
).cuda()
rw = 640
Expand Down

0 comments on commit 94bc27d

Please sign in to comment.