Spaces:
Running
on
Zero
Running
on
Zero
demo
Browse files
app.py
CHANGED
|
@@ -351,7 +351,7 @@ def main():
|
|
| 351 |
input_path, multiview_path, output_path, turntable_path, ply_path = \
|
| 352 |
pipeline.generate_3d_head(image_path, auto_crop, guidance_scale, random_seed, num_steps)
|
| 353 |
|
| 354 |
-
return output_path, turntable_path, ply_path
|
| 355 |
|
| 356 |
gr.Markdown("## FaceLift: Single Image 3D Face Reconstruction.")
|
| 357 |
|
|
@@ -382,13 +382,15 @@ def main():
|
|
| 382 |
with gr.Column(scale=1):
|
| 383 |
out_recon = gr.Image(label="3D Reconstruction Views")
|
| 384 |
out_video = gr.PlayableVideo(label="Turntable Animation (360° View)", height=600)
|
|
|
|
|
|
|
| 385 |
out_ply = gr.File(label="Download 3D Model (.ply)")
|
| 386 |
|
| 387 |
# Run generation and display all outputs
|
| 388 |
run_btn.click(
|
| 389 |
fn=_generate_and_filter_outputs,
|
| 390 |
inputs=[in_image, auto_crop, guidance, seed, steps],
|
| 391 |
-
outputs=[out_recon, out_video, out_ply],
|
| 392 |
)
|
| 393 |
|
| 394 |
demo.queue(max_size=10)
|
|
|
|
| 351 |
input_path, multiview_path, output_path, turntable_path, ply_path = \
|
| 352 |
pipeline.generate_3d_head(image_path, auto_crop, guidance_scale, random_seed, num_steps)
|
| 353 |
|
| 354 |
+
return output_path, turntable_path, str(ply_path), ply_path
|
| 355 |
|
| 356 |
gr.Markdown("## FaceLift: Single Image 3D Face Reconstruction.")
|
| 357 |
|
|
|
|
| 382 |
with gr.Column(scale=1):
|
| 383 |
out_recon = gr.Image(label="3D Reconstruction Views")
|
| 384 |
out_video = gr.PlayableVideo(label="Turntable Animation (360° View)", height=600)
|
| 385 |
+
# Interactive 3D viewer for the generated Gaussian PLY (uses three.js under the hood)
|
| 386 |
+
out_viewer = gr.Model3D(label="Interactive 3D Viewer (.ply)", height=600)
|
| 387 |
out_ply = gr.File(label="Download 3D Model (.ply)")
|
| 388 |
|
| 389 |
# Run generation and display all outputs
|
| 390 |
run_btn.click(
|
| 391 |
fn=_generate_and_filter_outputs,
|
| 392 |
inputs=[in_image, auto_crop, guidance, seed, steps],
|
| 393 |
+
outputs=[out_recon, out_video, out_viewer, out_ply],
|
| 394 |
)
|
| 395 |
|
| 396 |
demo.queue(max_size=10)
|