File size: 364 Bytes
b528861 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import gradio as gr
import trimesh
import tempfile
def load_and_show_3d(model_file):
# 后端加载校验模型,前端Three.js渲染
mesh = trimesh.load(model_file)
return model_file
demo = gr.Interface(
fn=load_and_show_3d,
inputs=gr.Model3D(label="上传GLB/PLY模型"),
outputs=gr.Model3D(label="实时渲染预览"),
)
demo.launch() |