Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,19 +81,19 @@ def caption_random_image():
|
|
| 81 |
|
| 82 |
|
| 83 |
# AA: pick random row - from DF
|
| 84 |
-
|
| 85 |
|
| 86 |
|
| 87 |
# BB: Pick a random image path - image from folder
|
| 88 |
-
img_path = random.choice(image_paths)
|
| 89 |
|
| 90 |
|
| 91 |
# BB: Load into PIL - image from folder - image from folder
|
| 92 |
-
image = Image.open(img_path).convert("RGB")
|
| 93 |
|
| 94 |
|
| 95 |
# AA: Image - for DF
|
| 96 |
-
|
| 97 |
|
| 98 |
|
| 99 |
# Unconditional image captioning
|
|
|
|
| 81 |
|
| 82 |
|
| 83 |
# AA: pick random row - from DF
|
| 84 |
+
sample = df.sample(1).iloc[0]
|
| 85 |
|
| 86 |
|
| 87 |
# BB: Pick a random image path - image from folder
|
| 88 |
+
##img_path = random.choice(image_paths)
|
| 89 |
|
| 90 |
|
| 91 |
# BB: Load into PIL - image from folder - image from folder
|
| 92 |
+
##image = Image.open(img_path).convert("RGB")
|
| 93 |
|
| 94 |
|
| 95 |
# AA: Image - for DF
|
| 96 |
+
image = sample["image"]
|
| 97 |
|
| 98 |
|
| 99 |
# Unconditional image captioning
|