Spaces:
Runtime error
Runtime error
Commit ·
3ce1a28
1
Parent(s): a1b8369
6 unmodified lines78910111212 unmodified lines252627282930316 unmodified linesimport randomimport iost.set_page_config(layout="wide")st.markdown("**This is a demo of the *ImageCoDe* dataset. Sample an example description with the left +/- button on the right and compare all the images with the +/- button on the right. If you want to know the groundtruth solution, scroll down to the end of the page!**")12 unmodified linesexample = int()example_idx = int(col1.number_input('Sample an example from the validation set', value=0, min_value=0, max_value=len(descriptions)-1))img_set, idx, descr = descriptions[example_idx]idx = int(idx)images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]6 unmodified lines78910111213141512 unmodified lines282930313233346 unmodified linesimport randomimport iodef set_back():index = 0st.set_page_config(layout="wide")st.markdown("**This is a demo of the *ImageCoDe* dataset. Sample an example description with the left +/- button on the right and compare all the images with the +/- button on the right. If you want to know the groundtruth solution, scroll down to the end of the page!**")12 unmodified linesexample = int()example_idx = int(col1.number_input('Sample an example from the validation set', value=0, min_value=0, max_value=len(descriptions)-1, on_change=set_back))img_set, idx, descr = descriptions[example_idx]idx = int(idx)images = [prefix+'/'+img_set+'/'+i for i in set2ids[img_set]]
app.py+4-1