Spaces:
Runtime error
Runtime error
BennoKrojer
commited on
Commit
•
ed60eed
1
Parent(s):
78f266b
app.py
CHANGED
@@ -22,11 +22,6 @@ prefix = 'https://raw.githubusercontent.com/BennoKrojer/imagecode-val-set/main/i
|
|
22 |
set2ids = json.load(open('set2ids.json', 'r'))
|
23 |
descriptions = json.load(open('valid_list.json', 'r'))
|
24 |
|
25 |
-
if col1.button('Show groundtruth target image'):
|
26 |
-
st.session_state.show = True
|
27 |
-
if col2.button('Hide groundtruth target image'):
|
28 |
-
st.session_state.show = False
|
29 |
-
|
30 |
# example_idx = int(col1.number_input('Sample an example (description + corresponding images) from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))
|
31 |
if col1.button('Sample an example (description + corresponding images) from the validation set'):
|
32 |
st.session_state.example_idx = random.randint(0, len(descriptions)-1)
|
@@ -43,6 +38,7 @@ col1.markdown(descr)
|
|
43 |
img = images[index]
|
44 |
images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=20,fill='blue')
|
45 |
|
|
|
46 |
caps = list(range(10))
|
47 |
cap = str(index)
|
48 |
|
@@ -57,3 +53,7 @@ else:
|
|
57 |
|
58 |
col1.image(img, use_column_width=True, caption=cap)
|
59 |
col2.image(images, width=175, caption=caps)
|
|
|
|
|
|
|
|
|
|
22 |
set2ids = json.load(open('set2ids.json', 'r'))
|
23 |
descriptions = json.load(open('valid_list.json', 'r'))
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
# example_idx = int(col1.number_input('Sample an example (description + corresponding images) from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))
|
26 |
if col1.button('Sample an example (description + corresponding images) from the validation set'):
|
27 |
st.session_state.example_idx = random.randint(0, len(descriptions)-1)
|
|
|
38 |
img = images[index]
|
39 |
images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=20,fill='blue')
|
40 |
|
41 |
+
|
42 |
caps = list(range(10))
|
43 |
cap = str(index)
|
44 |
|
|
|
53 |
|
54 |
col1.image(img, use_column_width=True, caption=cap)
|
55 |
col2.image(images, width=175, caption=caps)
|
56 |
+
if col1.button('Show groundtruth target image'):
|
57 |
+
st.session_state.show = True
|
58 |
+
if col1.button('Hide groundtruth target image'):
|
59 |
+
st.session_state.show = False
|