BennoKrojer commited on
Commit
1377bb8
1 Parent(s): e11f74d
Files changed (1) hide show
  1. app.py +24 -22
app.py CHANGED
@@ -38,25 +38,27 @@ if sample_button:
38
  col1.image(img, use_column_width=True)
39
  caps = list(range(10))
40
  col2.image(images, width=175, caption=caps)
41
-
42
-
43
- index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
44
- components.html(
45
- """
46
- <script>
47
- const elements = window.parent.document.querySelectorAll('.stNumberInput div[data-baseweb="input"] > div')
48
- console.log(elements)
49
- elements[1].style.backgroundColor = 'red'
50
- </script>
51
- """,
52
- height=0,
53
- width=0,
54
- )
55
-
56
-
57
- img = images[index]
58
- images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=10,fill='blue')
59
-
60
- col1.image(img, use_column_width=True)
61
- caps = list(range(10))
62
- col2.image(images, width=175, caption=caps)
 
 
 
38
  col1.image(img, use_column_width=True)
39
  caps = list(range(10))
40
  col2.image(images, width=175, caption=caps)
41
+
42
+ else:
43
+
44
+
45
+ index= int(col1.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
46
+ components.html(
47
+ """
48
+ <script>
49
+ const elements = window.parent.document.querySelectorAll('.stNumberInput div[data-baseweb="input"] > div')
50
+ console.log(elements)
51
+ elements[1].style.backgroundColor = 'red'
52
+ </script>
53
+ """,
54
+ height=0,
55
+ width=0,
56
+ )
57
+
58
+
59
+ img = images[index]
60
+ images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=10,fill='blue')
61
+
62
+ col1.image(img, use_column_width=True)
63
+ caps = list(range(10))
64
+ col2.image(images, width=175, caption=caps)