pcback commited on
Commit
08161c3
1 Parent(s): 2860157

Fix app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -189,6 +189,9 @@ def extract_text_from_cells(filename, cells):
189
 
190
 
191
  def cells_to_html(cells):
 
 
 
192
  n_cols = max(cell['column_nums'][-1] for cell in cells) + 1
193
  n_rows = max(cell['row_nums'][-1] for cell in cells) + 1
194
  html_code = ''
@@ -236,8 +239,7 @@ def main():
236
  st.set_option('deprecation.showfileUploaderEncoding', False)
237
  filename = st.sidebar.file_uploader("Upload files", type=['png', 'jpeg', 'jpg'])
238
 
239
-
240
- if st.sidebar.button("Analyze page"):
241
 
242
  if filename is None:
243
  st.sidebar.write("Please upload an image")
 
189
 
190
 
191
  def cells_to_html(cells):
192
+ for cell in cells:
193
+ cell['column_nums'].sort()
194
+ cell['row_nums'].sort()
195
  n_cols = max(cell['column_nums'][-1] for cell in cells) + 1
196
  n_rows = max(cell['row_nums'][-1] for cell in cells) + 1
197
  html_code = ''
 
239
  st.set_option('deprecation.showfileUploaderEncoding', False)
240
  filename = st.sidebar.file_uploader("Upload files", type=['png', 'jpeg', 'jpg'])
241
 
242
+ if st.sidebar.button("Analyze image"):
 
243
 
244
  if filename is None:
245
  st.sidebar.write("Please upload an image")