mirror of
https://github.com/openai/shap-e.git
synced 2026-05-11 11:08:19 +08:00
example of creating meshes
This commit is contained in:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user