wsfung2008 commited on
Commit
dc22437
·
1 Parent(s): f9a67e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -19,6 +19,9 @@ def find_layout(image, mode):
19
  # img = cv2.imread(image)
20
  img = np.array(image)
21
 
 
 
 
22
  if mode=="LayoutAnalysis":
23
  table_engine = PPStructure(table=False, ocr=False, show_log=True)
24
  elif mode=="TableRecognition":
@@ -41,7 +44,9 @@ def find_layout(image, mode):
41
 
42
  # convert_info_docx(img, res, save_folder, os.path.basename("result").split('.')[0])
43
 
44
- image = Image.open(img).convert('RGB')
 
 
45
  im_show = draw_structure_result(image, result)
46
  im_show = Image.fromarray(im_show)
47
  im_show.save('result.jpg')
 
19
  # img = cv2.imread(image)
20
  img = np.array(image)
21
 
22
+ print("The variable image is of type:", type(image))
23
+ print("The variable img is of type:", type(img))
24
+
25
  if mode=="LayoutAnalysis":
26
  table_engine = PPStructure(table=False, ocr=False, show_log=True)
27
  elif mode=="TableRecognition":
 
44
 
45
  # convert_info_docx(img, res, save_folder, os.path.basename("result").split('.')[0])
46
 
47
+ # image = Image.open(img_path).convert('RGB')
48
+ image = image.convert('RGB')
49
+ img = img.convert('RGB')
50
  im_show = draw_structure_result(image, result)
51
  im_show = Image.fromarray(im_show)
52
  im_show.save('result.jpg')