Spaces:
Running
Running
ZhangYuhan
commited on
Commit
•
008ad46
1
Parent(s):
5a0f135
update server
Browse files- model/model_config.py +6 -0
- model/model_worker.py +6 -1
- serve/gradio_web_i2s.py +128 -186
- serve/gradio_web_t2s.py +196 -270
- serve/inference.py +48 -29
- serve/utils.py +14 -13
model/model_config.py
CHANGED
@@ -99,6 +99,12 @@ register_model_config(
|
|
99 |
online_model=False
|
100 |
)
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
register_model_config(
|
103 |
model_name="openlrm",
|
104 |
i2s_model=True,
|
|
|
99 |
online_model=False
|
100 |
)
|
101 |
|
102 |
+
register_model_config(
|
103 |
+
model_name="magic123",
|
104 |
+
i2s_model=True,
|
105 |
+
online_model=False
|
106 |
+
)
|
107 |
+
|
108 |
register_model_config(
|
109 |
model_name="openlrm",
|
110 |
i2s_model=True,
|
model/model_worker.py
CHANGED
@@ -45,9 +45,14 @@ class BaseModelWorker:
|
|
45 |
galley = "image2shape" if self.i2s_model else "text2shape"
|
46 |
rgb_name = f"{galley}_{self.model_name}_{offline_idx}_rgb.gif"
|
47 |
normal_name = f"{galley}_{self.model_name}_{offline_idx}_normal.gif"
|
|
|
|
|
48 |
rgb_url = f"{GIF_SERVER}/{rgb_name}"
|
49 |
normal_url = f"{GIF_SERVER}/{normal_name}"
|
50 |
-
|
|
|
|
|
|
|
51 |
|
52 |
def inference(self, prompt):
|
53 |
pass
|
|
|
45 |
galley = "image2shape" if self.i2s_model else "text2shape"
|
46 |
rgb_name = f"{galley}_{self.model_name}_{offline_idx}_rgb.gif"
|
47 |
normal_name = f"{galley}_{self.model_name}_{offline_idx}_normal.gif"
|
48 |
+
geo_name = f"{galley}_{self.model_name}_{offline_idx}_geo.gif"
|
49 |
+
|
50 |
rgb_url = f"{GIF_SERVER}/{rgb_name}"
|
51 |
normal_url = f"{GIF_SERVER}/{normal_name}"
|
52 |
+
geo_url = f"{GIF_SERVER}/{geo_name}"
|
53 |
+
return {'rgb': rgb_url,
|
54 |
+
'normal': normal_url,
|
55 |
+
'geo': geo_url}
|
56 |
|
57 |
def inference(self, prompt):
|
58 |
pass
|
serve/gradio_web_i2s.py
CHANGED
@@ -32,12 +32,12 @@ def build_i2s_ui_side_by_side_anony(models):
|
|
32 |
# ⚔️ 3DGen-Arena ⚔️ : Benchmarking Image-to-3D generative models
|
33 |
## 📜 Rules
|
34 |
- Upload image to two anonymous models in same area and vote for the better one!
|
35 |
-
- When the results are ready, click the
|
36 |
-
-
|
37 |
- Click "Clear" to start a new round.
|
38 |
|
39 |
## 🏆 Arena Elo
|
40 |
-
Find out who is the 🥇
|
41 |
|
42 |
## 👇 Generating now!
|
43 |
|
@@ -56,24 +56,51 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
56 |
model_description_md = get_model_description_md(model_list)
|
57 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
with gr.Row():
|
60 |
-
with gr.Column(
|
61 |
imagebox = gr.Image(
|
62 |
-
width=512,
|
63 |
show_label=False,
|
64 |
visible=True,
|
65 |
interactive=False, ## only support offline
|
66 |
label = "Prompt",
|
67 |
elem_id="input_box",
|
68 |
-
)
|
69 |
-
|
|
|
|
|
70 |
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
71 |
with gr.Row(elem_id="Geometry Plausibility"):
|
72 |
plausive_leftvote_btn = gr.Button(
|
73 |
-
value="
|
74 |
)
|
75 |
plausive_rightvote_btn = gr.Button(
|
76 |
-
value="
|
77 |
)
|
78 |
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
79 |
plausive_bothbad_btn = gr.Button(
|
@@ -83,10 +110,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
83 |
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
84 |
with gr.Row(elem_id="Geometry Details"):
|
85 |
geo_leftvote_btn = gr.Button(
|
86 |
-
value="
|
87 |
)
|
88 |
geo_rightvote_btn = gr.Button(
|
89 |
-
value="
|
90 |
)
|
91 |
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
92 |
geo_bothbad_btn = gr.Button(
|
@@ -96,10 +123,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
96 |
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
97 |
with gr.Row(elem_id="Texture Quality"):
|
98 |
text_leftvote_btn = gr.Button(
|
99 |
-
value="
|
100 |
)
|
101 |
text_rightvote_btn = gr.Button(
|
102 |
-
value="
|
103 |
)
|
104 |
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
105 |
text_bothbad_btn = gr.Button(
|
@@ -109,10 +136,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
109 |
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
110 |
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
111 |
coherence_leftvote_btn = gr.Button(
|
112 |
-
value="
|
113 |
)
|
114 |
coherence_rightvote_btn = gr.Button(
|
115 |
-
value="
|
116 |
)
|
117 |
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
118 |
coherence_bothbad_btn = gr.Button(
|
@@ -122,108 +149,16 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
122 |
align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
123 |
with gr.Row(elem_id="Visual Alignment"):
|
124 |
align_leftvote_btn = gr.Button(
|
125 |
-
value="
|
126 |
)
|
127 |
align_rightvote_btn = gr.Button(
|
128 |
-
value="
|
129 |
)
|
130 |
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
131 |
align_bothbad_btn = gr.Button(
|
132 |
value="👎 Both are bad", visible=False, interactive=False
|
133 |
)
|
134 |
|
135 |
-
|
136 |
-
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
137 |
-
# send_btn = gr.Button(value="📤 Send", variant="primary")
|
138 |
-
# clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
139 |
-
# regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
140 |
-
# share_btn = gr.Button(value="📷 Share")
|
141 |
-
with gr.Column():
|
142 |
-
normal_left = gr.Image(label = "Normal A",
|
143 |
-
interactive=False, show_download_button=True)
|
144 |
-
rgb_left = gr.Image(label = "RGB A",
|
145 |
-
interactive=False, show_download_button=True)
|
146 |
-
with gr.Column():
|
147 |
-
normal_right = gr.Image(label = "Normal B",
|
148 |
-
interactive=False, show_download_button=True,)
|
149 |
-
rgb_right = gr.Image(label = "RGB B",
|
150 |
-
interactive=False, show_download_button=True,)
|
151 |
-
|
152 |
-
with gr.Row():
|
153 |
-
with gr.Column(scale=0.8):
|
154 |
-
gr.Markdown("", visible=False)
|
155 |
-
with gr.Column():
|
156 |
-
model_selector_left =gr.Markdown("", visible=False)
|
157 |
-
with gr.Column():
|
158 |
-
model_selector_right = gr.Markdown("", visible=False)
|
159 |
-
with gr.Row():
|
160 |
-
slow_warning = gr.Markdown("", elem_id="notice_markdown")
|
161 |
-
|
162 |
-
# with gr.Row(elem_id="Geometry Plausibility"):
|
163 |
-
# plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
164 |
-
# plausive_leftvote_btn = gr.Button(
|
165 |
-
# value="👈 A is better", visible=False, interactive=False
|
166 |
-
# )
|
167 |
-
# plausive_rightvote_btn = gr.Button(
|
168 |
-
# value="👉 B is better", visible=False, interactive=False
|
169 |
-
# )
|
170 |
-
# plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
171 |
-
# plausive_bothbad_btn = gr.Button(
|
172 |
-
# value="👎 Both are bad", visible=False, interactive=False
|
173 |
-
# )
|
174 |
-
|
175 |
-
# with gr.Row(elem_id="Geometry Details"):
|
176 |
-
# geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
177 |
-
# geo_leftvote_btn = gr.Button(
|
178 |
-
# value="👈 A is better", visible=False, interactive=False
|
179 |
-
# )
|
180 |
-
# geo_rightvote_btn = gr.Button(
|
181 |
-
# value="👉 B is better", visible=False, interactive=False
|
182 |
-
# )
|
183 |
-
# geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
184 |
-
# geo_bothbad_btn = gr.Button(
|
185 |
-
# value="👎 Both are bad", visible=False, interactive=False
|
186 |
-
# )
|
187 |
-
|
188 |
-
# with gr.Row(elem_id="Texture Quality"):
|
189 |
-
# text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
190 |
-
# text_leftvote_btn = gr.Button(
|
191 |
-
# value="👈 A is better", visible=False, interactive=False
|
192 |
-
# )
|
193 |
-
# text_rightvote_btn = gr.Button(
|
194 |
-
# value="👉 B is better", visible=False, interactive=False
|
195 |
-
# )
|
196 |
-
# text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
197 |
-
# text_bothbad_btn = gr.Button(
|
198 |
-
# value="👎 Both are bad", visible=False, interactive=False
|
199 |
-
# )
|
200 |
-
|
201 |
-
# with gr.Row(elem_id="Geometry-Texture Coherency"):
|
202 |
-
# coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
203 |
-
# coherence_leftvote_btn = gr.Button(
|
204 |
-
# value="👈 A is better", visible=False, interactive=False
|
205 |
-
# )
|
206 |
-
# coherence_rightvote_btn = gr.Button(
|
207 |
-
# value="👉 B is better", visible=False, interactive=False
|
208 |
-
# )
|
209 |
-
# coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
210 |
-
# coherence_bothbad_btn = gr.Button(
|
211 |
-
# value="👎 Both are bad", visible=False, interactive=False
|
212 |
-
# )
|
213 |
-
|
214 |
-
# with gr.Row(elem_id="Visual Alignment"):
|
215 |
-
# align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
216 |
-
# align_leftvote_btn = gr.Button(
|
217 |
-
# value="👈 A is better", visible=False, interactive=False
|
218 |
-
# )
|
219 |
-
# align_rightvote_btn = gr.Button(
|
220 |
-
# value="👉 B is better", visible=False, interactive=False
|
221 |
-
# )
|
222 |
-
# align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
223 |
-
# align_bothbad_btn = gr.Button(
|
224 |
-
# value="👎 Both are bad", visible=False, interactive=False
|
225 |
-
# )
|
226 |
-
|
227 |
with gr.Row():
|
228 |
# sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
229 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
@@ -235,7 +170,7 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
235 |
|
236 |
states = [state_0, state_1]
|
237 |
model_selectors = [model_selector_left, model_selector_right]
|
238 |
-
results = [normal_left, rgb_left, normal_right, rgb_right]
|
239 |
|
240 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
241 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
@@ -389,8 +324,8 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
389 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
390 |
|
391 |
with gr.Row():
|
392 |
-
with gr.Column(scale=0.8):
|
393 |
-
|
394 |
with gr.Column():
|
395 |
model_selector_left = gr.Dropdown(
|
396 |
choices=model_list,
|
@@ -408,23 +343,35 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
408 |
container=False,
|
409 |
)
|
410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
with gr.Row():
|
412 |
-
with gr.Column(
|
413 |
imagebox = gr.Image(
|
414 |
-
width=512,
|
415 |
show_label=False,
|
416 |
visible=True,
|
417 |
interactive=False, ## only support offline
|
|
|
418 |
elem_id="input_box",
|
419 |
)
|
420 |
-
|
|
|
|
|
421 |
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
422 |
with gr.Row(elem_id="Geometry Plausibility"):
|
423 |
plausive_leftvote_btn = gr.Button(
|
424 |
-
value="
|
425 |
)
|
426 |
plausive_rightvote_btn = gr.Button(
|
427 |
-
value="
|
428 |
)
|
429 |
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
430 |
plausive_bothbad_btn = gr.Button(
|
@@ -434,10 +381,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
434 |
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
435 |
with gr.Row(elem_id="Geometry Details"):
|
436 |
geo_leftvote_btn = gr.Button(
|
437 |
-
value="
|
438 |
)
|
439 |
geo_rightvote_btn = gr.Button(
|
440 |
-
value="
|
441 |
)
|
442 |
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
443 |
geo_bothbad_btn = gr.Button(
|
@@ -447,10 +394,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
447 |
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
448 |
with gr.Row(elem_id="Texture Quality"):
|
449 |
text_leftvote_btn = gr.Button(
|
450 |
-
value="
|
451 |
)
|
452 |
text_rightvote_btn = gr.Button(
|
453 |
-
value="
|
454 |
)
|
455 |
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
456 |
text_bothbad_btn = gr.Button(
|
@@ -460,10 +407,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
460 |
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
461 |
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
462 |
coherence_leftvote_btn = gr.Button(
|
463 |
-
value="
|
464 |
)
|
465 |
coherence_rightvote_btn = gr.Button(
|
466 |
-
value="
|
467 |
)
|
468 |
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
469 |
coherence_bothbad_btn = gr.Button(
|
@@ -473,32 +420,23 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
473 |
align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
474 |
with gr.Row(elem_id="Visual Alignment"):
|
475 |
align_leftvote_btn = gr.Button(
|
476 |
-
value="
|
477 |
)
|
478 |
align_rightvote_btn = gr.Button(
|
479 |
-
value="
|
480 |
)
|
481 |
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
482 |
align_bothbad_btn = gr.Button(
|
483 |
value="👎 Both are bad", visible=False, interactive=False
|
484 |
)
|
485 |
|
486 |
-
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
487 |
-
|
488 |
-
with gr.Column():
|
489 |
-
normal_left = gr.Image(width=512, label = "Normal A", show_download_button=True)
|
490 |
-
rgb_left = gr.Image(width=512, label = "RGB A", show_download_button=True)
|
491 |
-
with gr.Column():
|
492 |
-
normal_right = gr.Image(width=512, label = "Normal B", show_download_button=True,)
|
493 |
-
rgb_right = gr.Image(width=512, label = "RGB B", show_download_button=True,)
|
494 |
-
|
495 |
# with gr.Row(elem_id="Geometry Plausibility"):
|
496 |
# plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
497 |
# plausive_leftvote_btn = gr.Button(
|
498 |
-
# value="
|
499 |
# )
|
500 |
# plausive_rightvote_btn = gr.Button(
|
501 |
-
# value="
|
502 |
# )
|
503 |
# plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
504 |
# plausive_bothbad_btn = gr.Button(
|
@@ -508,10 +446,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
508 |
# with gr.Row(elem_id="Geometry Details"):
|
509 |
# geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
510 |
# geo_leftvote_btn = gr.Button(
|
511 |
-
# value="
|
512 |
# )
|
513 |
# geo_rightvote_btn = gr.Button(
|
514 |
-
# value="
|
515 |
# )
|
516 |
# geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
517 |
# geo_bothbad_btn = gr.Button(
|
@@ -521,10 +459,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
521 |
# with gr.Row(elem_id="Texture Quality"):
|
522 |
# text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
523 |
# text_leftvote_btn = gr.Button(
|
524 |
-
# value="
|
525 |
# )
|
526 |
# text_rightvote_btn = gr.Button(
|
527 |
-
# value="
|
528 |
# )
|
529 |
# text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
530 |
# text_bothbad_btn = gr.Button(
|
@@ -534,10 +472,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
534 |
# with gr.Row(elem_id="Geometry-Texture Coherency"):
|
535 |
# coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
536 |
# coherence_leftvote_btn = gr.Button(
|
537 |
-
# value="
|
538 |
# )
|
539 |
# coherence_rightvote_btn = gr.Button(
|
540 |
-
# value="
|
541 |
# )
|
542 |
# coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
543 |
# coherence_bothbad_btn = gr.Button(
|
@@ -547,10 +485,10 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
547 |
# with gr.Row(elem_id="Visual Alignment"):
|
548 |
# align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
549 |
# align_leftvote_btn = gr.Button(
|
550 |
-
# value="
|
551 |
# )
|
552 |
# align_rightvote_btn = gr.Button(
|
553 |
-
# value="
|
554 |
# )
|
555 |
# align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
556 |
# align_bothbad_btn = gr.Button(
|
@@ -567,7 +505,7 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
567 |
|
568 |
states = [state_0, state_1]
|
569 |
model_selectors = [model_selector_left, model_selector_right]
|
570 |
-
results = [normal_left, rgb_left, normal_right, rgb_right]
|
571 |
|
572 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
573 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
@@ -747,48 +685,52 @@ def build_i2s_ui_single_model(models):
|
|
747 |
show_label=False
|
748 |
)
|
749 |
|
|
|
|
|
|
|
|
|
|
|
750 |
with gr.Row():
|
751 |
with gr.Column():
|
752 |
imagebox = gr.Image(
|
753 |
show_label=False,
|
754 |
visible=True,
|
755 |
interactive=False, ## only support offline
|
|
|
756 |
elem_id="input_box",
|
757 |
-
label="Prompt",
|
758 |
)
|
759 |
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
760 |
-
normal = gr.Image(width=512, label = "Normal", show_download_button=True)
|
761 |
-
rgb = gr.Image(width=512, label = "RGB", show_download_button=True,)
|
762 |
-
|
763 |
-
with gr.Row(elem_id="Geometry Plausibility"):
|
764 |
-
plausive_md = gr.Markdown("Geometry Plausibility: ", elem_id="evaldim_markdown")
|
765 |
-
plausive_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
766 |
-
plausive_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
767 |
-
plausive_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
768 |
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
|
793 |
|
794 |
with gr.Row():
|
@@ -830,7 +772,7 @@ def build_i2s_ui_single_model(models):
|
|
830 |
model_selector.change(
|
831 |
clear_i2s_history,
|
832 |
None,
|
833 |
-
[state, imagebox, normal, rgb],
|
834 |
api_name="clear_history_single",
|
835 |
show_progress="full"
|
836 |
).then(
|
@@ -847,17 +789,17 @@ def build_i2s_ui_single_model(models):
|
|
847 |
).then(
|
848 |
reset_state,
|
849 |
state,
|
850 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
851 |
)
|
852 |
|
853 |
imagebox.upload(
|
854 |
reset_state,
|
855 |
state,
|
856 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
857 |
).then(
|
858 |
gen_func,
|
859 |
[state, imagebox, model_selector],
|
860 |
-
[state, normal, rgb],
|
861 |
api_name="submit_btn_single",
|
862 |
show_progress = "full"
|
863 |
).then(
|
@@ -869,11 +811,11 @@ def build_i2s_ui_single_model(models):
|
|
869 |
send_btn.click(
|
870 |
reset_state,
|
871 |
state,
|
872 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
873 |
).then(
|
874 |
gen_func,
|
875 |
[state, imagebox, model_selector],
|
876 |
-
[state, normal, rgb],
|
877 |
api_name="send_btn_single",
|
878 |
show_progress = "full"
|
879 |
).then(
|
@@ -885,7 +827,7 @@ def build_i2s_ui_single_model(models):
|
|
885 |
clear_btn.click(
|
886 |
clear_i2s_history,
|
887 |
None,
|
888 |
-
[state, imagebox, normal, rgb],
|
889 |
api_name="clear_history_single",
|
890 |
show_progress="full"
|
891 |
).then(
|
@@ -897,11 +839,11 @@ def build_i2s_ui_single_model(models):
|
|
897 |
regenerate_btn.click(
|
898 |
reset_state,
|
899 |
state,
|
900 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
901 |
).then(
|
902 |
gen_func,
|
903 |
[state, imagebox, model_selector],
|
904 |
-
[state, normal, rgb],
|
905 |
api_name="regenerate_btn_single",
|
906 |
show_progress = "full"
|
907 |
).then(
|
|
|
32 |
# ⚔️ 3DGen-Arena ⚔️ : Benchmarking Image-to-3D generative models
|
33 |
## 📜 Rules
|
34 |
- Upload image to two anonymous models in same area and vote for the better one!
|
35 |
+
- When the results are ready, click the buttons below to vote.
|
36 |
+
- Until all dimensions have been voted, the anonymous models are displayed.
|
37 |
- Click "Clear" to start a new round.
|
38 |
|
39 |
## 🏆 Arena Elo
|
40 |
+
Find out who is the 🥇 image-to-3D generation models! More models are going to be supported.
|
41 |
|
42 |
## 👇 Generating now!
|
43 |
|
|
|
56 |
model_description_md = get_model_description_md(model_list)
|
57 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
58 |
|
59 |
+
with gr.Column():
|
60 |
+
with gr.Row():
|
61 |
+
geo_left = gr.Image(label = "Geometry A",
|
62 |
+
interactive=False, show_download_button=True)
|
63 |
+
normal_left = gr.Image(label = "Normal A",
|
64 |
+
interactive=False, show_download_button=True)
|
65 |
+
rgb_left = gr.Image(label = "RGB A",
|
66 |
+
interactive=False, show_download_button=True)
|
67 |
+
with gr.Row():
|
68 |
+
geo_right = gr.Image(label = "Geometry B",
|
69 |
+
interactive=False, show_download_button=True)
|
70 |
+
normal_right = gr.Image(label = "Normal B",
|
71 |
+
interactive=False, show_download_button=True,)
|
72 |
+
rgb_right = gr.Image(label = "RGB B",
|
73 |
+
interactive=False, show_download_button=True,)
|
74 |
+
|
75 |
+
with gr.Row():
|
76 |
+
# with gr.Column(scale=0.8):
|
77 |
+
# gr.Markdown("", visible=False)
|
78 |
+
with gr.Column():
|
79 |
+
model_selector_left =gr.Markdown("", visible=False)
|
80 |
+
with gr.Column():
|
81 |
+
model_selector_right = gr.Markdown("", visible=False)
|
82 |
+
with gr.Row():
|
83 |
+
slow_warning = gr.Markdown("", elem_id="notice_markdown")
|
84 |
+
|
85 |
with gr.Row():
|
86 |
+
with gr.Column():
|
87 |
imagebox = gr.Image(
|
|
|
88 |
show_label=False,
|
89 |
visible=True,
|
90 |
interactive=False, ## only support offline
|
91 |
label = "Prompt",
|
92 |
elem_id="input_box",
|
93 |
+
)
|
94 |
+
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
95 |
+
|
96 |
+
with gr.Column(scale=3.0):
|
97 |
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
98 |
with gr.Row(elem_id="Geometry Plausibility"):
|
99 |
plausive_leftvote_btn = gr.Button(
|
100 |
+
value="👆 A is better", visible=False, interactive=False
|
101 |
)
|
102 |
plausive_rightvote_btn = gr.Button(
|
103 |
+
value="👇 B is better", visible=False, interactive=False
|
104 |
)
|
105 |
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
106 |
plausive_bothbad_btn = gr.Button(
|
|
|
110 |
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
111 |
with gr.Row(elem_id="Geometry Details"):
|
112 |
geo_leftvote_btn = gr.Button(
|
113 |
+
value="👆 A is better", visible=False, interactive=False
|
114 |
)
|
115 |
geo_rightvote_btn = gr.Button(
|
116 |
+
value="👇 B is better", visible=False, interactive=False
|
117 |
)
|
118 |
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
119 |
geo_bothbad_btn = gr.Button(
|
|
|
123 |
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
124 |
with gr.Row(elem_id="Texture Quality"):
|
125 |
text_leftvote_btn = gr.Button(
|
126 |
+
value="👆 A is better", visible=False, interactive=False
|
127 |
)
|
128 |
text_rightvote_btn = gr.Button(
|
129 |
+
value="👇 B is better", visible=False, interactive=False
|
130 |
)
|
131 |
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
132 |
text_bothbad_btn = gr.Button(
|
|
|
136 |
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
137 |
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
138 |
coherence_leftvote_btn = gr.Button(
|
139 |
+
value="👆 A is better", visible=False, interactive=False
|
140 |
)
|
141 |
coherence_rightvote_btn = gr.Button(
|
142 |
+
value="👇 B is better", visible=False, interactive=False
|
143 |
)
|
144 |
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
145 |
coherence_bothbad_btn = gr.Button(
|
|
|
149 |
align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
150 |
with gr.Row(elem_id="Visual Alignment"):
|
151 |
align_leftvote_btn = gr.Button(
|
152 |
+
value="👆 A is better", visible=False, interactive=False
|
153 |
)
|
154 |
align_rightvote_btn = gr.Button(
|
155 |
+
value="👇 B is better", visible=False, interactive=False
|
156 |
)
|
157 |
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
158 |
align_bothbad_btn = gr.Button(
|
159 |
value="👎 Both are bad", visible=False, interactive=False
|
160 |
)
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
with gr.Row():
|
163 |
# sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
164 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
|
|
170 |
|
171 |
states = [state_0, state_1]
|
172 |
model_selectors = [model_selector_left, model_selector_right]
|
173 |
+
results = [geo_left, normal_left, rgb_left, geo_right, normal_right, rgb_right]
|
174 |
|
175 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
176 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
|
|
324 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
325 |
|
326 |
with gr.Row():
|
327 |
+
# with gr.Column(scale=0.8):
|
328 |
+
# gr.Markdown("Select Players:", elem_id="evaldim_markdown")
|
329 |
with gr.Column():
|
330 |
model_selector_left = gr.Dropdown(
|
331 |
choices=model_list,
|
|
|
343 |
container=False,
|
344 |
)
|
345 |
|
346 |
+
with gr.Column():
|
347 |
+
with gr.Row():
|
348 |
+
geo_left = gr.Image(label = "Geometry A", interactive=False, show_download_button=True)
|
349 |
+
normal_left = gr.Image(label = "Normal A", interactive=False, show_download_button=True)
|
350 |
+
rgb_left = gr.Image(label = "RGB A", interactive=False, show_download_button=True)
|
351 |
+
with gr.Row():
|
352 |
+
geo_right = gr.Image(label = "Geometry B", interactive=False, show_download_button=True)
|
353 |
+
normal_right = gr.Image(label = "Normal B", interactive=False, show_download_button=True,)
|
354 |
+
rgb_right = gr.Image(label = "RGB B", interactive=False, show_download_button=True,)
|
355 |
+
|
356 |
with gr.Row():
|
357 |
+
with gr.Column():
|
358 |
imagebox = gr.Image(
|
|
|
359 |
show_label=False,
|
360 |
visible=True,
|
361 |
interactive=False, ## only support offline
|
362 |
+
label = "Prompt",
|
363 |
elem_id="input_box",
|
364 |
)
|
365 |
+
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
366 |
+
|
367 |
+
with gr.Column(scale=3.0):
|
368 |
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
369 |
with gr.Row(elem_id="Geometry Plausibility"):
|
370 |
plausive_leftvote_btn = gr.Button(
|
371 |
+
value="👆 A is better", visible=False, interactive=False
|
372 |
)
|
373 |
plausive_rightvote_btn = gr.Button(
|
374 |
+
value="👇 B is better", visible=False, interactive=False
|
375 |
)
|
376 |
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
377 |
plausive_bothbad_btn = gr.Button(
|
|
|
381 |
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
382 |
with gr.Row(elem_id="Geometry Details"):
|
383 |
geo_leftvote_btn = gr.Button(
|
384 |
+
value="👆 A is better", visible=False, interactive=False
|
385 |
)
|
386 |
geo_rightvote_btn = gr.Button(
|
387 |
+
value="👇 B is better", visible=False, interactive=False
|
388 |
)
|
389 |
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
390 |
geo_bothbad_btn = gr.Button(
|
|
|
394 |
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
395 |
with gr.Row(elem_id="Texture Quality"):
|
396 |
text_leftvote_btn = gr.Button(
|
397 |
+
value="👆 A is better", visible=False, interactive=False
|
398 |
)
|
399 |
text_rightvote_btn = gr.Button(
|
400 |
+
value="👇 B is better", visible=False, interactive=False
|
401 |
)
|
402 |
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
403 |
text_bothbad_btn = gr.Button(
|
|
|
407 |
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
408 |
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
409 |
coherence_leftvote_btn = gr.Button(
|
410 |
+
value="👆 A is better", visible=False, interactive=False
|
411 |
)
|
412 |
coherence_rightvote_btn = gr.Button(
|
413 |
+
value="👇 B is better", visible=False, interactive=False
|
414 |
)
|
415 |
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
416 |
coherence_bothbad_btn = gr.Button(
|
|
|
420 |
align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
421 |
with gr.Row(elem_id="Visual Alignment"):
|
422 |
align_leftvote_btn = gr.Button(
|
423 |
+
value="👆 A is better", visible=False, interactive=False
|
424 |
)
|
425 |
align_rightvote_btn = gr.Button(
|
426 |
+
value="👇 B is better", visible=False, interactive=False
|
427 |
)
|
428 |
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
429 |
align_bothbad_btn = gr.Button(
|
430 |
value="👎 Both are bad", visible=False, interactive=False
|
431 |
)
|
432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
# with gr.Row(elem_id="Geometry Plausibility"):
|
434 |
# plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
435 |
# plausive_leftvote_btn = gr.Button(
|
436 |
+
# value="👆 A is better", visible=False, interactive=False
|
437 |
# )
|
438 |
# plausive_rightvote_btn = gr.Button(
|
439 |
+
# value="👇 B is better", visible=False, interactive=False
|
440 |
# )
|
441 |
# plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
442 |
# plausive_bothbad_btn = gr.Button(
|
|
|
446 |
# with gr.Row(elem_id="Geometry Details"):
|
447 |
# geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
448 |
# geo_leftvote_btn = gr.Button(
|
449 |
+
# value="👆 A is better", visible=False, interactive=False
|
450 |
# )
|
451 |
# geo_rightvote_btn = gr.Button(
|
452 |
+
# value="👇 B is better", visible=False, interactive=False
|
453 |
# )
|
454 |
# geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
455 |
# geo_bothbad_btn = gr.Button(
|
|
|
459 |
# with gr.Row(elem_id="Texture Quality"):
|
460 |
# text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
461 |
# text_leftvote_btn = gr.Button(
|
462 |
+
# value="👆 A is better", visible=False, interactive=False
|
463 |
# )
|
464 |
# text_rightvote_btn = gr.Button(
|
465 |
+
# value="👇 B is better", visible=False, interactive=False
|
466 |
# )
|
467 |
# text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
468 |
# text_bothbad_btn = gr.Button(
|
|
|
472 |
# with gr.Row(elem_id="Geometry-Texture Coherency"):
|
473 |
# coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
474 |
# coherence_leftvote_btn = gr.Button(
|
475 |
+
# value="👆 A is better", visible=False, interactive=False
|
476 |
# )
|
477 |
# coherence_rightvote_btn = gr.Button(
|
478 |
+
# value="👇 B is better", visible=False, interactive=False
|
479 |
# )
|
480 |
# coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
481 |
# coherence_bothbad_btn = gr.Button(
|
|
|
485 |
# with gr.Row(elem_id="Visual Alignment"):
|
486 |
# align_md = gr.Markdown("Visual Alignment: ", visible=False, elem_id="evaldim_markdown")
|
487 |
# align_leftvote_btn = gr.Button(
|
488 |
+
# value="👆 A is better", visible=False, interactive=False
|
489 |
# )
|
490 |
# align_rightvote_btn = gr.Button(
|
491 |
+
# value="👇 B is better", visible=False, interactive=False
|
492 |
# )
|
493 |
# align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
494 |
# align_bothbad_btn = gr.Button(
|
|
|
505 |
|
506 |
states = [state_0, state_1]
|
507 |
model_selectors = [model_selector_left, model_selector_right]
|
508 |
+
results = [geo_left, normal_left, rgb_left, geo_right, normal_right, rgb_right]
|
509 |
|
510 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
511 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
|
|
685 |
show_label=False
|
686 |
)
|
687 |
|
688 |
+
with gr.Row():
|
689 |
+
geo = gr.Image(label="Geometry", interactive=False, show_download_button=True)
|
690 |
+
normal = gr.Image(label="Normal", interactive=False, show_download_button=True)
|
691 |
+
rgb = gr.Image(label="RGB", interactive=False, show_download_button=True)
|
692 |
+
|
693 |
with gr.Row():
|
694 |
with gr.Column():
|
695 |
imagebox = gr.Image(
|
696 |
show_label=False,
|
697 |
visible=True,
|
698 |
interactive=False, ## only support offline
|
699 |
+
label = "Prompt",
|
700 |
elem_id="input_box",
|
|
|
701 |
)
|
702 |
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
703 |
|
704 |
+
with gr.Column(scale=2.0):
|
705 |
+
plausive_md = gr.Markdown("Geometry Plausibility: ", elem_id="evaldim_markdown")
|
706 |
+
with gr.Row(elem_id="Geometry Plausibility"):
|
707 |
+
plausive_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
708 |
+
plausive_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
709 |
+
plausive_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
710 |
+
|
711 |
+
geo_md = gr.Markdown("Geometry Details: ", elem_id="evaldim_markdown")
|
712 |
+
with gr.Row(elem_id="Geometry Details"):
|
713 |
+
geo_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
714 |
+
geo_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
715 |
+
geo_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
716 |
+
|
717 |
+
text_md = gr.Markdown("Texture Quality: ", elem_id="evaldim_markdown")
|
718 |
+
with gr.Row(elem_id="Texture Quality"):
|
719 |
+
text_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
720 |
+
text_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
721 |
+
text_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
722 |
+
|
723 |
+
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", elem_id="evaldim_markdown")
|
724 |
+
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
725 |
+
coherence_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
726 |
+
coherence_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
727 |
+
coherence_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
728 |
+
|
729 |
+
align_md = gr.Markdown("Visual Alignment: ", elem_id="evaldim_markdown")
|
730 |
+
with gr.Row(elem_id="Visual Alignment"):
|
731 |
+
align_upvote_btn = gr.Button(value="👍 Upvote", interactive=False)
|
732 |
+
align_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
733 |
+
align_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
734 |
|
735 |
|
736 |
with gr.Row():
|
|
|
772 |
model_selector.change(
|
773 |
clear_i2s_history,
|
774 |
None,
|
775 |
+
[state, imagebox, geo, normal, rgb],
|
776 |
api_name="clear_history_single",
|
777 |
show_progress="full"
|
778 |
).then(
|
|
|
789 |
).then(
|
790 |
reset_state,
|
791 |
state,
|
792 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
793 |
)
|
794 |
|
795 |
imagebox.upload(
|
796 |
reset_state,
|
797 |
state,
|
798 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
799 |
).then(
|
800 |
gen_func,
|
801 |
[state, imagebox, model_selector],
|
802 |
+
[state, geo, normal, rgb],
|
803 |
api_name="submit_btn_single",
|
804 |
show_progress = "full"
|
805 |
).then(
|
|
|
811 |
send_btn.click(
|
812 |
reset_state,
|
813 |
state,
|
814 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
815 |
).then(
|
816 |
gen_func,
|
817 |
[state, imagebox, model_selector],
|
818 |
+
[state, geo, normal, rgb],
|
819 |
api_name="send_btn_single",
|
820 |
show_progress = "full"
|
821 |
).then(
|
|
|
827 |
clear_btn.click(
|
828 |
clear_i2s_history,
|
829 |
None,
|
830 |
+
[state, imagebox, geo, normal, rgb],
|
831 |
api_name="clear_history_single",
|
832 |
show_progress="full"
|
833 |
).then(
|
|
|
839 |
regenerate_btn.click(
|
840 |
reset_state,
|
841 |
state,
|
842 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
843 |
).then(
|
844 |
gen_func,
|
845 |
[state, imagebox, model_selector],
|
846 |
+
[state, geo, normal, rgb],
|
847 |
api_name="regenerate_btn_single",
|
848 |
show_progress = "full"
|
849 |
).then(
|
serve/gradio_web_t2s.py
CHANGED
@@ -56,94 +56,19 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
56 |
with gr.Accordion("🔍 Expand to see all Arena players", open=False):
|
57 |
model_description_md = get_model_description_md(model_list)
|
58 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
59 |
-
with gr.
|
60 |
-
with gr.
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
)
|
69 |
-
|
70 |
-
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
71 |
-
with gr.Row(elem_id="Geometry Plausibility"):
|
72 |
-
plausive_leftvote_btn = gr.Button(
|
73 |
-
value="👈 A is better", visible=False, interactive=False
|
74 |
-
)
|
75 |
-
plausive_rightvote_btn = gr.Button(
|
76 |
-
value="👉 B is better", visible=False, interactive=False
|
77 |
-
)
|
78 |
-
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
79 |
-
plausive_bothbad_btn = gr.Button(
|
80 |
-
value="👎 Both are bad", visible=False, interactive=False
|
81 |
-
)
|
82 |
-
|
83 |
-
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
84 |
-
with gr.Row(elem_id="Geometry Details"):
|
85 |
-
geo_leftvote_btn = gr.Button(
|
86 |
-
value="👈 A is better", visible=False, interactive=False
|
87 |
-
)
|
88 |
-
geo_rightvote_btn = gr.Button(
|
89 |
-
value="👉 B is better", visible=False, interactive=False
|
90 |
-
)
|
91 |
-
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
92 |
-
geo_bothbad_btn = gr.Button(
|
93 |
-
value="👎 Both are bad", visible=False, interactive=False
|
94 |
-
)
|
95 |
-
|
96 |
-
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
97 |
-
with gr.Row(elem_id="Texture Quality"):
|
98 |
-
text_leftvote_btn = gr.Button(
|
99 |
-
value="👈 A is better", visible=False, interactive=False
|
100 |
-
)
|
101 |
-
text_rightvote_btn = gr.Button(
|
102 |
-
value="👉 B is better", visible=False, interactive=False
|
103 |
-
)
|
104 |
-
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
105 |
-
text_bothbad_btn = gr.Button(
|
106 |
-
value="👎 Both are bad", visible=False, interactive=False
|
107 |
-
)
|
108 |
-
|
109 |
-
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
110 |
-
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
111 |
-
coherence_leftvote_btn = gr.Button(
|
112 |
-
value="👈 A is better", visible=False, interactive=False
|
113 |
-
)
|
114 |
-
coherence_rightvote_btn = gr.Button(
|
115 |
-
value="👉 B is better", visible=False, interactive=False
|
116 |
-
)
|
117 |
-
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
118 |
-
coherence_bothbad_btn = gr.Button(
|
119 |
-
value="👎 Both are bad", visible=False, interactive=False
|
120 |
-
)
|
121 |
-
|
122 |
-
align_md = gr.Markdown("Semantic Alignment: ", visible=False, elem_id="evaldim_markdown")
|
123 |
-
with gr.Row(elem_id="Semantic Alignment"):
|
124 |
-
align_leftvote_btn = gr.Button(
|
125 |
-
value="👈 A is better", visible=False, interactive=False
|
126 |
-
)
|
127 |
-
align_rightvote_btn = gr.Button(
|
128 |
-
value="👉 B is better", visible=False, interactive=False
|
129 |
-
)
|
130 |
-
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
131 |
-
align_bothbad_btn = gr.Button(
|
132 |
-
value="👎 Both are bad", visible=False, interactive=False
|
133 |
-
)
|
134 |
-
|
135 |
-
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
136 |
-
|
137 |
-
with gr.Column():
|
138 |
-
normal_left = gr.Image(width=512, label = "Normal A", show_download_button=True)
|
139 |
-
rgb_left = gr.Image(width=512, label = "RGB A", show_download_button=True)
|
140 |
-
with gr.Column():
|
141 |
-
normal_right = gr.Image(width=512, label = "Normal B", show_download_button=True,)
|
142 |
-
rgb_right = gr.Image(width=512, label = "RGB B", show_download_button=True,)
|
143 |
|
144 |
with gr.Row():
|
145 |
-
with gr.Column():
|
146 |
-
|
147 |
with gr.Column():
|
148 |
model_selector_left =gr.Markdown("", visible=False)
|
149 |
with gr.Column():
|
@@ -151,93 +76,93 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
151 |
with gr.Row():
|
152 |
slow_warning = gr.Markdown("", elem_id="notice_markdown")
|
153 |
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
|
230 |
with gr.Row():
|
231 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
232 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
233 |
share_btn = gr.Button(value="📷 Share")
|
234 |
-
send_btn = gr.Button(value="📤 Send", variant="primary")
|
235 |
|
236 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
237 |
|
238 |
states = [state_0, state_1]
|
239 |
model_selectors = [model_selector_left, model_selector_right]
|
240 |
-
results = [normal_left, rgb_left, normal_right, rgb_right]
|
241 |
|
242 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
243 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
@@ -391,8 +316,8 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
391 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
392 |
|
393 |
with gr.Row():
|
394 |
-
with gr.Column():
|
395 |
-
|
396 |
with gr.Column():
|
397 |
model_selector_left = gr.Dropdown(
|
398 |
choices=model_list,
|
@@ -410,105 +335,105 @@ Find out who is the 🥇conditional image generation models! More models are goi
|
|
410 |
container=False,
|
411 |
)
|
412 |
|
413 |
-
with gr.
|
414 |
-
with gr.
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
)
|
423 |
-
|
424 |
-
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
425 |
-
with gr.Row(elem_id="Geometry Plausibility"):
|
426 |
-
plausive_leftvote_btn = gr.Button(
|
427 |
-
value="👈 A is better", visible=False, interactive=False
|
428 |
-
)
|
429 |
-
plausive_rightvote_btn = gr.Button(
|
430 |
-
value="👉 B is better", visible=False, interactive=False
|
431 |
-
)
|
432 |
-
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
433 |
-
plausive_bothbad_btn = gr.Button(
|
434 |
-
value="👎 Both are bad", visible=False, interactive=False
|
435 |
-
)
|
436 |
-
|
437 |
-
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
438 |
-
with gr.Row(elem_id="Geometry Details"):
|
439 |
-
geo_leftvote_btn = gr.Button(
|
440 |
-
value="👈 A is better", visible=False, interactive=False
|
441 |
-
)
|
442 |
-
geo_rightvote_btn = gr.Button(
|
443 |
-
value="👉 B is better", visible=False, interactive=False
|
444 |
-
)
|
445 |
-
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
446 |
-
geo_bothbad_btn = gr.Button(
|
447 |
-
value="👎 Both are bad", visible=False, interactive=False
|
448 |
-
)
|
449 |
|
450 |
-
|
451 |
-
|
452 |
-
text_leftvote_btn = gr.Button(
|
453 |
-
value="👈 A is better", visible=False, interactive=False
|
454 |
-
)
|
455 |
-
text_rightvote_btn = gr.Button(
|
456 |
-
value="👉 B is better", visible=False, interactive=False
|
457 |
-
)
|
458 |
-
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
459 |
-
text_bothbad_btn = gr.Button(
|
460 |
-
value="👎 Both are bad", visible=False, interactive=False
|
461 |
-
)
|
462 |
-
|
463 |
-
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
464 |
-
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
465 |
-
coherence_leftvote_btn = gr.Button(
|
466 |
-
value="👈 A is better", visible=False, interactive=False
|
467 |
-
)
|
468 |
-
coherence_rightvote_btn = gr.Button(
|
469 |
-
value="👉 B is better", visible=False, interactive=False
|
470 |
-
)
|
471 |
-
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
472 |
-
coherence_bothbad_btn = gr.Button(
|
473 |
-
value="👎 Both are bad", visible=False, interactive=False
|
474 |
-
)
|
475 |
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
|
498 |
-
|
499 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
|
501 |
with gr.Row():
|
502 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
503 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
504 |
share_btn = gr.Button(value="📷 Share")
|
505 |
-
send_btn = gr.Button(value="📤 Send", variant="primary")
|
506 |
|
507 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
508 |
|
509 |
states = [state_0, state_1]
|
510 |
model_selectors = [model_selector_left, model_selector_right]
|
511 |
-
results = [normal_left, rgb_left, normal_right, rgb_right]
|
512 |
|
513 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
514 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
@@ -689,18 +614,9 @@ def build_t2s_ui_single_model(models):
|
|
689 |
)
|
690 |
|
691 |
with gr.Row():
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
placeholder="👉 Enter your prompt or Sample a random prompt, and press 'Send'",
|
696 |
-
container=True,
|
697 |
-
elem_id="input_box",
|
698 |
-
lines=15,
|
699 |
-
interactive=False, ## only support offline
|
700 |
-
)
|
701 |
-
sample_btn = gr.Button(value="🎲 Sample", variant="primary")
|
702 |
-
normal = gr.Image(width=512, label = "Normal", show_download_button=True)
|
703 |
-
rgb = gr.Image(width=512, label = "RGB", show_download_button=True,)
|
704 |
|
705 |
with gr.Row(elem_id="Geometry Plausibility"):
|
706 |
plausive_md = gr.Markdown("Geometry Plausibility: ", elem_id="evaldim_markdown")
|
@@ -732,10 +648,20 @@ def build_t2s_ui_single_model(models):
|
|
732 |
align_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
733 |
align_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
734 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
735 |
with gr.Row():
|
736 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
737 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
738 |
-
send_btn = gr.Button(value="📤 Send", variant="primary")
|
739 |
|
740 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
741 |
|
@@ -771,7 +697,7 @@ def build_t2s_ui_single_model(models):
|
|
771 |
model_selector.change(
|
772 |
clear_t2s_history,
|
773 |
None,
|
774 |
-
[state, textbox, normal, rgb],
|
775 |
api_name="clear_history_single",
|
776 |
show_progress="full"
|
777 |
).then(
|
@@ -788,17 +714,17 @@ def build_t2s_ui_single_model(models):
|
|
788 |
).then(
|
789 |
reset_state,
|
790 |
state,
|
791 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
792 |
)
|
793 |
|
794 |
textbox.submit(
|
795 |
reset_state,
|
796 |
state,
|
797 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
798 |
).then(
|
799 |
gen_func,
|
800 |
[state, textbox, model_selector],
|
801 |
-
[state, normal, rgb],
|
802 |
api_name="submit_btn_single",
|
803 |
show_progress = "full"
|
804 |
).then(
|
@@ -810,11 +736,11 @@ def build_t2s_ui_single_model(models):
|
|
810 |
send_btn.click(
|
811 |
reset_state,
|
812 |
state,
|
813 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
814 |
).then(
|
815 |
gen_func,
|
816 |
[state, textbox, model_selector],
|
817 |
-
[state, normal, rgb],
|
818 |
api_name="send_btn_single",
|
819 |
show_progress = "full"
|
820 |
).then(
|
@@ -826,7 +752,7 @@ def build_t2s_ui_single_model(models):
|
|
826 |
clear_btn.click(
|
827 |
clear_t2s_history,
|
828 |
None,
|
829 |
-
[state, textbox, normal, rgb],
|
830 |
api_name="clear_history_single",
|
831 |
show_progress="full"
|
832 |
).then(
|
@@ -838,11 +764,11 @@ def build_t2s_ui_single_model(models):
|
|
838 |
regenerate_btn.click(
|
839 |
reset_state,
|
840 |
state,
|
841 |
-
[state, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
842 |
).then(
|
843 |
gen_func,
|
844 |
[state, textbox, model_selector],
|
845 |
-
[state, normal, rgb],
|
846 |
api_name="regenerate_btn_single",
|
847 |
show_progress = "full"
|
848 |
).then(
|
|
|
56 |
with gr.Accordion("🔍 Expand to see all Arena players", open=False):
|
57 |
model_description_md = get_model_description_md(model_list)
|
58 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
59 |
+
with gr.Column():
|
60 |
+
with gr.Row():
|
61 |
+
geo_left = gr.Image(label = "Geo A", interactive=False, show_download_button=True)
|
62 |
+
normal_left = gr.Image(label = "Normal A", interactive=False, show_download_button=True)
|
63 |
+
rgb_left = gr.Image(label = "RGB A", interactive=False, show_download_button=True)
|
64 |
+
with gr.Row():
|
65 |
+
geo_right = gr.Image(label = "Geo B", interactive=False, show_download_button=True)
|
66 |
+
normal_right = gr.Image(label = "Normal B", interactive=False, show_download_button=True)
|
67 |
+
rgb_right = gr.Image(label = "RGB B", interactive=False, show_download_button=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
with gr.Row():
|
70 |
+
# with gr.Column():
|
71 |
+
# gr.Markdown("", visible=False)
|
72 |
with gr.Column():
|
73 |
model_selector_left =gr.Markdown("", visible=False)
|
74 |
with gr.Column():
|
|
|
76 |
with gr.Row():
|
77 |
slow_warning = gr.Markdown("", elem_id="notice_markdown")
|
78 |
|
79 |
+
with gr.Row(elem_id="Geometry Plausibility"):
|
80 |
+
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
81 |
+
plausive_leftvote_btn = gr.Button(
|
82 |
+
value="👆 A is better", visible=False, interactive=False
|
83 |
+
)
|
84 |
+
plausive_rightvote_btn = gr.Button(
|
85 |
+
value="👇 B is better", visible=False, interactive=False
|
86 |
+
)
|
87 |
+
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
88 |
+
plausive_bothbad_btn = gr.Button(
|
89 |
+
value="👎 Both are bad", visible=False, interactive=False
|
90 |
+
)
|
91 |
+
|
92 |
+
with gr.Row(elem_id="Geometry Details"):
|
93 |
+
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
94 |
+
geo_leftvote_btn = gr.Button(
|
95 |
+
value="👆 A is better", visible=False, interactive=False
|
96 |
+
)
|
97 |
+
geo_rightvote_btn = gr.Button(
|
98 |
+
value="👇 B is better", visible=False, interactive=False
|
99 |
+
)
|
100 |
+
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
101 |
+
geo_bothbad_btn = gr.Button(
|
102 |
+
value="👎 Both are bad", visible=False, interactive=False
|
103 |
+
)
|
104 |
+
|
105 |
+
with gr.Row(elem_id="Texture Quality"):
|
106 |
+
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
107 |
+
text_leftvote_btn = gr.Button(
|
108 |
+
value="👆 A is better", visible=False, interactive=False
|
109 |
+
)
|
110 |
+
text_rightvote_btn = gr.Button(
|
111 |
+
value="👇 B is better", visible=False, interactive=False
|
112 |
+
)
|
113 |
+
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
114 |
+
text_bothbad_btn = gr.Button(
|
115 |
+
value="👎 Both are bad", visible=False, interactive=False
|
116 |
+
)
|
117 |
|
118 |
+
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
119 |
+
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
120 |
+
coherence_leftvote_btn = gr.Button(
|
121 |
+
value="👆 A is better", visible=False, interactive=False
|
122 |
+
)
|
123 |
+
coherence_rightvote_btn = gr.Button(
|
124 |
+
value="👇 B is better", visible=False, interactive=False
|
125 |
+
)
|
126 |
+
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
127 |
+
coherence_bothbad_btn = gr.Button(
|
128 |
+
value="👎 Both are bad", visible=False, interactive=False
|
129 |
+
)
|
130 |
+
|
131 |
+
with gr.Row(elem_id="Semantic Alignment"):
|
132 |
+
align_md = gr.Markdown("Semantic Alignment: ", visible=False, elem_id="evaldim_markdown")
|
133 |
+
align_leftvote_btn = gr.Button(
|
134 |
+
value="👆 A is better", visible=False, interactive=False
|
135 |
+
)
|
136 |
+
align_rightvote_btn = gr.Button(
|
137 |
+
value="👇 B is better", visible=False, interactive=False
|
138 |
+
)
|
139 |
+
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
140 |
+
align_bothbad_btn = gr.Button(
|
141 |
+
value="👎 Both are bad", visible=False, interactive=False
|
142 |
+
)
|
143 |
+
|
144 |
+
with gr.Row():
|
145 |
+
textbox = gr.Textbox(
|
146 |
+
show_label=False,
|
147 |
+
placeholder="👉 Sample a random prompt, and press ENTER",
|
148 |
+
container=True,
|
149 |
+
elem_id="input_box",
|
150 |
+
interactive=False, ## only support offline
|
151 |
+
)
|
152 |
+
sample_btn = gr.Button(value="🎲 Sample", variant="primary", scale=0)
|
153 |
+
send_btn = gr.Button(value="📤 Send", variant="primary", scale=0)
|
154 |
|
155 |
with gr.Row():
|
156 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
157 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
158 |
share_btn = gr.Button(value="📷 Share")
|
159 |
+
# send_btn = gr.Button(value="📤 Send", variant="primary")
|
160 |
|
161 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
162 |
|
163 |
states = [state_0, state_1]
|
164 |
model_selectors = [model_selector_left, model_selector_right]
|
165 |
+
results = [geo_left, normal_left, rgb_left, geo_right, normal_right, rgb_right]
|
166 |
|
167 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
168 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
|
|
316 |
gr.Markdown(model_description_md, elem_id="model_description_markdown")
|
317 |
|
318 |
with gr.Row():
|
319 |
+
# with gr.Column():
|
320 |
+
# gr.Markdown("Select Players:", elem_id="evaldim_markdown")
|
321 |
with gr.Column():
|
322 |
model_selector_left = gr.Dropdown(
|
323 |
choices=model_list,
|
|
|
335 |
container=False,
|
336 |
)
|
337 |
|
338 |
+
with gr.Column():
|
339 |
+
with gr.Row():
|
340 |
+
geo_left = gr.Image(label = "Geo A", interactive=False, show_download_button=True)
|
341 |
+
normal_left = gr.Image(label = "Normal A", interactive=False, show_download_button=True)
|
342 |
+
rgb_left = gr.Image(label = "RGB A", interactive=False, show_download_button=True)
|
343 |
+
with gr.Row():
|
344 |
+
geo_right = gr.Image(label = "Geo B", interactive=False, show_download_button=True)
|
345 |
+
normal_right = gr.Image(label = "Normal B", interactive=False, show_download_button=True)
|
346 |
+
rgb_right = gr.Image(label = "RGB B", interactive=False, show_download_button=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
|
348 |
+
with gr.Row():
|
349 |
+
slow_warning = gr.Markdown("", elem_id="notice_markdown")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
|
351 |
+
with gr.Row(elem_id="Geometry Plausibility"):
|
352 |
+
plausive_md = gr.Markdown("Geometry Plausibility: ", visible=False, elem_id="evaldim_markdown")
|
353 |
+
plausive_leftvote_btn = gr.Button(
|
354 |
+
value="👆 A is better", visible=False, interactive=False
|
355 |
+
)
|
356 |
+
plausive_rightvote_btn = gr.Button(
|
357 |
+
value="👇 B is better", visible=False, interactive=False
|
358 |
+
)
|
359 |
+
plausive_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
360 |
+
plausive_bothbad_btn = gr.Button(
|
361 |
+
value="👎 Both are bad", visible=False, interactive=False
|
362 |
+
)
|
363 |
+
|
364 |
+
with gr.Row(elem_id="Geometry Details"):
|
365 |
+
geo_md = gr.Markdown("Geometry Details: ", visible=False, elem_id="evaldim_markdown")
|
366 |
+
geo_leftvote_btn = gr.Button(
|
367 |
+
value="👆 A is better", visible=False, interactive=False
|
368 |
+
)
|
369 |
+
geo_rightvote_btn = gr.Button(
|
370 |
+
value="👇 B is better", visible=False, interactive=False
|
371 |
+
)
|
372 |
+
geo_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
373 |
+
geo_bothbad_btn = gr.Button(
|
374 |
+
value="👎 Both are bad", visible=False, interactive=False
|
375 |
+
)
|
376 |
|
377 |
+
with gr.Row(elem_id="Texture Quality"):
|
378 |
+
text_md = gr.Markdown("Texture Quality: ", visible=False, elem_id="evaldim_markdown")
|
379 |
+
text_leftvote_btn = gr.Button(
|
380 |
+
value="👆 A is better", visible=False, interactive=False
|
381 |
+
)
|
382 |
+
text_rightvote_btn = gr.Button(
|
383 |
+
value="👇 B is better", visible=False, interactive=False
|
384 |
+
)
|
385 |
+
text_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
386 |
+
text_bothbad_btn = gr.Button(
|
387 |
+
value="👎 Both are bad", visible=False, interactive=False
|
388 |
+
)
|
389 |
+
|
390 |
+
with gr.Row(elem_id="Geometry-Texture Coherency"):
|
391 |
+
coherence_md = gr.Markdown("Geometry-Texture Coherency: ", visible=False, elem_id="evaldim_markdown")
|
392 |
+
coherence_leftvote_btn = gr.Button(
|
393 |
+
value="👆 A is better", visible=False, interactive=False
|
394 |
+
)
|
395 |
+
coherence_rightvote_btn = gr.Button(
|
396 |
+
value="👇 B is better", visible=False, interactive=False
|
397 |
+
)
|
398 |
+
coherence_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
399 |
+
coherence_bothbad_btn = gr.Button(
|
400 |
+
value="👎 Both are bad", visible=False, interactive=False
|
401 |
+
)
|
402 |
|
403 |
+
with gr.Row(elem_id="Semantic Alignment"):
|
404 |
+
align_md = gr.Markdown("Semantic Alignment: ", visible=False, elem_id="evaldim_markdown")
|
405 |
+
align_leftvote_btn = gr.Button(
|
406 |
+
value="👆 A is better", visible=False, interactive=False
|
407 |
+
)
|
408 |
+
align_rightvote_btn = gr.Button(
|
409 |
+
value="👇 B is better", visible=False, interactive=False
|
410 |
+
)
|
411 |
+
align_tie_btn = gr.Button(value="🤝 Tie", visible=False, interactive=False)
|
412 |
+
align_bothbad_btn = gr.Button(
|
413 |
+
value="👎 Both are bad", visible=False, interactive=False
|
414 |
+
)
|
415 |
|
416 |
+
with gr.Row():
|
417 |
+
textbox = gr.Textbox(
|
418 |
+
show_label=False,
|
419 |
+
placeholder="👉 Sample a random prompt, sand press 'Send'",
|
420 |
+
container=True,
|
421 |
+
elem_id="input_box",
|
422 |
+
interactive=False, ## only support offline
|
423 |
+
)
|
424 |
+
sample_btn = gr.Button(value="🎲 Sample", variant="primary", scale=0)
|
425 |
+
send_btn = gr.Button(value="📤 Send", variant="primary", scale=0)
|
426 |
|
427 |
with gr.Row():
|
428 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
429 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
430 |
share_btn = gr.Button(value="📷 Share")
|
|
|
431 |
|
432 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
433 |
|
434 |
states = [state_0, state_1]
|
435 |
model_selectors = [model_selector_left, model_selector_right]
|
436 |
+
results = [geo_left, normal_left, rgb_left, geo_right, normal_right, rgb_right]
|
437 |
|
438 |
geo_btn_list = [geo_leftvote_btn, geo_rightvote_btn, geo_tie_btn, geo_bothbad_btn]
|
439 |
text_btn_list = [text_leftvote_btn, text_rightvote_btn, text_tie_btn, text_bothbad_btn]
|
|
|
614 |
)
|
615 |
|
616 |
with gr.Row():
|
617 |
+
geo = gr.Image(label = "Geo", interactive=False, show_download_button=True)
|
618 |
+
normal = gr.Image(label = "Normal", interactive=False, show_download_button=True)
|
619 |
+
rgb = gr.Image(label = "RGB", interactive=False, show_download_button=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
|
621 |
with gr.Row(elem_id="Geometry Plausibility"):
|
622 |
plausive_md = gr.Markdown("Geometry Plausibility: ", elem_id="evaldim_markdown")
|
|
|
648 |
align_downvote_btn = gr.Button(value="👎 Downvote", interactive=False)
|
649 |
align_flag_btn = gr.Button(value="⚠️ Flag", interactive=False)
|
650 |
|
651 |
+
with gr.Row():
|
652 |
+
textbox = gr.Textbox(
|
653 |
+
show_label=False,
|
654 |
+
placeholder="👉 Sample a random prompt, and press 'Send'",
|
655 |
+
container=True,
|
656 |
+
elem_id="input_box",
|
657 |
+
interactive=False, ## only support offline
|
658 |
+
)
|
659 |
+
sample_btn = gr.Button(value="🎲 Sample", variant="primary", scale=0)
|
660 |
+
send_btn = gr.Button(value="📤 Send", variant="primary",scale=0)
|
661 |
+
|
662 |
with gr.Row():
|
663 |
clear_btn = gr.Button(value="🗑️ Clear", interactive=False)
|
664 |
regenerate_btn = gr.Button(value="🔄 Regenerate", interactive=False)
|
|
|
665 |
|
666 |
gr.Markdown(acknowledgment_md, elem_id="ack_markdown")
|
667 |
|
|
|
697 |
model_selector.change(
|
698 |
clear_t2s_history,
|
699 |
None,
|
700 |
+
[state, textbox, geo, normal, rgb],
|
701 |
api_name="clear_history_single",
|
702 |
show_progress="full"
|
703 |
).then(
|
|
|
714 |
).then(
|
715 |
reset_state,
|
716 |
state,
|
717 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
718 |
)
|
719 |
|
720 |
textbox.submit(
|
721 |
reset_state,
|
722 |
state,
|
723 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
724 |
).then(
|
725 |
gen_func,
|
726 |
[state, textbox, model_selector],
|
727 |
+
[state, geo, normal, rgb],
|
728 |
api_name="submit_btn_single",
|
729 |
show_progress = "full"
|
730 |
).then(
|
|
|
736 |
send_btn.click(
|
737 |
reset_state,
|
738 |
state,
|
739 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
740 |
).then(
|
741 |
gen_func,
|
742 |
[state, textbox, model_selector],
|
743 |
+
[state, geo, normal, rgb],
|
744 |
api_name="send_btn_single",
|
745 |
show_progress = "full"
|
746 |
).then(
|
|
|
752 |
clear_btn.click(
|
753 |
clear_t2s_history,
|
754 |
None,
|
755 |
+
[state, textbox, geo, normal, rgb],
|
756 |
api_name="clear_history_single",
|
757 |
show_progress="full"
|
758 |
).then(
|
|
|
764 |
regenerate_btn.click(
|
765 |
reset_state,
|
766 |
state,
|
767 |
+
[state, geo, normal, rgb] + vote_btn_list + [regenerate_btn, clear_btn]
|
768 |
).then(
|
769 |
gen_func,
|
770 |
[state, textbox, model_selector],
|
771 |
+
[state, geo, normal, rgb],
|
772 |
api_name="regenerate_btn_single",
|
773 |
show_progress = "full"
|
774 |
).then(
|
serve/inference.py
CHANGED
@@ -15,7 +15,7 @@ class State:
|
|
15 |
def __init__(self,
|
16 |
model_name, i2s_mode=False, offline=False,
|
17 |
prompt=None, image=None, offline_idx=None,
|
18 |
-
normal_video=None , rgb_video=None,
|
19 |
evaluted_dims=0):
|
20 |
self.conv_id = uuid.uuid4().hex
|
21 |
self.model_name = model_name
|
@@ -28,6 +28,7 @@ class State:
|
|
28 |
# self.output = None
|
29 |
self.normal_video = normal_video
|
30 |
self.rgb_video = rgb_video
|
|
|
31 |
|
32 |
self.evaluted_dims = evaluted_dims
|
33 |
|
@@ -180,8 +181,9 @@ def generate_t2s(gen_func, render_func,
|
|
180 |
# rgb_video = os.path.join(OFFLINE_DIR, "text2shape", model_name, "rgb", f"{state.offline_idx}.mp4")
|
181 |
|
182 |
state.normal_video = videos['normal']
|
183 |
-
state.rgb_video = videos['rgb']
|
184 |
-
|
|
|
185 |
|
186 |
finish_tstamp = time.time()
|
187 |
# logger.info(f"===output===: {output}")
|
@@ -274,9 +276,11 @@ def generate_t2s_multi(gen_func, render_func,
|
|
274 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
275 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
276 |
|
277 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
278 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
279 |
-
yield state_0, state_1,
|
|
|
|
|
280 |
|
281 |
finish_tstamp = time.time()
|
282 |
# logger.info(f"===output===: {output}")
|
@@ -308,10 +312,12 @@ def generate_t2s_multi(gen_func, render_func,
|
|
308 |
videos_0, videos_1 = render_func(shape_0, model_name_0, shape_1, model_name_1)
|
309 |
finish_time = time.time()
|
310 |
render_time = finish_time - start_time - generate_time
|
311 |
-
|
312 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
313 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
314 |
-
yield state_0, state_1,
|
|
|
|
|
315 |
|
316 |
finish_tstamp = time.time()
|
317 |
# logger.info(f"===output===: {output}")
|
@@ -392,9 +398,11 @@ def generate_t2s_multi_annoy(gen_func, render_func,
|
|
392 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
393 |
|
394 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
395 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
396 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
397 |
-
yield state_0, state_1,
|
|
|
|
|
398 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
399 |
|
400 |
finish_tstamp = time.time()
|
@@ -429,9 +437,11 @@ def generate_t2s_multi_annoy(gen_func, render_func,
|
|
429 |
render_time = finish_time - start_time - generate_time
|
430 |
|
431 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
432 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
433 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
434 |
-
yield state_0, state_1,
|
|
|
|
|
435 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
436 |
|
437 |
finish_tstamp = time.time()
|
@@ -500,7 +510,8 @@ def generate_i2s(gen_func, render_func, state, image, model_name, request: gr.Re
|
|
500 |
|
501 |
state.normal_video = videos['normal']
|
502 |
state.rgb_video = videos['rgb']
|
503 |
-
|
|
|
504 |
|
505 |
finish_tstamp = time.time()
|
506 |
# logger.info(f"===output===: {output}")
|
@@ -589,9 +600,11 @@ def generate_i2s_multi(gen_func, render_func,
|
|
589 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
590 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
591 |
|
592 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
593 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
594 |
-
yield state_0, state_1,
|
|
|
|
|
595 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
596 |
|
597 |
finish_tstamp = time.time()
|
@@ -625,9 +638,11 @@ def generate_i2s_multi(gen_func, render_func,
|
|
625 |
finish_time = time.time()
|
626 |
render_time = finish_time - start_time - generate_time
|
627 |
|
628 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
629 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
630 |
-
yield state_0, state_1,
|
|
|
|
|
631 |
|
632 |
finish_tstamp = time.time()
|
633 |
# logger.info(f"===output===: {output}")
|
@@ -704,9 +719,11 @@ def generate_i2s_multi_annoy(gen_func, render_func,
|
|
704 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
705 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
706 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
707 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
708 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
709 |
-
yield state_0, state_1,
|
|
|
|
|
710 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
711 |
|
712 |
finish_tstamp = time.time()
|
@@ -740,9 +757,11 @@ def generate_i2s_multi_annoy(gen_func, render_func,
|
|
740 |
finish_time = time.time()
|
741 |
render_time = finish_time - start_time - generate_time
|
742 |
|
743 |
-
state_0.normal_video, state_0.rgb_video = videos_0['normal'], videos_0['rgb']
|
744 |
-
state_1.normal_video, state_1.rgb_video = videos_1['normal'], videos_1['rgb']
|
745 |
-
yield state_0, state_1,
|
|
|
|
|
746 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
747 |
|
748 |
finish_tstamp = time.time()
|
|
|
15 |
def __init__(self,
|
16 |
model_name, i2s_mode=False, offline=False,
|
17 |
prompt=None, image=None, offline_idx=None,
|
18 |
+
normal_video=None , rgb_video=None, geo_video=None,
|
19 |
evaluted_dims=0):
|
20 |
self.conv_id = uuid.uuid4().hex
|
21 |
self.model_name = model_name
|
|
|
28 |
# self.output = None
|
29 |
self.normal_video = normal_video
|
30 |
self.rgb_video = rgb_video
|
31 |
+
self.geo_video = geo_video
|
32 |
|
33 |
self.evaluted_dims = evaluted_dims
|
34 |
|
|
|
181 |
# rgb_video = os.path.join(OFFLINE_DIR, "text2shape", model_name, "rgb", f"{state.offline_idx}.mp4")
|
182 |
|
183 |
state.normal_video = videos['normal']
|
184 |
+
state.rgb_video = videos['rgb']
|
185 |
+
state.geo_video = videos['geo']
|
186 |
+
yield state, videos['geo'], videos['normal'], videos['rgb']
|
187 |
|
188 |
finish_tstamp = time.time()
|
189 |
# logger.info(f"===output===: {output}")
|
|
|
276 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
277 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
278 |
|
279 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
280 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
281 |
+
yield state_0, state_1, \
|
282 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
283 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb']
|
284 |
|
285 |
finish_tstamp = time.time()
|
286 |
# logger.info(f"===output===: {output}")
|
|
|
312 |
videos_0, videos_1 = render_func(shape_0, model_name_0, shape_1, model_name_1)
|
313 |
finish_time = time.time()
|
314 |
render_time = finish_time - start_time - generate_time
|
315 |
+
|
316 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
317 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
318 |
+
yield state_0, state_1, \
|
319 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
320 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb']
|
321 |
|
322 |
finish_tstamp = time.time()
|
323 |
# logger.info(f"===output===: {output}")
|
|
|
398 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "text2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
399 |
|
400 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
401 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
402 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
403 |
+
yield state_0, state_1, \
|
404 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
405 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb'], \
|
406 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
407 |
|
408 |
finish_tstamp = time.time()
|
|
|
437 |
render_time = finish_time - start_time - generate_time
|
438 |
|
439 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
440 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
441 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
442 |
+
yield state_0, state_1, \
|
443 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
444 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb'], \
|
445 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
446 |
|
447 |
finish_tstamp = time.time()
|
|
|
510 |
|
511 |
state.normal_video = videos['normal']
|
512 |
state.rgb_video = videos['rgb']
|
513 |
+
state.geo_video = videos['geo']
|
514 |
+
yield state, videos['geo'], videos['normal'], videos['rgb']
|
515 |
|
516 |
finish_tstamp = time.time()
|
517 |
# logger.info(f"===output===: {output}")
|
|
|
600 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
601 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
602 |
|
603 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
604 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
605 |
+
yield state_0, state_1, \
|
606 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
607 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb'], \
|
608 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
609 |
|
610 |
finish_tstamp = time.time()
|
|
|
638 |
finish_time = time.time()
|
639 |
render_time = finish_time - start_time - generate_time
|
640 |
|
641 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
642 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
643 |
+
yield state_0, state_1, \
|
644 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
645 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb']
|
646 |
|
647 |
finish_tstamp = time.time()
|
648 |
# logger.info(f"===output===: {output}")
|
|
|
719 |
# normal_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "normal", f"{state_1.offline_idx}.mp4")
|
720 |
# rgb_video_1 = os.path.join(OFFLINE_DIR, "image2shape", model_name_1, "rgb", f"{state_1.offline_idx}.mp4")
|
721 |
state_0.model_name, state_1.model_name = model_name_0, model_name_1
|
722 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
723 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
724 |
+
yield state_0, state_1, \
|
725 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
726 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb'], \
|
727 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
728 |
|
729 |
finish_tstamp = time.time()
|
|
|
757 |
finish_time = time.time()
|
758 |
render_time = finish_time - start_time - generate_time
|
759 |
|
760 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = videos_0['normal'], videos_0['rgb'], videos_0['geo']
|
761 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = videos_1['normal'], videos_1['rgb'], videos_1['geo']
|
762 |
+
yield state_0, state_1, \
|
763 |
+
videos_0['geo'], videos_0['normal'], videos_0['rgb'], \
|
764 |
+
videos_1['geo'], videos_1['normal'], videos_1['rgb'], \
|
765 |
gr.Markdown(f"### Model A: {model_name_0}"), gr.Markdown(f"### Model B: {model_name_1}")
|
766 |
|
767 |
finish_tstamp = time.time()
|
serve/utils.py
CHANGED
@@ -20,6 +20,7 @@ no_change_btn = gr.update(value="No Change", interactive=True, visible=True)
|
|
20 |
def build_about():
|
21 |
about_markdown = f"""
|
22 |
# About Us
|
|
|
23 |
Supported by Shanghai AI Laboratory
|
24 |
|
25 |
## Contributors:
|
@@ -120,45 +121,45 @@ def disable_buttons():
|
|
120 |
def reset_state(state):
|
121 |
state.normal_video, state.rgb_video = None, None
|
122 |
state.evaluted_dims = 0
|
123 |
-
return (state, None, None) + tuple(gr.update(interactive=False) for _ in range(EVALUATE_DIMS*3 + 2))
|
124 |
|
125 |
def reset_states_side_by_side(state_0, state_1):
|
126 |
-
state_0.normal_video, state_0.rgb_video = None, None
|
127 |
-
state_1.normal_video, state_1.rgb_video = None, None
|
128 |
state_0.evaluted_dims, state_1.evaluted_dims = 0, 0
|
129 |
return (state_0, state_1) \
|
130 |
-
+ (None,) *
|
131 |
+ tuple(gr.update(visible=(i>=EVALUATE_DIMS*4), interactive=False) for i in range(EVALUATE_DIMS*4 + 2)) \
|
132 |
+ tuple(gr.update(visible=False) for _ in range(EVALUATE_DIMS))
|
133 |
|
134 |
def reset_states_side_by_side_anony(state_0, state_1):
|
135 |
state_0.model_name, state_1.model_name = "", ""
|
136 |
-
state_0.normal_video, state_0.rgb_video = None, None
|
137 |
-
state_1.normal_video, state_1.rgb_video = None, None
|
138 |
state_0.evaluted_dims, state_1.evaluted_dims = 0, 0
|
139 |
return (state_0, state_1) \
|
140 |
+ (gr.Markdown("", visible=False), gr.Markdown("", visible=False))\
|
141 |
-
+ (None,) *
|
142 |
+ tuple(gr.update(visible=(i>=EVALUATE_DIMS*4), interactive=False) for i in range(EVALUATE_DIMS*4 + 2)) \
|
143 |
+ tuple(gr.update(visible=False) for _ in range(EVALUATE_DIMS))
|
144 |
|
145 |
def clear_t2s_history():
|
146 |
-
return None, "", None, None
|
147 |
|
148 |
def clear_t2s_history_side_by_side():
|
149 |
-
return [None] * 2 + [""] + [None] *
|
150 |
|
151 |
def clear_t2s_history_side_by_side_anony():
|
152 |
-
return [None] * 2 + [""] + [None] *
|
153 |
|
154 |
def clear_i2s_history():
|
155 |
-
return None, None, None, None
|
156 |
|
157 |
def clear_i2s_history_side_by_side():
|
158 |
-
return [None] * 2 + [None] + [None] *
|
159 |
|
160 |
def clear_i2s_history_side_by_side_anony():
|
161 |
-
return [None] * 2 + [None] + [None] *
|
162 |
|
163 |
def get_ip(request: gr.Request):
|
164 |
if request:
|
|
|
20 |
def build_about():
|
21 |
about_markdown = f"""
|
22 |
# About Us
|
23 |
+
Only offline services are available currently, online services are coming soon!
|
24 |
Supported by Shanghai AI Laboratory
|
25 |
|
26 |
## Contributors:
|
|
|
121 |
def reset_state(state):
|
122 |
state.normal_video, state.rgb_video = None, None
|
123 |
state.evaluted_dims = 0
|
124 |
+
return (state, None, None, None) + tuple(gr.update(interactive=False) for _ in range(EVALUATE_DIMS*3 + 2))
|
125 |
|
126 |
def reset_states_side_by_side(state_0, state_1):
|
127 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = None, None, None
|
128 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = None, None, None
|
129 |
state_0.evaluted_dims, state_1.evaluted_dims = 0, 0
|
130 |
return (state_0, state_1) \
|
131 |
+
+ (None,) * 6\
|
132 |
+ tuple(gr.update(visible=(i>=EVALUATE_DIMS*4), interactive=False) for i in range(EVALUATE_DIMS*4 + 2)) \
|
133 |
+ tuple(gr.update(visible=False) for _ in range(EVALUATE_DIMS))
|
134 |
|
135 |
def reset_states_side_by_side_anony(state_0, state_1):
|
136 |
state_0.model_name, state_1.model_name = "", ""
|
137 |
+
state_0.normal_video, state_0.rgb_video, state_0.geo_video = None, None, None
|
138 |
+
state_1.normal_video, state_1.rgb_video, state_1.geo_video = None, None, None
|
139 |
state_0.evaluted_dims, state_1.evaluted_dims = 0, 0
|
140 |
return (state_0, state_1) \
|
141 |
+ (gr.Markdown("", visible=False), gr.Markdown("", visible=False))\
|
142 |
+
+ (None,) * 6 \
|
143 |
+ tuple(gr.update(visible=(i>=EVALUATE_DIMS*4), interactive=False) for i in range(EVALUATE_DIMS*4 + 2)) \
|
144 |
+ tuple(gr.update(visible=False) for _ in range(EVALUATE_DIMS))
|
145 |
|
146 |
def clear_t2s_history():
|
147 |
+
return None, "", None, None, None
|
148 |
|
149 |
def clear_t2s_history_side_by_side():
|
150 |
+
return [None] * 2 + [""] + [None] * 6
|
151 |
|
152 |
def clear_t2s_history_side_by_side_anony():
|
153 |
+
return [None] * 2 + [""] + [None] * 6 + [gr.Markdown("", visible=False), gr.Markdown("", visible=False)]
|
154 |
|
155 |
def clear_i2s_history():
|
156 |
+
return None, None, None, None, None
|
157 |
|
158 |
def clear_i2s_history_side_by_side():
|
159 |
+
return [None] * 2 + [None] + [None] * 6
|
160 |
|
161 |
def clear_i2s_history_side_by_side_anony():
|
162 |
+
return [None] * 2 + [None] + [None] * 6 + [gr.Markdown("", visible=False), gr.Markdown("", visible=False)]
|
163 |
|
164 |
def get_ip(request: gr.Request):
|
165 |
if request:
|