File size: 2,229 Bytes
fbb8a30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import gradio as gr
import torch
import os
import shutil
import requests
import subprocess
from subprocess import getoutput
from huggingface_hub import login, HfFileSystem, snapshot_download, HfApi, create_repo
from pathlib import Path
from PIL import Image

from app_train import create_training_demo
from sdxl.app_inference import create_inference_demo
from depthgltf.app_visualisations import create_visual_demo 

from transformers import DPTFeatureExtractor, DPTForDepthEstimation
import numpy as np
import open3d as o3d


css="""
#col-container {max-width: 780px; margin-left: auto; margin-right: auto;}
#upl-dataset-group {background-color: none!important;}

div#warning-ready {
    background-color: #ecfdf5;
    padding: 0 10px 5px;
    margin: 20px 0;
}
div#warning-ready > .gr-prose > h2, div#warning-ready > .gr-prose > p {
    color: #057857!important;
}

div#warning-duplicate {
    background-color: #ebf5ff;
    padding: 0 10px 5px;
    margin: 20px 0;
}

div#warning-duplicate > .gr-prose > h2, div#warning-duplicate > .gr-prose > p {
    color: #0f4592!important;
}

div#warning-duplicate strong {
    color: #0f4592;
}

p.actions {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

div#warning-duplicate .actions a {
    display: inline-block;
    margin-right: 10px;
}

div#warning-setgpu {
    background-color: #fff4eb;
    padding: 0 10px 5px;
    margin: 20px 0;
}

div#warning-setgpu > .gr-prose > h2, div#warning-setgpu > .gr-prose > p {
    color: #92220f!important;
}

div#warning-setgpu a, div#warning-setgpu b {
    color: #91230f;
}

div#warning-setgpu p.actions > a {
    display: inline-block;
    background: #1f1f23;
    border-radius: 40px;
    padding: 6px 24px;
    color: antiquewhite;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2em;
}

button#load-dataset-btn{
min-height: 60px;
}
"""


with gr.Blocks(css=css) as demo:

    gr.Markdown("SUTD x SUNS Shop Design Generator")
    with gr.Tab("Training"):
         create_training_demo()
    with gr.Tab("Generation"):
        create_inference_demo()
       
        #create_visual_demo(); 
    with gr.Tab("Visualisation"):
        create_visual_demo(); 


demo.queue().launch(debug=True, share=True)