3D / app.py
jaisree67's picture
Update app.py
0c7a013 verified
raw
history blame
955 Bytes
#!/usr/bin/env python
import os
import gradio as gr
import torch
from app_image_to_3d import create_demo as create_demo_image_to_3d
from app_text_to_3d import create_demo as create_demo_text_to_3d
from model import Model
# Update the name in the description
DESCRIPTION = "# TRIACX"
if not torch.cuda.is_available():
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
model = Model()
with gr.Blocks(css_paths="style.css") as demo:
# Change the name in the UI
gr.Markdown(DESCRIPTION)
gr.DuplicateButton(
value="Duplicate Space for private use",
elem_id="duplicate-button",
visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
)
with gr.Tabs():
with gr.Tab(label="Text to 3D"):
create_demo_text_to_3d(model)
with gr.Tab(label="Image to 3D"):
create_demo_image_to_3d(model)
if __name__ == "__main__":
demo.queue(max_size=10).launch()