Spaces:
Sleeping
Sleeping
Commit
·
3f4e464
1
Parent(s):
e4dcaa1
updated app.py
Browse files
app.py
CHANGED
|
@@ -250,8 +250,8 @@ def render_workspace(mode, history, specific_index=None, move_back=False):
|
|
| 250 |
v_chk = saved_vals.get(u, {}).get('is_correct', True)
|
| 251 |
|
| 252 |
if mode == "label":
|
| 253 |
-
updates[c_sld] = gr.update(visible=True, value=v_sc)
|
| 254 |
-
updates[c_drp] = gr.update(visible=True, value=v_lbl)
|
| 255 |
updates[c_chk] = gr.update(visible=False)
|
| 256 |
updates[c_lbl] = gr.update(visible=False)
|
| 257 |
else:
|
|
@@ -260,10 +260,10 @@ def render_workspace(mode, history, specific_index=None, move_back=False):
|
|
| 260 |
|
| 261 |
display_score = v_sc if u in saved_vals else prev_sc
|
| 262 |
|
| 263 |
-
updates[c_sld] = gr.update(visible=True, value=display_score)
|
| 264 |
updates[c_lbl] = gr.update(visible=True, value=f"**Labeled:** {prev_lbl} | **Score:** {prev_sc}")
|
| 265 |
-
updates[c_drp] = gr.update(visible=True, value=v_lbl)
|
| 266 |
-
updates[c_chk] = gr.update(visible=True, value=v_chk)
|
| 267 |
else:
|
| 268 |
updates[img_c] = gr.update(value=None, visible=False)
|
| 269 |
updates[c_sld] = gr.update(visible=False)
|
|
@@ -330,7 +330,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Labeling Tool") as demo:
|
|
| 330 |
with gr.Tab("Workspace", id=0):
|
| 331 |
with gr.Group() as screen_menu:
|
| 332 |
gr.Markdown("# Welcome! 👋")
|
| 333 |
-
gr.Markdown("Persistent & Compatible Version
|
| 334 |
with gr.Row():
|
| 335 |
b_start_l = gr.Button("Start Labeling", variant="primary")
|
| 336 |
b_start_v = gr.Button("Start Verification")
|
|
@@ -345,8 +345,11 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Labeling Tool") as demo:
|
|
| 345 |
with gr.Group():
|
| 346 |
sld = gr.Slider(1, 10, step=1, label="Score", visible=False)
|
| 347 |
lbl = gr.Markdown(visible=False)
|
| 348 |
-
drp = gr.Dropdown(ROOM_CLASSES, label="Class", visible=False)
|
| 349 |
chk = gr.Checkbox(label="Correct?", value=True, visible=False)
|
|
|
|
|
|
|
|
|
|
| 350 |
img_objs.append(img)
|
| 351 |
input_objs.extend([sld, drp, chk, lbl])
|
| 352 |
with gr.Row():
|
|
|
|
| 250 |
v_chk = saved_vals.get(u, {}).get('is_correct', True)
|
| 251 |
|
| 252 |
if mode == "label":
|
| 253 |
+
updates[c_sld] = gr.update(visible=True, value=v_sc, interactive=True)
|
| 254 |
+
updates[c_drp] = gr.update(visible=True, value=v_lbl, interactive=True)
|
| 255 |
updates[c_chk] = gr.update(visible=False)
|
| 256 |
updates[c_lbl] = gr.update(visible=False)
|
| 257 |
else:
|
|
|
|
| 260 |
|
| 261 |
display_score = v_sc if u in saved_vals else prev_sc
|
| 262 |
|
| 263 |
+
updates[c_sld] = gr.update(visible=True, value=display_score, interactive=True)
|
| 264 |
updates[c_lbl] = gr.update(visible=True, value=f"**Labeled:** {prev_lbl} | **Score:** {prev_sc}")
|
| 265 |
+
updates[c_drp] = gr.update(visible=True, value=v_lbl, interactive=True)
|
| 266 |
+
updates[c_chk] = gr.update(visible=True, value=v_chk, interactive=True)
|
| 267 |
else:
|
| 268 |
updates[img_c] = gr.update(value=None, visible=False)
|
| 269 |
updates[c_sld] = gr.update(visible=False)
|
|
|
|
| 330 |
with gr.Tab("Workspace", id=0):
|
| 331 |
with gr.Group() as screen_menu:
|
| 332 |
gr.Markdown("# Welcome! 👋")
|
| 333 |
+
gr.Markdown("Persistent & Compatible Version")
|
| 334 |
with gr.Row():
|
| 335 |
b_start_l = gr.Button("Start Labeling", variant="primary")
|
| 336 |
b_start_v = gr.Button("Start Verification")
|
|
|
|
| 345 |
with gr.Group():
|
| 346 |
sld = gr.Slider(1, 10, step=1, label="Score", visible=False)
|
| 347 |
lbl = gr.Markdown(visible=False)
|
| 348 |
+
drp = gr.Dropdown(ROOM_CLASSES, label="Class", visible=False, interactive=True)
|
| 349 |
chk = gr.Checkbox(label="Correct?", value=True, visible=False)
|
| 350 |
+
|
| 351 |
+
drp.select(fn=lambda: False, outputs=chk)
|
| 352 |
+
|
| 353 |
img_objs.append(img)
|
| 354 |
input_objs.extend([sld, drp, chk, lbl])
|
| 355 |
with gr.Row():
|