amosfang commited on
Commit
7172b20
·
verified ·
1 Parent(s): 358e99a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -53,8 +53,8 @@ def get_sample_images(image_folder, format=[('.jpg', '.jpeg'), ('.png')]):
53
  image_files = [image_folder +'/' + file for file in img_file_list if file.lower().endswith(format[0])]
54
  mask_files = [image_folder +'/' + file for file in img_file_list if file.lower().endswith(format[1])]
55
 
56
- if mask_files == []:
57
- image_files = [[image] for image in image_files]
58
  return image_files
59
 
60
  return [list(pair) for pair in zip(image_files, mask_files)]
@@ -200,7 +200,7 @@ tab1 = gr.Interface(
200
  outputs=[gr.Image(label='Ground Truth'), gr.Image(label='Predicted')],
201
  title='Images with Ground Truth',
202
  description=description,
203
- examples=train_images[:5]
204
  )
205
 
206
  # Create the test dataset interface
@@ -210,7 +210,7 @@ tab2 = gr.Interface(
210
  outputs=gr.Image(label='Predicted'),
211
  title='Images without Ground Truth',
212
  description=description,
213
- examples=test_images[:5]
214
  )
215
 
216
  # Create a Multi Interface with Tabs
 
53
  image_files = [image_folder +'/' + file for file in img_file_list if file.lower().endswith(format[0])]
54
  mask_files = [image_folder +'/' + file for file in img_file_list if file.lower().endswith(format[1])]
55
 
56
+ if not mask_files:
57
+ image_files = [[image_folder +'/' + file] for file in img_file_list if file.lower().endswith(format[0])]
58
  return image_files
59
 
60
  return [list(pair) for pair in zip(image_files, mask_files)]
 
200
  outputs=[gr.Image(label='Ground Truth'), gr.Image(label='Predicted')],
201
  title='Images with Ground Truth',
202
  description=description,
203
+ examples=train_images
204
  )
205
 
206
  # Create the test dataset interface
 
210
  outputs=gr.Image(label='Predicted'),
211
  title='Images without Ground Truth',
212
  description=description,
213
+ examples=test_images
214
  )
215
 
216
  # Create a Multi Interface with Tabs