haritsahm commited on
Commit
6a34df2
·
1 Parent(s): 3ae607f

Update main func to read from multiple file input

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -116,7 +116,7 @@ def filter_files(files: List) -> List:
116
  return file_paths
117
 
118
 
119
- def predict_bilateral(files):
120
  """Predict Bilateral Mammography.
121
 
122
  Parameters
@@ -130,7 +130,7 @@ def predict_bilateral(files):
130
  List of objects that will be used to display the result
131
  """
132
 
133
- filtered_files = filter_files(files)
134
 
135
  displays_imgs = []
136
  images = []
@@ -188,7 +188,7 @@ def run():
188
  """Run Gradio App."""
189
  demo = gr.Interface(
190
  fn=predict_bilateral,
191
- inputs=gr.File(file_count='multiple', file_types=SUPPORTED_IMG_EXT),
192
  outputs=[OUTPUT_GALLERY, gr.Label(label='Cancer Type')],
193
  examples=EXAMPLE_IMAGES,
194
  )
 
116
  return file_paths
117
 
118
 
119
+ def predict_bilateral(cc_file, mlo_file):
120
  """Predict Bilateral Mammography.
121
 
122
  Parameters
 
130
  List of objects that will be used to display the result
131
  """
132
 
133
+ filtered_files = filter_files([cc_file, mlo_file])
134
 
135
  displays_imgs = []
136
  images = []
 
188
  """Run Gradio App."""
189
  demo = gr.Interface(
190
  fn=predict_bilateral,
191
+ inputs=INPUT_FILES,
192
  outputs=[OUTPUT_GALLERY, gr.Label(label='Cancer Type')],
193
  examples=EXAMPLE_IMAGES,
194
  )