onursavas commited on
Commit
e88e4ee
·
1 Parent(s): 5105295

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import os
3
  import cv2
 
4
  from paddleocr import PPStructure,save_structure_res
5
  from paddleocr.ppstructure.recovery.recovery_to_doc import sorted_layout_boxes, convert_info_docx
6
 
@@ -13,7 +14,8 @@ table_engine = PPStructure(recovery=True)
13
 
14
  def find_layout(image):
15
  save_folder = './output'
16
- img = cv2.imread(image)
 
17
  result = table_engine(img)
18
  save_structure_res(result, save_folder, os.path.basename("result").split('.')[0])
19
 
 
1
  import gradio as gr
2
  import os
3
  import cv2
4
+ import numpy as np
5
  from paddleocr import PPStructure,save_structure_res
6
  from paddleocr.ppstructure.recovery.recovery_to_doc import sorted_layout_boxes, convert_info_docx
7
 
 
14
 
15
  def find_layout(image):
16
  save_folder = './output'
17
+ # img = cv2.imread(image)
18
+ img = np.array(image)
19
  result = table_engine(img)
20
  save_structure_res(result, save_folder, os.path.basename("result").split('.')[0])
21