Spaces:
Runtime error
Runtime error
eliphatfs
commited on
Commit
·
0aa5626
1
Parent(s):
9b3735c
Removed a tab.
Browse files
app.py
CHANGED
@@ -76,7 +76,7 @@ def render_pc(pc):
|
|
76 |
|
77 |
|
78 |
try:
|
79 |
-
tab_cls,
|
80 |
|
81 |
with tab_cls:
|
82 |
if st.button("Run Classification on LVIS Categories"):
|
@@ -90,25 +90,6 @@ try:
|
|
90 |
st.caption("Similarity %.4f" % sim)
|
91 |
prog.progress(1.0, "Idle")
|
92 |
|
93 |
-
with tab_pc2img:
|
94 |
-
prompt = st.text_input("Prompt")
|
95 |
-
noise_scale = st.slider('Variation Level', 0, 5)
|
96 |
-
cfg_scale = st.slider('Guidance Scale', 0.0, 30.0, 3.0)
|
97 |
-
steps = st.slider('Diffusion Steps', 8, 80, 10)
|
98 |
-
width = st.slider('Width', 480, 640, step=32)
|
99 |
-
height = st.slider('Height', 480, 640, step=32)
|
100 |
-
if st.button("Generate"):
|
101 |
-
pc = load_data()
|
102 |
-
col2 = render_pc(pc)
|
103 |
-
prog.progress(0.49, "Running Generation")
|
104 |
-
img = openshape.pc_to_image(
|
105 |
-
model_l14, pc, prompt, noise_scale, width, height, cfg_scale, steps,
|
106 |
-
lambda i, t, _: prog.progress(0.49 + i / (steps + 1) / 2, "Running Diffusion Step %d" % i)
|
107 |
-
)
|
108 |
-
with col2:
|
109 |
-
st.image(img)
|
110 |
-
prog.progress(1.0, "Idle")
|
111 |
-
|
112 |
with tab_cap:
|
113 |
cond_scale = st.slider('Conditioning Scale', 0.0, 4.0, 2.0)
|
114 |
if st.button("Generate a Caption"):
|
@@ -116,8 +97,7 @@ try:
|
|
116 |
col2 = render_pc(pc)
|
117 |
prog.progress(0.5, "Running Generation")
|
118 |
cap = openshape.pc_caption(model_b32, pc, cond_scale)
|
119 |
-
|
120 |
-
st.text(cap)
|
121 |
prog.progress(1.0, "Idle")
|
122 |
except Exception as exc:
|
123 |
st.error(repr(exc))
|
|
|
76 |
|
77 |
|
78 |
try:
|
79 |
+
tab_cls, tab_cap = st.tabs(["Classification", "Point Cloud Captioning"])
|
80 |
|
81 |
with tab_cls:
|
82 |
if st.button("Run Classification on LVIS Categories"):
|
|
|
90 |
st.caption("Similarity %.4f" % sim)
|
91 |
prog.progress(1.0, "Idle")
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
with tab_cap:
|
94 |
cond_scale = st.slider('Conditioning Scale', 0.0, 4.0, 2.0)
|
95 |
if st.button("Generate a Caption"):
|
|
|
97 |
col2 = render_pc(pc)
|
98 |
prog.progress(0.5, "Running Generation")
|
99 |
cap = openshape.pc_caption(model_b32, pc, cond_scale)
|
100 |
+
st.text(cap)
|
|
|
101 |
prog.progress(1.0, "Idle")
|
102 |
except Exception as exc:
|
103 |
st.error(repr(exc))
|