Spaces:
Runtime error
Runtime error
Commit
·
c34d9ea
1
Parent(s):
b6f3fea
app.py
CHANGED
@@ -6,7 +6,13 @@ import json
|
|
6 |
import requests
|
7 |
import random
|
8 |
import io
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
prefix = 'https://raw.githubusercontent.com/BennoKrojer/imagecode-val-set/main/image-sets-val/'
|
12 |
set2ids = json.load(open('set2ids.json', 'r'))
|
@@ -14,11 +20,13 @@ descriptions = json.load(open('valid_list.json', 'r'))
|
|
14 |
st.set_page_config(layout="wide")
|
15 |
col1, col2 = st.columns(2)
|
16 |
|
|
|
|
|
17 |
example = int()
|
18 |
example_idx = int(col1.number_input('Sample an example from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))
|
19 |
img_set, idx, descr = descriptions[example_idx]
|
20 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|
21 |
-
index = int(
|
22 |
|
23 |
col1.subheader(descr)
|
24 |
|
|
|
6 |
import requests
|
7 |
import random
|
8 |
import io
|
9 |
+
|
10 |
+
m = st.markdown("""
|
11 |
+
<style>
|
12 |
+
div.stButton > button:first-child {
|
13 |
+
background-color: rgb(204, 49, 49);
|
14 |
+
}
|
15 |
+
</style>""", unsafe_allow_html=True)
|
16 |
|
17 |
prefix = 'https://raw.githubusercontent.com/BennoKrojer/imagecode-val-set/main/image-sets-val/'
|
18 |
set2ids = json.load(open('set2ids.json', 'r'))
|
|
|
20 |
st.set_page_config(layout="wide")
|
21 |
col1, col2 = st.columns(2)
|
22 |
|
23 |
+
st.button("hi")
|
24 |
+
|
25 |
example = int()
|
26 |
example_idx = int(col1.number_input('Sample an example from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))
|
27 |
img_set, idx, descr = descriptions[example_idx]
|
28 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|
29 |
+
index = int(col2.number_input('Image Index from 0 to 9', value=0, min_value=0, max_value=len(images)-1))
|
30 |
|
31 |
col1.subheader(descr)
|
32 |
|