Spaces:
Build error
Build error
neverix
commited on
Commit
•
0b42751
1
Parent(s):
a627180
Try to force reboot
Browse files
app.py
CHANGED
@@ -26,47 +26,50 @@ def generate(*args):
|
|
26 |
return [video_path, model_path]
|
27 |
|
28 |
|
29 |
-
|
30 |
-
gr.
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
gr.
|
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 |
-
with gr.
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
70 |
|
|
|
71 |
ui.launch()
|
72 |
demo = ui
|
|
|
26 |
return [video_path, model_path]
|
27 |
|
28 |
|
29 |
+
def main():
|
30 |
+
with gr.Blocks() as ui:
|
31 |
+
gr.Markdown("# Pulsar+CLIP")
|
32 |
+
gr.Markdown("Generate 3D point clouds from text!")
|
33 |
+
|
34 |
+
with gr.Group():
|
35 |
+
gr.Markdown("## Settings")
|
36 |
+
inputs = []
|
37 |
+
defaults = []
|
38 |
+
with gr.Tabs():
|
39 |
+
for name, section in CONFIG_SPEC:
|
40 |
+
with gr.TabItem(name):
|
41 |
+
for k, v0, t in section:
|
42 |
+
if t in (float, int):
|
43 |
+
element = gr.Number(label=k, value=v0)
|
44 |
+
elif t == str:
|
45 |
+
element = gr.Textbox(label=k, value=v0)
|
46 |
+
elif t == bool:
|
47 |
+
element = gr.Checkbox(label=k, value=v0)
|
48 |
+
elif isinstance(t, tuple):
|
49 |
+
element = gr.Slider(*t, label=k, value=v0)
|
50 |
+
elif isinstance(t, list):
|
51 |
+
element = gr.Dropdown(label=k, value=v0, choices=t)
|
52 |
+
else:
|
53 |
+
raise TypeError(f"Input format {t} should be one of str, int, bool, tuple, list")
|
54 |
+
element = 1/0
|
55 |
+
inputs.append(element)
|
56 |
+
defaults.append(v0)
|
57 |
+
|
58 |
+
button = gr.Button("Run")
|
59 |
+
gr.Markdown("## Result")
|
60 |
+
with gr.Row():
|
61 |
+
with gr.Column():
|
62 |
+
video = gr.Video()
|
63 |
+
with gr.Column():
|
64 |
+
model = gr.Model3D()
|
65 |
+
|
66 |
+
button.click(fn=generate, inputs=inputs, outputs=[video, model])
|
67 |
+
|
68 |
+
gr.Markdown("## Examples")
|
69 |
+
gr.Examples(fn=generate, inputs=inputs, outputs=[video, model],
|
70 |
+
examples=[defaults], cache_examples=True, examples_per_page=1)
|
71 |
+
return ui
|
72 |
|
73 |
+
ui = main()
|
74 |
ui.launch()
|
75 |
demo = ui
|