Spaces:
Sleeping
Sleeping
fix bug with images
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ from util import transform
|
|
| 21 |
|
| 22 |
IMAGE_PATH = os.path.join(os.getcwd(), 'src/examples')
|
| 23 |
print(os.listdir(os.path.join(IMAGE_PATH, 'antelope')))
|
| 24 |
-
RANDOM_IMAGES_TO_SHOW =
|
| 25 |
IMAGES_PER_ROW = 5
|
| 26 |
|
| 27 |
CAM_METHODS = {
|
|
@@ -42,6 +42,7 @@ def load_random_images():
|
|
| 42 |
idx = np.random.randint(0, len(data_df))
|
| 43 |
p = os.path.join(IMAGE_PATH, data_df.iloc[idx]['path'])
|
| 44 |
animal = data_df.iloc[idx]['target']
|
|
|
|
| 45 |
if os.path.exists(p):
|
| 46 |
random_images.append((animal, Image.open(p)))
|
| 47 |
return random_images
|
|
|
|
| 21 |
|
| 22 |
IMAGE_PATH = os.path.join(os.getcwd(), 'src/examples')
|
| 23 |
print(os.listdir(os.path.join(IMAGE_PATH, 'antelope')))
|
| 24 |
+
RANDOM_IMAGES_TO_SHOW = 10
|
| 25 |
IMAGES_PER_ROW = 5
|
| 26 |
|
| 27 |
CAM_METHODS = {
|
|
|
|
| 42 |
idx = np.random.randint(0, len(data_df))
|
| 43 |
p = os.path.join(IMAGE_PATH, data_df.iloc[idx]['path'])
|
| 44 |
animal = data_df.iloc[idx]['target']
|
| 45 |
+
print(p)
|
| 46 |
if os.path.exists(p):
|
| 47 |
random_images.append((animal, Image.open(p)))
|
| 48 |
return random_images
|