arabago96 commited on
Commit
c46a897
·
verified ·
1 Parent(s): 3949b97

Update trellis/utils/postprocessing_utils.py

Browse files
trellis/utils/postprocessing_utils.py CHANGED
@@ -54,7 +54,14 @@ def _fill_holes(
54
  pitchs = torch.tensor(pitchs).cuda()
55
  radius = 2.0
56
  fov = torch.deg2rad(torch.tensor(40)).cuda()
57
- projection = utils3d.torch.perspective_from_fov(fov, fov, 1, 3)
 
 
 
 
 
 
 
58
  views = []
59
  for (yaw, pitch) in zip(yaws, pitchs):
60
  orig = torch.tensor([
 
54
  pitchs = torch.tensor(pitchs).cuda()
55
  radius = 2.0
56
  fov = torch.deg2rad(torch.tensor(40)).cuda()
57
+ # Create perspective projection matrix manually to avoid API issues
58
+ f = 1.0 / torch.tan(fov / 2.0)
59
+ projection = torch.tensor([
60
+ [f, 0, 0, 0],
61
+ [0, f, 0, 0],
62
+ [0, 0, -(3+1)/(3-1), -2*3*1/(3-1)],
63
+ [0, 0, -1, 0]
64
+ ], dtype=torch.float32, device='cuda')
65
  views = []
66
  for (yaw, pitch) in zip(yaws, pitchs):
67
  orig = torch.tensor([