Spaces:
Runtime error
Runtime error
pablodawson
commited on
Commit
•
09fa528
1
Parent(s):
3e18545
Update mesh.py
Browse files
mesh.py
CHANGED
@@ -18,7 +18,7 @@ def depth_edges_mask(depth):
|
|
18 |
# Compute the gradient magnitude.
|
19 |
depth_grad = np.sqrt(depth_dx ** 2 + depth_dy ** 2)
|
20 |
# Compute the edge mask.
|
21 |
-
mask = depth_grad >
|
22 |
return mask
|
23 |
|
24 |
|
@@ -26,9 +26,9 @@ def predict_depth(model, image):
|
|
26 |
depth = model.infer_pil(image)
|
27 |
return depth
|
28 |
|
29 |
-
def get_mesh(depth, image, keep_edges=False
|
30 |
# limit the size of the input image
|
31 |
-
pts3d = depth_to_points(depth[None]
|
32 |
pts3d = pts3d.reshape(-1, 3)
|
33 |
|
34 |
# Create a trimesh mesh from the points
|
|
|
18 |
# Compute the gradient magnitude.
|
19 |
depth_grad = np.sqrt(depth_dx ** 2 + depth_dy ** 2)
|
20 |
# Compute the edge mask.
|
21 |
+
mask = depth_grad > 0.05
|
22 |
return mask
|
23 |
|
24 |
|
|
|
26 |
depth = model.infer_pil(image)
|
27 |
return depth
|
28 |
|
29 |
+
def get_mesh(depth, image, keep_edges=False):
|
30 |
# limit the size of the input image
|
31 |
+
pts3d = depth_to_points(depth[None])
|
32 |
pts3d = pts3d.reshape(-1, 3)
|
33 |
|
34 |
# Create a trimesh mesh from the points
|