Spaces:
Runtime error
Runtime error
Commit ·
ec11b9a
1
Parent(s): 60a8ee6
7 unmodified lines891011111213146 unmodified lines212223242524252627288 unmodified lines37383940414243444546477 unmodified linesimport io
st.set_page_config(layout="wide")col1, col2, col3 = st.columns(3)col1, col2 = st.columns(2)
m = st.markdown("""<style>6 unmodified linesset2ids = json.load(open('set2ids.json', 'r'))descriptions = json.load(open('valid_list.json', 'r'))
show = col3.button("1")hide = col3.button('2')show = col1.button("Show groundtruth image index")hide = col2.button('Hide groundtruth image index')
example = int()example_idx = int(col1.number_input('Sample an example from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))8 unmodified lines
col1.image(img, use_column_width=True)caps = list(range(10))
if show: caps[idx] = f'{idx} (GROUNDTRUTH)'if hide: caps[idx] = f'{idx}'# shown = True if len(caps[idx]) > 2 else False# if shown col2.image(images, width=175, caption=caps)app.py+10-3