Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -313,21 +313,19 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
313 |
#i = i+1
|
314 |
#verts, clrs
|
315 |
|
316 |
-
pcd = o3d.geometry.
|
317 |
-
pcd.
|
318 |
-
pcd.colors = o3d.utility.Vector3dVector(np.array([[1.0, 1.0, 1.0]]))
|
319 |
mesh.append(pcd)
|
320 |
print(mesh[len(mesh)-1])
|
321 |
mesh_n.append(str(fnum))
|
322 |
-
|
323 |
-
#binary = DracoPy.encode(verts, colors=clrs.astype(np.uint8))
|
324 |
print('mesh - ok')
|
325 |
|
326 |
# Save as glb
|
327 |
-
|
328 |
-
o3d.io.
|
329 |
print('file - ok')
|
330 |
-
return "./TriangleWithoutIndices.gltf",
|
331 |
|
332 |
def blur_image(image, depth, blur_data):
|
333 |
blur_a = blur_data.split()
|
|
|
313 |
#i = i+1
|
314 |
#verts, clrs
|
315 |
|
316 |
+
pcd = o3d.geometry.TriangleMesh.create_tetrahedron()
|
317 |
+
pcd.compute_vertex_normals()
|
318 |
+
pcd.colors = o3d.utility.Vector3dVector(np.array([[1.0, 1.0, 1.0],[1.0, 1.0, 1.0],[1.0, 1.0, 1.0],[1.0, 1.0, 1.0]]))
|
319 |
mesh.append(pcd)
|
320 |
print(mesh[len(mesh)-1])
|
321 |
mesh_n.append(str(fnum))
|
|
|
|
|
322 |
print('mesh - ok')
|
323 |
|
324 |
# Save as glb
|
325 |
+
glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
|
326 |
+
o3d.io.write_triangle_mesh(glb_file.name, pcd)
|
327 |
print('file - ok')
|
328 |
+
return "./TriangleWithoutIndices.gltf", glb_file.name, ",".join(mesh_n)
|
329 |
|
330 |
def blur_image(image, depth, blur_data):
|
331 |
blur_a = blur_data.split()
|