Spaces:
Runtime error
Runtime error
Commit
·
bb74091
1
Parent(s):
c247924
app.py
CHANGED
|
@@ -29,7 +29,8 @@ sample_button = col1.button('Sample set of images with contextual description')
|
|
| 29 |
if sample_button:
|
| 30 |
img_set = random.sample(list(set2ids.keys()),1)[0]
|
| 31 |
descr = random.sample(list(descriptions[img_set].values()),1)[0]
|
| 32 |
-
|
|
|
|
| 33 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|
| 34 |
img = images[index]
|
| 35 |
images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=10,fill='blue')
|
|
|
|
| 29 |
if sample_button:
|
| 30 |
img_set = random.sample(list(set2ids.keys()),1)[0]
|
| 31 |
descr = random.sample(list(descriptions[img_set].values()),1)[0]
|
| 32 |
+
col1.subheader(descr)
|
| 33 |
+
index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
|
| 34 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|
| 35 |
img = images[index]
|
| 36 |
images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=10,fill='blue')
|