Yiwen-ntu commited on
Commit
87640a1
1 Parent(s): f85fa13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
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
- if mesh.visual.vertex_colors is not None:
129
- orange_color = np.array([255, 165, 0, 255], dtype=np.uint8)
130
-
131
- mesh.visual.vertex_colors = np.tile(orange_color, (mesh.vertices.shape[0], 1))
132
- else:
133
- orange_color = np.array([255, 165, 0, 255], dtype=np.uint8)
134
- mesh.visual.vertex_colors = np.tile(orange_color, (mesh.vertices.shape[0], 1))
 
 
 
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)