NCJ commited on
Commit
f2644a0
·
verified ·
1 Parent(s): c2d186b
Files changed (1) hide show
  1. gradio_demo.py +2 -2
gradio_demo.py CHANGED
@@ -15,7 +15,7 @@ import trimesh
15
  from huggingface_hub import snapshot_download
16
 
17
  from gradio_model3dcolor import Model3DColor
18
- from gradio_model3dnormal import Model3DNormal
19
 
20
  code_dir = snapshot_download("sudo-ai/MeshFormer-API", token=os.environ['HF_TOKEN'])
21
 
@@ -92,7 +92,7 @@ def mesh_gen(tmp_dir, simplify, num_inference_steps):
92
  colors = (-vertex_normals + 1) / 2.0
93
  colors = (colors * 255).astype(np.uint8) # Convert to 8-bit color
94
  print(colors.shape)
95
- mesh.visual.vertex_colors = colors[..., [2, 1, 0]] # RGB -> BGR
96
  mesh.export(f"{tmp_dir}/mesh_normal.ply", file_type="ply")
97
 
98
  color_path = ply_to_glb(f"{tmp_dir}/mesh.ply")
 
15
  from huggingface_hub import snapshot_download
16
 
17
  from gradio_model3dcolor import Model3DColor
18
+ # from gradio_model3dnormal import Model3DNormal
19
 
20
  code_dir = snapshot_download("sudo-ai/MeshFormer-API", token=os.environ['HF_TOKEN'])
21
 
 
92
  colors = (-vertex_normals + 1) / 2.0
93
  colors = (colors * 255).astype(np.uint8) # Convert to 8-bit color
94
  print(colors.shape)
95
+ mesh.visual.vertex_colors = colors[..., [0, 2, 1]] # RGB -> RBG
96
  mesh.export(f"{tmp_dir}/mesh_normal.ply", file_type="ply")
97
 
98
  color_path = ply_to_glb(f"{tmp_dir}/mesh.ply")