laverdes commited on
Commit
bc079c2
β€’
1 Parent(s): 2dc8f38

test: fix saving and reloading image

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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 🧾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,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