Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,6 +167,14 @@ def end_session():
|
|
| 167 |
|
| 168 |
return filepath, f"✅ Evaluations saved as: {filename}"
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
# Gradio interface
|
| 171 |
with gr.Blocks(title="X-Ray Quality Evaluation") as demo:
|
| 172 |
gr.Markdown("# 🏥 X-Ray Quality Evaluation System")
|
|
@@ -240,12 +248,12 @@ with gr.Blocks(title="X-Ray Quality Evaluation") as demo:
|
|
| 240 |
)
|
| 241 |
|
| 242 |
pref_a.click(
|
| 243 |
-
|
| 244 |
outputs=[image_a, image_b, progress_text, result_message]
|
| 245 |
)
|
| 246 |
|
| 247 |
pref_b.click(
|
| 248 |
-
|
| 249 |
outputs=[image_a, image_b, progress_text, result_message]
|
| 250 |
)
|
| 251 |
|
|
|
|
| 167 |
|
| 168 |
return filepath, f"✅ Evaluations saved as: {filename}"
|
| 169 |
|
| 170 |
+
def get_preference_a():
|
| 171 |
+
"""Wrapper for preference A."""
|
| 172 |
+
return record_preference("A")
|
| 173 |
+
|
| 174 |
+
def get_preference_b():
|
| 175 |
+
"""Wrapper for preference B."""
|
| 176 |
+
return record_preference("B")
|
| 177 |
+
|
| 178 |
# Gradio interface
|
| 179 |
with gr.Blocks(title="X-Ray Quality Evaluation") as demo:
|
| 180 |
gr.Markdown("# 🏥 X-Ray Quality Evaluation System")
|
|
|
|
| 248 |
)
|
| 249 |
|
| 250 |
pref_a.click(
|
| 251 |
+
get_preference_a,
|
| 252 |
outputs=[image_a, image_b, progress_text, result_message]
|
| 253 |
)
|
| 254 |
|
| 255 |
pref_b.click(
|
| 256 |
+
get_preference_b,
|
| 257 |
outputs=[image_a, image_b, progress_text, result_message]
|
| 258 |
)
|
| 259 |
|