ariankhalfani commited on
Commit
d9438ec
1 Parent(s): 30fe27a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -8
app.py CHANGED
@@ -206,15 +206,22 @@ with gr.Blocks() as demo:
206
  with gr.Column():
207
  submit_btn = gr.Button("Submit")
208
  output_image = gr.Image(type="pil", label="Predicted Image")
209
- raw_result = gr.Textbox(label="Raw Result", interactive=False)
210
-
211
- submit_btn.click(fn=interface, inputs=[name, age, medical_record, sex, input_image], outputs=[output_image, raw_result])
212
 
213
  with gr.Row():
214
- download_uploaded_btn = gr.Button("Download Uploaded Folder")
215
- download_predicted_btn = gr.Button("Download Predicted Folder")
216
-
217
- download_uploaded_btn.click(fn=download_uploaded_folder, inputs=[], outputs=gr.File())
218
- download_predicted_btn.click(fn=download_predicted_folder, inputs=[], outputs=gr.File())
 
 
 
 
 
 
 
 
 
 
219
 
220
  demo.launch()
 
206
  with gr.Column():
207
  submit_btn = gr.Button("Submit")
208
  output_image = gr.Image(type="pil", label="Predicted Image")
 
 
 
209
 
210
  with gr.Row():
211
+ raw_result = gr.Textbox(label="Prediction Result")
212
+
213
+ with gr.Row():
214
+ download_xlsx_btn = gr.Button("Download Patient Information (XLSX)")
215
+ download_uploaded_btn = gr.Button("Download Uploaded Images")
216
+ download_predicted_btn = gr.Button("Download Predicted Images")
217
+
218
+ xlsx_file = gr.File(label="Patient Information XLSX File")
219
+ uploaded_folder_file = gr.File(label="Uploaded Images Zip File")
220
+ predicted_folder_file = gr.File(label="Predicted Images Zip File")
221
+
222
+ submit_btn.click(fn=interface, inputs=[name, age, medical_record, sex, input_image], outputs=[output_image, raw_result, xlsx_file])
223
+ download_xlsx_btn.click(fn=lambda: str(xlsx_db_file), outputs=xlsx_file)
224
+ download_uploaded_btn.click(fn=download_uploaded_folder, outputs=uploaded_folder_file)
225
+ download_predicted_btn.click(fn=download_predicted_folder, outputs=predicted_folder_file)
226
 
227
  demo.launch()