Spaces:
Runtime error
Runtime error
Commit
·
af0b55f
1
Parent(s):
4622c8d
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,9 @@ descriptions = json.load(open('valid_list.json', 'r'))
|
|
26 |
|
27 |
# 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))
|
28 |
if col1.button('Sample an example (description + corresponding images) from the validation set'):
|
29 |
-
st.session_state.example_idx
|
|
|
|
|
30 |
img_set, true_idx, descr = descriptions[st.session_state.example_idx]
|
31 |
true_idx = int(true_idx)
|
32 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|
|
|
26 |
|
27 |
# 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))
|
28 |
if col1.button('Sample an example (description + corresponding images) from the validation set'):
|
29 |
+
st.session_state.example_idx += 1
|
30 |
+
# st.session_state.example_idx = random.randint(0, len(descriptions)-1)
|
31 |
+
|
32 |
img_set, true_idx, descr = descriptions[st.session_state.example_idx]
|
33 |
true_idx = int(true_idx)
|
34 |
images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
|