Spaces:
Runtime error
Runtime error
ariankhalfani
commited on
Commit
•
125f3ef
1
Parent(s):
cac84ce
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import os
|
|
3 |
import numpy as np
|
4 |
from cataract import combined_prediction, save_cataract_prediction_to_db, predict_object_detection
|
5 |
from glaucoma import combined_prediction_glaucoma, submit_to_db, predict_image
|
6 |
-
from database import get_db_data, format_db_data
|
7 |
from chatbot import chatbot, update_patient_history, generate_voice_response
|
8 |
from PIL import Image
|
9 |
|
@@ -220,4 +220,20 @@ with gr.Blocks(theme=theme) as demo:
|
|
220 |
load_db_btn = gr.Button("Load Database Content")
|
221 |
load_db_btn.click(display_db_data, outputs=db_display)
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
demo.launch()
|
|
|
3 |
import numpy as np
|
4 |
from cataract import combined_prediction, save_cataract_prediction_to_db, predict_object_detection
|
5 |
from glaucoma import combined_prediction_glaucoma, submit_to_db, predict_image
|
6 |
+
from database import get_db_data, format_db_data, clear_database
|
7 |
from chatbot import chatbot, update_patient_history, generate_voice_response
|
8 |
from PIL import Image
|
9 |
|
|
|
220 |
load_db_btn = gr.Button("Load Database Content")
|
221 |
load_db_btn.click(display_db_data, outputs=db_display)
|
222 |
|
223 |
+
# Buttons to clear databases
|
224 |
+
clear_cataract_db_btn = gr.Button("Clear Cataract Database")
|
225 |
+
clear_glaucoma_db_btn = gr.Button("Clear Glaucoma Database")
|
226 |
+
|
227 |
+
clear_cataract_db_btn.click(
|
228 |
+
fn=clear_database,
|
229 |
+
inputs=[gr.State(value=db_path_cataract), gr.State(value="cataract_results")],
|
230 |
+
outputs=db_display
|
231 |
+
)
|
232 |
+
|
233 |
+
clear_glaucoma_db_btn.click(
|
234 |
+
fn=clear_database,
|
235 |
+
inputs=[gr.State(value=db_path_glaucoma), gr.State(value="results")],
|
236 |
+
outputs=db_display
|
237 |
+
)
|
238 |
+
|
239 |
demo.launch()
|