Spaces:
Runtime error
Runtime error
pablodawson
commited on
Commit
•
3e18545
1
Parent(s):
65acb9b
Update geometry.py
Browse files- geometry.py +2 -2
geometry.py
CHANGED
@@ -12,7 +12,7 @@ def get_intrinsics(H,W):
|
|
12 |
[0, f, cy],
|
13 |
[0, 0, 1]])
|
14 |
|
15 |
-
def depth_to_points(depth, R=None, t=None
|
16 |
|
17 |
K = get_intrinsics(depth.shape[1], depth.shape[2])
|
18 |
Kinv = np.linalg.inv(K)
|
@@ -36,7 +36,7 @@ def depth_to_points(depth, R=None, t=None, skew=0.5):
|
|
36 |
# coord = torch.as_tensor(coord, dtype=torch.float32, device=device)
|
37 |
coord = coord[None] # bs, h, w, 3
|
38 |
|
39 |
-
D = depth[:, :, :, None, None]
|
40 |
# print(D.shape, Kinv[None, None, None, ...].shape, coord[:, :, :, :, None].shape )
|
41 |
pts3D_1 = D * Kinv[None, None, None, ...] @ coord[:, :, :, :, None]
|
42 |
# pts3D_1 live in your coordinate system. Convert them to Py3D's
|
|
|
12 |
[0, f, cy],
|
13 |
[0, 0, 1]])
|
14 |
|
15 |
+
def depth_to_points(depth, R=None, t=None):
|
16 |
|
17 |
K = get_intrinsics(depth.shape[1], depth.shape[2])
|
18 |
Kinv = np.linalg.inv(K)
|
|
|
36 |
# coord = torch.as_tensor(coord, dtype=torch.float32, device=device)
|
37 |
coord = coord[None] # bs, h, w, 3
|
38 |
|
39 |
+
D = depth[:, :, :, None, None]
|
40 |
# print(D.shape, Kinv[None, None, None, ...].shape, coord[:, :, :, :, None].shape )
|
41 |
pts3D_1 = D * Kinv[None, None, None, ...] @ coord[:, :, :, :, None]
|
42 |
# pts3D_1 live in your coordinate system. Convert them to Py3D's
|