Spaces:
Runtime error
Runtime error
test: fix saving and reloading image
Browse files
app.py
CHANGED
@@ -61,11 +61,11 @@ Experimental OCR-free Document Understanding Vision Transformer nicknamed π©,
|
|
61 |
|
62 |
with st.sidebar:
|
63 |
information = st.radio(
|
64 |
-
"What information inside the
|
65 |
('Base Common-Crawl π©', 'Hierarchical Common-Crawl π©'))
|
66 |
-
image_choice = st.selectbox('Pick one
|
67 |
|
68 |
-
st.text(f'{information} mode is ON!\nTarget
|
69 |
|
70 |
col1, col2 = st.columns(2)
|
71 |
|
@@ -75,6 +75,9 @@ image_choice_map = {
|
|
75 |
'3': 'commoncrawl_celstuttgartdeideaa-different-stort-of-nfe_0.png'
|
76 |
}
|
77 |
image = Image.open(image_choice_map[image_choice])
|
|
|
|
|
|
|
78 |
with col1:
|
79 |
st.image(image, caption='Your target sample')
|
80 |
|
|
|
61 |
|
62 |
with st.sidebar:
|
63 |
information = st.radio(
|
64 |
+
"What information inside the πs are you interested in extracting?",
|
65 |
('Base Common-Crawl π©', 'Hierarchical Common-Crawl π©'))
|
66 |
+
image_choice = st.selectbox('Pick one π', ['1', '2', '3'], index=1)
|
67 |
|
68 |
+
st.text(f'{information} mode is ON!\nTarget π: {image_choice}') # \n(opening image @:./img/receipt-{receipt}.png)')
|
69 |
|
70 |
col1, col2 = st.columns(2)
|
71 |
|
|
|
75 |
'3': 'commoncrawl_celstuttgartdeideaa-different-stort-of-nfe_0.png'
|
76 |
}
|
77 |
image = Image.open(image_choice_map[image_choice])
|
78 |
+
image.save('./target_image.jpg')
|
79 |
+
image = Image.open('./target_image.jpg')
|
80 |
+
|
81 |
with col1:
|
82 |
st.image(image, caption='Your target sample')
|
83 |
|