Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -222,8 +222,8 @@ def pano_depth_to_world_points(depth):
|
|
222 |
latitude : -pi/2 to pi/2
|
223 |
"""
|
224 |
|
225 |
-
mask = cv2.inRange(depth[int(depth.shape[0]/8*
|
226 |
-
depth[int(depth.shape[0]/8*
|
227 |
depth[depth.shape[0]-1:depth.shape[0], 0:depth.shape[1]] = 255
|
228 |
|
229 |
# Convert depth to radius
|
@@ -304,13 +304,13 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
304 |
#texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
|
305 |
#mesh.visual = texture
|
306 |
|
307 |
-
scene = trimesh.Scene(mesh)
|
308 |
print('mesh - ok')
|
309 |
|
310 |
# Save as glb
|
311 |
glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
|
312 |
glb_path = glb_file.name
|
313 |
-
|
314 |
print('file - ok')
|
315 |
return glb_path
|
316 |
|
|
|
222 |
latitude : -pi/2 to pi/2
|
223 |
"""
|
224 |
|
225 |
+
mask = cv2.inRange(depth[int(depth.shape[0]/8*6.5):depth.shape[0]-1, 0:depth.shape[1]], 160, 255)
|
226 |
+
depth[int(depth.shape[0]/8*6.5):depth.shape[0]-1, 0:depth.shape[1]][mask>0] = 160
|
227 |
depth[depth.shape[0]-1:depth.shape[0], 0:depth.shape[1]] = 255
|
228 |
|
229 |
# Convert depth to radius
|
|
|
304 |
#texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
|
305 |
#mesh.visual = texture
|
306 |
|
307 |
+
#scene = trimesh.Scene(mesh)
|
308 |
print('mesh - ok')
|
309 |
|
310 |
# Save as glb
|
311 |
glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
|
312 |
glb_path = glb_file.name
|
313 |
+
mesh.export(glb_path)
|
314 |
print('file - ok')
|
315 |
return glb_path
|
316 |
|