gradio/demo/model3D/run.py
Dawood Khan 35d4243854
Add download button to model3d output (#3014)
* download button

* update model3d demo

* changelog

* Update CHANGELOG.md

* Update CHANGELOG.md

* add download button to filepreview

* remove icon from file comp

* notebook

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-01-23 10:14:29 -05:00

24 lines
592 B
Python

import gradio as gr
import os
def load_mesh(mesh_file_name):
return mesh_file_name
demo = gr.Interface(
fn=load_mesh,
inputs=gr.Model3D(),
outputs=gr.Model3D(
clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
examples=[
[os.path.join(os.path.dirname(__file__), "files/Bunny.obj")],
[os.path.join(os.path.dirname(__file__), "files/Duck.glb")],
[os.path.join(os.path.dirname(__file__), "files/Fox.gltf")],
[os.path.join(os.path.dirname(__file__), "files/face.obj")],
],
)
if __name__ == "__main__":
demo.launch()