Spaces:
Runtime error
Runtime error
Commit
·
74d753d
1
Parent(s):
da31722
app.py
CHANGED
@@ -28,7 +28,15 @@ col1.subheader(descr)
|
|
28 |
sample_button = col1.button('Sample set of images with contextual description')
|
29 |
|
30 |
if sample_button:
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
|
34 |
components.html(
|
|
|
28 |
sample_button = col1.button('Sample set of images with contextual description')
|
29 |
|
30 |
if sample_button:
|
31 |
+
index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
|
32 |
+
img_set = random.sample(list(set2ids.keys()),1)[0]
|
33 |
+
img = images[index]
|
34 |
+
images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=10,fill='blue')
|
35 |
+
|
36 |
+
col1.image(img, use_column_width=True)
|
37 |
+
caps = list(range(10))
|
38 |
+
col2.image(images, width=175, caption=caps)
|
39 |
+
|
40 |
|
41 |
index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
|
42 |
components.html(
|