Spaces:
Runtime error
Runtime error
Commit ·
ed60eed
1
Parent(s): 78f266b
21 unmodified lines222324252627282930313210 unmodified lines4344454647488 unmodified lines57585921 unmodified linesset2ids = json.load(open('set2ids.json', 'r'))descriptions = json.load(open('valid_list.json', 'r'))if col1.button('Show groundtruth target image'):st.session_state.show = Trueif col2.button('Hide groundtruth target image'):st.session_state.show = False# 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))if col1.button('Sample an example (description + corresponding images) from the validation set'):st.session_state.example_idx = random.randint(0, len(descriptions)-1)10 unmodified linesimg = images[index]images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=20,fill='blue')caps = list(range(10))cap = str(index)8 unmodified linescol1.image(img, use_column_width=True, caption=cap)col2.image(images, width=175, caption=caps)21 unmodified lines22232425262710 unmodified lines383940414243448 unmodified lines5354555657585921 unmodified linesset2ids = json.load(open('set2ids.json', 'r'))descriptions = json.load(open('valid_list.json', 'r'))# 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))if col1.button('Sample an example (description + corresponding images) from the validation set'):st.session_state.example_idx = random.randint(0, len(descriptions)-1)10 unmodified linesimg = images[index]images[index] = ImageOps.expand(Image.open(io.BytesIO(requests.get(images[index], stream=True).content)),border=20,fill='blue')caps = list(range(10))cap = str(index)8 unmodified linescol1.image(img, use_column_width=True, caption=cap)col2.image(images, width=175, caption=caps)if col1.button('Show groundtruth target image'):st.session_state.show = Trueif col1.button('Hide groundtruth target image'):st.session_state.show = False
app.py+5-5