zmbfeng commited on
Commit
8dfad76
·
1 Parent(s): 15cd602

cropped image before using line to divide up document

Browse files
Files changed (1) hide show
  1. utils.py +11 -7
utils.py CHANGED
@@ -226,14 +226,18 @@ def gray_pdf_image_np_to_text(image_index,gray_pdf_image_np, debug=False):
226
  for text_box, above_text_box in zip(text_box_list, above_test_box_list):
227
  print("text box start")
228
  if above_text_box is not None:
229
- st.write(above_text_box[0])
230
- st.image(Image.fromarray(above_text_box[1]))
 
231
  # st.write(text)
232
- st.image(Image.fromarray(text_box))
233
  debug_text_box_index = debug_text_box_index + 1
234
  for figure in figures_image_list:
235
- st.write(figure[0])
236
- st.image(Image.fromarray(figure[1]))
 
237
  for table in tables_image_list:
238
- st.write(table[0])
239
- st.image(Image.fromarray(table[1]))
 
 
 
226
  for text_box, above_text_box in zip(text_box_list, above_test_box_list):
227
  print("text box start")
228
  if above_text_box is not None:
229
+ print(above_text_box[0])#to_be_displayed
230
+ # st.write(above_text_box[0])#to_be_displayed
231
+ # st.image(Image.fromarray(above_text_box[1]))#to_be_displayed
232
  # st.write(text)
233
+ # st.image(Image.fromarray(text_box))#to_be_displayed
234
  debug_text_box_index = debug_text_box_index + 1
235
  for figure in figures_image_list:
236
+ print(figure[0])
237
+ # st.write(figure[0])#to_be_displayed
238
+ # st.image(Image.fromarray(figure[1]))#to_be_displayed
239
  for table in tables_image_list:
240
+ print(table[0])
241
+ # st.write(table[0])#to_be_displayed
242
+ # st.image(Image.fromarray(table[1]))#to_be_displayed
243
+ st.image(Image.fromarray(cropped_image))