Spaces:
Runtime error
Runtime error
Commit
·
137bdf0
1
Parent(s):
fc17be6
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,8 @@ 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 |
# Read in the image and plot it using matplotlib
|
46 |
img = mpimg.imread(target_folder + "/" + random_image[0])
|
|
|
40 |
target_folder = target_dir+target_class
|
41 |
|
42 |
# Get a random image path
|
43 |
+
random_image = random.choices(os.listdir(target_folder), 1)
|
44 |
+
|
45 |
|
46 |
# Read in the image and plot it using matplotlib
|
47 |
img = mpimg.imread(target_folder + "/" + random_image[0])
|