Spaces:
Sleeping
Sleeping
fix bug with images
Browse files
app.py
CHANGED
@@ -19,6 +19,9 @@ 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
|
@@ -162,6 +165,7 @@ with gr.Blocks() as demo:
|
|
162 |
showed_images = list()
|
163 |
loaded_images = load_random_images()
|
164 |
amount_rows = max(1, (len(loaded_images) // IMAGES_PER_ROW))
|
|
|
165 |
for i in range(amount_rows):
|
166 |
with gr.Row():
|
167 |
for j in range(IMAGES_PER_ROW):
|
|
|
19 |
from tqdm import tqdm
|
20 |
from util import transform
|
21 |
|
22 |
+
# print the current working directory
|
23 |
+
print(os.getcwd())
|
24 |
+
|
25 |
IMAGE_PATH = 'src\\examples'
|
26 |
RANDOM_IMAGES_TO_SHOW = 20
|
27 |
IMAGES_PER_ROW = 5
|
|
|
165 |
showed_images = list()
|
166 |
loaded_images = load_random_images()
|
167 |
amount_rows = max(1, (len(loaded_images) // IMAGES_PER_ROW))
|
168 |
+
if len(loaded_images) == 0: amount_rows = 0
|
169 |
for i in range(amount_rows):
|
170 |
with gr.Row():
|
171 |
for j in range(IMAGES_PER_ROW):
|