Spaces:
Running
on
Zero
Running
on
Zero
as
Browse files
app.py
CHANGED
|
@@ -228,24 +228,15 @@ def make3d(images):
|
|
| 228 |
# get mesh
|
| 229 |
mesh_out = model.extract_mesh(
|
| 230 |
planes,
|
| 231 |
-
use_texture_map=
|
| 232 |
**infer_config,
|
| 233 |
)
|
| 234 |
-
vertices, faces, uvs, mesh_tex_idx, tex_map = mesh_out
|
| 235 |
-
save_obj_with_mtl(
|
| 236 |
-
vertices.data.cpu().numpy(),
|
| 237 |
-
uvs.data.cpu().numpy(),
|
| 238 |
-
faces.data.cpu().numpy(),
|
| 239 |
-
mesh_tex_idx.data.cpu().numpy(),
|
| 240 |
-
tex_map.permute(1, 2, 0).data.cpu().numpy(),
|
| 241 |
-
mesh_fpath,
|
| 242 |
-
)
|
| 243 |
|
| 244 |
-
|
| 245 |
-
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
| 249 |
|
| 250 |
print(f"Mesh saved to {mesh_fpath}")
|
| 251 |
|
|
|
|
| 228 |
# get mesh
|
| 229 |
mesh_out = model.extract_mesh(
|
| 230 |
planes,
|
| 231 |
+
use_texture_map=False,
|
| 232 |
**infer_config,
|
| 233 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
+
vertices, faces, vertex_colors = mesh_out
|
| 236 |
+
vertices = vertices[:, [1, 2, 0]]
|
| 237 |
|
| 238 |
+
save_glb(vertices, faces, vertex_colors, mesh_glb_fpath)
|
| 239 |
+
save_obj(vertices, faces, vertex_colors, mesh_fpath)
|
| 240 |
|
| 241 |
print(f"Mesh saved to {mesh_fpath}")
|
| 242 |
|