Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,8 @@ def create_plot(methods_selected, x_metric, y_metric):
|
|
24 |
df = pd.read_csv(CSV_RESULT_PATH)
|
25 |
filtered_df = df[df['Method'].isin(methods_selected)]
|
26 |
|
27 |
-
# Create
|
28 |
-
plt.figure(figsize=(
|
29 |
for method in methods_selected:
|
30 |
method_data = filtered_df[filtered_df['Method'] == method]
|
31 |
plt.plot(method_data[x_metric], method_data[y_metric], label=method, marker='o')
|
@@ -72,14 +72,19 @@ with block:
|
|
72 |
method_names = pd.read_csv(CSV_RESULT_PATH)['Method'].unique().tolist()
|
73 |
metric_names = pd.read_csv(CSV_RESULT_PATH).columns.tolist()
|
74 |
metric_names.remove('Method') # Remove Method from the metric options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
plot_button = gr.Button("Plot")
|
80 |
-
output_plot = gr.Image(label="Plot")
|
81 |
|
82 |
-
|
83 |
|
84 |
# Now the rest of the UI elements as they were before
|
85 |
checkbox_group = gr.CheckboxGroup(
|
|
|
24 |
df = pd.read_csv(CSV_RESULT_PATH)
|
25 |
filtered_df = df[df['Method'].isin(methods_selected)]
|
26 |
|
27 |
+
# Create a larger plot
|
28 |
+
plt.figure(figsize=(10, 8)) # Increase the figure size
|
29 |
for method in methods_selected:
|
30 |
method_data = filtered_df[filtered_df['Method'] == method]
|
31 |
plt.plot(method_data[x_metric], method_data[y_metric], label=method, marker='o')
|
|
|
72 |
method_names = pd.read_csv(CSV_RESULT_PATH)['Method'].unique().tolist()
|
73 |
metric_names = pd.read_csv(CSV_RESULT_PATH).columns.tolist()
|
74 |
metric_names.remove('Method') # Remove Method from the metric options
|
75 |
+
|
76 |
+
# Visualizer Controls: Smaller and underneath each other
|
77 |
+
with gr.Column(scale=1):
|
78 |
+
method_selector = gr.CheckboxGroup(choices=method_names, label="Select Methods", interactive=True)
|
79 |
+
x_metric_selector = gr.Dropdown(choices=metric_names, label="Select X-axis Metric", interactive=True)
|
80 |
+
y_metric_selector = gr.Dropdown(choices=metric_names, label="Select Y-axis Metric", interactive=True)
|
81 |
+
plot_button = gr.Button("Plot")
|
82 |
|
83 |
+
# Larger plot display
|
84 |
+
with gr.Column(scale=3):
|
85 |
+
output_plot = gr.Image(label="Plot", height=480) # Set larger height for the plot
|
|
|
|
|
86 |
|
87 |
+
plot_button.click(create_plot, inputs=[method_selector, x_metric_selector, y_metric_selector], outputs=output_plot)
|
88 |
|
89 |
# Now the rest of the UI elements as they were before
|
90 |
checkbox_group = gr.CheckboxGroup(
|