Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -226,18 +226,18 @@ def get_mesh(image, depth):
|
|
226 |
triangles = create_triangles(image.shape[0], image.shape[1])
|
227 |
print('triangles - ok')
|
228 |
colors = image.reshape(-1, 3)
|
229 |
-
mesh = trimesh.Trimesh(vertices=verts, faces=triangles, vertex_colors=colors)
|
|
|
230 |
#material = trimesh.visual.texture.SimpleMaterial(image=image)
|
231 |
#texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
|
232 |
#mesh.visual = texture
|
233 |
-
|
234 |
-
scene = trimesh.Scene([mesh, light])
|
235 |
print('mesh - ok')
|
236 |
|
237 |
# Save as glb
|
238 |
glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
|
239 |
glb_path = glb_file.name
|
240 |
-
scene.export(glb_path)
|
241 |
print('file - ok')
|
242 |
return glb_path
|
243 |
|
|
|
226 |
triangles = create_triangles(image.shape[0], image.shape[1])
|
227 |
print('triangles - ok')
|
228 |
colors = image.reshape(-1, 3)
|
229 |
+
#mesh = trimesh.Trimesh(vertices=verts, faces=triangles, vertex_colors=colors)
|
230 |
+
mesh = trimesh.PointCloud(verts, colors=colors)
|
231 |
#material = trimesh.visual.texture.SimpleMaterial(image=image)
|
232 |
#texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
|
233 |
#mesh.visual = texture
|
234 |
+
scene = trimesh.Scene([mesh])
|
|
|
235 |
print('mesh - ok')
|
236 |
|
237 |
# Save as glb
|
238 |
glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
|
239 |
glb_path = glb_file.name
|
240 |
+
scene.export(glb_path, line_settings={'point_size':2})
|
241 |
print('file - ok')
|
242 |
return glb_path
|
243 |
|