example of creating meshes

This commit is contained in:
Alex Nichol
2023-05-05 13:14:59 -07:00
parent 037e0dbd93
commit 8625e7c155
3 changed files with 43 additions and 8 deletions

View File

@@ -80,6 +80,21 @@
" images = decode_latent_images(xm, latent, cameras, rendering_mode=render_mode)\n",
" display(gif_widget(images))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "85a4dce4",
"metadata": {},
"outputs": [],
"source": [
"# Example of saving the latents as meshes.\n",
"from shap_e.util.notebooks import decode_latent_mesh\n",
"\n",
"for i, latent in enumerate(latents):\n",
" with open(f'example_mesh_{i}.ply', 'wb') as f:\n",
" decode_latent_mesh(xm, latent).tri_mesh().write_ply(f)"
]
}
],
"metadata": {