mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
7b9cba0e9e
* fix file cache examples issue * format * fix for tests * format fix * fix multiple files input * format * format * fix preprocess example * fix multiple file output * remove single_file const * fix tests + format * renamed demo Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
30 lines
723 B
Python
30 lines
723 B
Python
import time
|
|
import gradio as gr
|
|
import os
|
|
|
|
|
|
def load_mesh(mesh_file_name):
|
|
time.sleep(2)
|
|
return mesh_file_name, 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"),
|
|
gr.File(label="Download 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")],
|
|
],
|
|
cache_examples=True,
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|