Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,13 +125,16 @@ def do_inference(input_3d, sample_seed=0, do_sampling=False, do_marching_cubes=F
|
|
| 125 |
mesh.update_faces(mesh.unique_faces())
|
| 126 |
mesh.remove_unreferenced_vertices()
|
| 127 |
mesh.fix_normals()
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
| 135 |
input_save_name = f"processed_input_{int(time.time())}.obj"
|
| 136 |
mesh.export(input_save_name)
|
| 137 |
input_render_res = wireframe_render(mesh)
|
|
|
|
| 125 |
mesh.update_faces(mesh.unique_faces())
|
| 126 |
mesh.remove_unreferenced_vertices()
|
| 127 |
mesh.fix_normals()
|
| 128 |
+
try:
|
| 129 |
+
if mesh.visual.vertex_colors is not None:
|
| 130 |
+
orange_color = np.array([255, 165, 0, 255], dtype=np.uint8)
|
| 131 |
+
|
| 132 |
+
mesh.visual.vertex_colors = np.tile(orange_color, (mesh.vertices.shape[0], 1))
|
| 133 |
+
else:
|
| 134 |
+
orange_color = np.array([255, 165, 0, 255], dtype=np.uint8)
|
| 135 |
+
mesh.visual.vertex_colors = np.tile(orange_color, (mesh.vertices.shape[0], 1))
|
| 136 |
+
except Exception as e:
|
| 137 |
+
print(e)
|
| 138 |
input_save_name = f"processed_input_{int(time.time())}.obj"
|
| 139 |
mesh.export(input_save_name)
|
| 140 |
input_render_res = wireframe_render(mesh)
|