Spaces:
Paused
Paused
update layout
Browse files
app.py
CHANGED
|
@@ -308,7 +308,6 @@ def update_app(decision, data, current_index, history, username):
|
|
| 308 |
|
| 309 |
newcss = """
|
| 310 |
#query_image{
|
| 311 |
-
height: auto !important;
|
| 312 |
}
|
| 313 |
|
| 314 |
#nn_gallery {
|
|
@@ -318,6 +317,30 @@ newcss = """
|
|
| 318 |
#sample_gallery {
|
| 319 |
height: auto !important;
|
| 320 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
"""
|
| 322 |
|
| 323 |
with gr.Blocks(css=newcss, theme=gr.themes.Soft()) as demo:
|
|
@@ -358,9 +381,12 @@ with gr.Blocks(css=newcss, theme=gr.themes.Soft()) as demo:
|
|
| 358 |
accept_btn = gr.Button(value="Accept")
|
| 359 |
myabe_btn = gr.Button(value="Not Sure!")
|
| 360 |
reject_btn = gr.Button(value="Reject")
|
| 361 |
-
with gr.Row(
|
| 362 |
query_image = gr.Image(type="pil", label="Query", elem_id="query_image")
|
| 363 |
-
with gr.Column(
|
|
|
|
|
|
|
|
|
|
| 364 |
label_plot = gr.Plot(
|
| 365 |
label="Is this a correct label for this image?", type="fig"
|
| 366 |
)
|
|
@@ -423,4 +449,5 @@ with gr.Blocks(css=newcss, theme=gr.themes.Soft()) as demo:
|
|
| 423 |
],
|
| 424 |
)
|
| 425 |
|
|
|
|
| 426 |
demo.launch(debug=True)
|
|
|
|
| 308 |
|
| 309 |
newcss = """
|
| 310 |
#query_image{
|
|
|
|
| 311 |
}
|
| 312 |
|
| 313 |
#nn_gallery {
|
|
|
|
| 317 |
#sample_gallery {
|
| 318 |
height: auto !important;
|
| 319 |
}
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
/* Set display to flex for the parent element */
|
| 323 |
+
.svelte-parentrowclass {
|
| 324 |
+
display: flex;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
/* Set the flex-grow property for the children elements */
|
| 328 |
+
.svelte-parentrowclass > #query_image {
|
| 329 |
+
min-width: min(400px, 40%);
|
| 330 |
+
flex : 1;
|
| 331 |
+
flex-grow: 0; !important;
|
| 332 |
+
border-style: solid;
|
| 333 |
+
height: auto !important;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.svelte-parentrowclass > .svelte-rightcolumn {
|
| 337 |
+
flex: 2;
|
| 338 |
+
flex-grow: 0; !important;
|
| 339 |
+
min-width: min(600px, 60%);
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
|
| 343 |
+
|
| 344 |
"""
|
| 345 |
|
| 346 |
with gr.Blocks(css=newcss, theme=gr.themes.Soft()) as demo:
|
|
|
|
| 381 |
accept_btn = gr.Button(value="Accept")
|
| 382 |
myabe_btn = gr.Button(value="Not Sure!")
|
| 383 |
reject_btn = gr.Button(value="Reject")
|
| 384 |
+
with gr.Row(elem_id="parent_row", elem_classes="svelte-parentrowclass"):
|
| 385 |
query_image = gr.Image(type="pil", label="Query", elem_id="query_image")
|
| 386 |
+
with gr.Column(
|
| 387 |
+
elem_id="samples_col",
|
| 388 |
+
elem_classes="svelte-rightcolumn",
|
| 389 |
+
):
|
| 390 |
label_plot = gr.Plot(
|
| 391 |
label="Is this a correct label for this image?", type="fig"
|
| 392 |
)
|
|
|
|
| 449 |
],
|
| 450 |
)
|
| 451 |
|
| 452 |
+
|
| 453 |
demo.launch(debug=True)
|