Update app.py
Browse files
app.py
CHANGED
|
@@ -529,54 +529,54 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 529 |
label="Details / Debug Info",
|
| 530 |
)
|
| 531 |
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
|
| 581 |
|
| 582 |
# Wiring the button AFTER all components are defined
|
|
|
|
| 529 |
label="Details / Debug Info",
|
| 530 |
)
|
| 531 |
|
| 532 |
+
# ---------------- TAB 2: TAG CONTROL ----------------
|
| 533 |
+
with gr.Tab("Tag Control"):
|
| 534 |
+
gr.Markdown("### Tag Substitutes")
|
| 535 |
+
gr.Markdown(
|
| 536 |
+
"Add rows where **Original Tag** will be replaced by **Substitute Tag** "
|
| 537 |
+
"in the final combined output (after all frames are processed)."
|
| 538 |
+
)
|
| 539 |
|
| 540 |
+
with gr.Row():
|
| 541 |
+
tag_substitutes_df = gr.Dataframe(
|
| 542 |
+
headers=["Original Tag", "Substitute Tag"],
|
| 543 |
+
datatype=["str", "str"],
|
| 544 |
+
row_count=1,
|
| 545 |
+
column_count=2,
|
| 546 |
+
type="array",
|
| 547 |
+
label="Tag Substitutes",
|
| 548 |
+
interactive=True,
|
| 549 |
+
)
|
| 550 |
+
add_sub_row_btn = gr.Button("β Add substitute", scale=0)
|
| 551 |
|
| 552 |
+
gr.Markdown("### Tag Exclusions")
|
| 553 |
+
gr.Markdown(
|
| 554 |
+
"Add tags that should be **removed entirely** from the final combined output."
|
| 555 |
+
)
|
| 556 |
|
| 557 |
+
with gr.Row():
|
| 558 |
+
tag_exclusions_df = gr.Dataframe(
|
| 559 |
+
headers=["Tag to Exclude"],
|
| 560 |
+
datatype=["str"],
|
| 561 |
+
row_count=1,
|
| 562 |
+
column_count=1,
|
| 563 |
+
type="array",
|
| 564 |
+
label="Tag Exclusions",
|
| 565 |
+
interactive=True,
|
| 566 |
+
)
|
| 567 |
+
add_ex_row_btn = gr.Button("β Add exclusion", scale=0)
|
| 568 |
+
|
| 569 |
+
add_sub_row_btn.click(
|
| 570 |
+
fn=add_substitute_row,
|
| 571 |
+
inputs=tag_substitutes_df,
|
| 572 |
+
outputs=tag_substitutes_df,
|
| 573 |
+
)
|
| 574 |
+
|
| 575 |
+
add_ex_row_btn.click(
|
| 576 |
+
fn=add_exclusion_row,
|
| 577 |
+
inputs=tag_exclusions_df,
|
| 578 |
+
outputs=tag_exclusions_df,
|
| 579 |
+
)
|
| 580 |
|
| 581 |
|
| 582 |
# Wiring the button AFTER all components are defined
|