Langelaw's picture
Update app.py
f58bc17 verified
raw
history blame
637 Bytes
import gradio as gr
from gradio_model4dgs import Model4DGS
import os
os.system('pip install gradio_model4dgs')
image_dir = os.path.join(os.path.dirname(__file__), "assets")
if os.path.exists(image_dir) and os.path.isdir(image_dir) and os.listdir(image_dir):
examples = [os.path.join(image_dir, file) for file in os.listdir(image_dir)]
else:
examples = [os.path.join(os.path.dirname(__file__), example) for example in Model4DGS().example_inputs()]
print("examples:")
print(examples)
with gr.Blocks() as demo:
with gr.Row():
Model4DGS(value=examples, label="4D Model")
if __name__ == "__main__":
demo.launch()