2022-04-19 03:26:30 +08:00
|
|
|
import gradio as gr
|
2022-05-14 13:45:44 +08:00
|
|
|
import os
|
|
|
|
|
2022-04-19 03:26:30 +08:00
|
|
|
|
|
|
|
def load_mesh(mesh_file_name):
|
2023-01-23 23:14:29 +08:00
|
|
|
return mesh_file_name
|
2022-04-19 03:26:30 +08:00
|
|
|
|
2022-05-14 13:45:44 +08:00
|
|
|
|
2022-04-29 09:53:25 +08:00
|
|
|
demo = gr.Interface(
|
2022-05-14 13:45:44 +08:00
|
|
|
fn=load_mesh,
|
2022-06-02 00:23:12 +08:00
|
|
|
inputs=gr.Model3D(),
|
2023-01-23 23:14:29 +08:00
|
|
|
outputs=gr.Model3D(
|
2022-06-02 00:23:12 +08:00
|
|
|
clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model"),
|
2022-05-14 13:45:44 +08:00
|
|
|
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")],
|
|
|
|
],
|
2022-04-19 03:26:30 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-04-29 09:53:25 +08:00
|
|
|
demo.launch()
|