Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -572,21 +572,16 @@ with gr.Blocks(css="""
|
|
572 |
with gr.Column():
|
573 |
data_percentage_slider = gr.Slider(label="Data Percentage for Training", minimum=10, maximum=100, step=10, value=10)
|
574 |
task_complexity_dropdown = gr.Dropdown(label="Task Complexity (Number of Beams)", choices=[16, 32, 64, 128, 256], value=16)
|
|
|
575 |
|
576 |
with gr.Row():
|
577 |
raw_img_bp = gr.Image(label="Raw Channels", type="pil", width=300, height=500)
|
578 |
embeddings_img_bp = gr.Image(label="Embeddings", type="pil", width=300, height=500)
|
579 |
-
|
580 |
-
# Use the theme detection from JavaScript
|
581 |
-
theme_output = gr.Textbox(label="Theme", visible=False)
|
582 |
-
# Update the theme on button click (or any event)
|
583 |
-
theme_button = gr.Button("Detect Theme")
|
584 |
-
# Trigger JS to detect theme and set value to theme_output
|
585 |
-
theme_button.click(fn=None, inputs=[], outputs=[theme_output], _js=js_code)
|
586 |
|
587 |
# Update the confusion matrices whenever sliders change
|
588 |
-
data_percentage_slider.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown,
|
589 |
-
task_complexity_dropdown.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown,
|
|
|
590 |
|
591 |
# Add a conclusion section at the bottom
|
592 |
gr.Markdown("""
|
|
|
572 |
with gr.Column():
|
573 |
data_percentage_slider = gr.Slider(label="Data Percentage for Training", minimum=10, maximum=100, step=10, value=10)
|
574 |
task_complexity_dropdown = gr.Dropdown(label="Task Complexity (Number of Beams)", choices=[16, 32, 64, 128, 256], value=16)
|
575 |
+
theme_dropdown = gr.Dropdown(label="Select Theme", choices=['Light', 'Dark'], value='Light')
|
576 |
|
577 |
with gr.Row():
|
578 |
raw_img_bp = gr.Image(label="Raw Channels", type="pil", width=300, height=500)
|
579 |
embeddings_img_bp = gr.Image(label="Embeddings", type="pil", width=300, height=500)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
# Update the confusion matrices whenever sliders change
|
582 |
+
data_percentage_slider.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown, theme_dropdown], outputs=[raw_img_bp, embeddings_img_bp])
|
583 |
+
task_complexity_dropdown.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown, theme_dropdown], outputs=[raw_img_bp, embeddings_img_bp])
|
584 |
+
theme_dropdown.change(fn=beam_prediction_task, inputs=[data_percentage_slider, task_complexity_dropdown, theme_dropdown], outputs=[raw_img_bp, embeddings_img_bp])
|
585 |
|
586 |
# Add a conclusion section at the bottom
|
587 |
gr.Markdown("""
|