GabrielML commited on
Commit
5821c7d
·
1 Parent(s): 1eaf2e8

fix requirements

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -19,7 +19,7 @@ from torchvision.transforms.functional import to_pil_image
19
  from tqdm import tqdm
20
  from util import transform
21
 
22
- IMAGE_PATH = 'src/examples'
23
  RANDOM_IMAGES_TO_SHOW = 20
24
  IMAGES_PER_ROW = 5
25
 
@@ -41,7 +41,8 @@ def load_random_images():
41
  idx = np.random.randint(0, len(data_df))
42
  p = os.path.join(IMAGE_PATH, data_df.iloc[idx]['path'])
43
  animal = data_df.iloc[idx]['target']
44
- random_images.append((animal, Image.open(p)))
 
45
  return random_images
46
 
47
  def get_class_name(idx):
 
19
  from tqdm import tqdm
20
  from util import transform
21
 
22
+ IMAGE_PATH = 'src\\examples'
23
  RANDOM_IMAGES_TO_SHOW = 20
24
  IMAGES_PER_ROW = 5
25
 
 
41
  idx = np.random.randint(0, len(data_df))
42
  p = os.path.join(IMAGE_PATH, data_df.iloc[idx]['path'])
43
  animal = data_df.iloc[idx]['target']
44
+ if os.path.exists(p):
45
+ random_images.append((animal, Image.open(p)))
46
  return random_images
47
 
48
  def get_class_name(idx):