Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
try other color
Browse files- gradio_demo.py +1 -1
gradio_demo.py
CHANGED
@@ -91,7 +91,7 @@ def mesh_gen(tmp_dir, simplify, num_inference_steps):
|
|
91 |
vertex_normals = mesh.vertex_normals
|
92 |
colors = (-vertex_normals + 1) / 2.0
|
93 |
colors = (colors * 255).astype(np.uint8) # Convert to 8-bit color
|
94 |
-
mesh.visual.vertex_colors = colors[..., [
|
95 |
mesh.export(f"{tmp_dir}/mesh_normal.ply", file_type="ply")
|
96 |
|
97 |
color_path = ply_to_glb(f"{tmp_dir}/mesh.ply")
|
|
|
91 |
vertex_normals = mesh.vertex_normals
|
92 |
colors = (-vertex_normals + 1) / 2.0
|
93 |
colors = (colors * 255).astype(np.uint8) # Convert to 8-bit color
|
94 |
+
mesh.visual.vertex_colors = colors[..., [1, 0, 2]] # RGB -> GRB
|
95 |
mesh.export(f"{tmp_dir}/mesh_normal.ply", file_type="ply")
|
96 |
|
97 |
color_path = ply_to_glb(f"{tmp_dir}/mesh.ply")
|