Spaces:
Runtime error
Runtime error
Commit
·
f17d6cd
1
Parent(s):
d23dcb7
Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,10 @@ def view_random_image(target_dir, target_class):
|
|
40 |
target_folder = target_dir+target_class
|
41 |
|
42 |
# Get a random image path
|
43 |
-
random_image = random.
|
44 |
|
45 |
|
|
|
46 |
# Read in the image and plot it using matplotlib
|
47 |
img = mpimg.imread(target_folder + "/" + random_image[0])
|
48 |
plt.imshow(img)
|
|
|
40 |
target_folder = target_dir+target_class
|
41 |
|
42 |
# Get a random image path
|
43 |
+
random_image = random.sample(os.listdir(target_folder), 1)
|
44 |
|
45 |
|
46 |
+
|
47 |
# Read in the image and plot it using matplotlib
|
48 |
img = mpimg.imread(target_folder + "/" + random_image[0])
|
49 |
plt.imshow(img)
|