Skip to content

Commit 79fc4c5

Browse files
update whl (#10916)
1 parent 23fbdab commit 79fc4c5

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

paddleocr.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _import_file(module_name, file_path, make_importable=False):
5959
]
6060

6161
SUPPORT_DET_MODEL = ['DB']
62-
VERSION = '2.7.0.1'
62+
VERSION = '2.7.0.3'
6363
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
6464
BASE_DIR = os.path.expanduser("~/.paddleocr/")
6565

@@ -616,7 +616,14 @@ def __init__(self, **kwargs):
616616
super().__init__(params)
617617
self.page_num = params.page_num
618618

619-
def ocr(self, img, det=True, rec=True, cls=True, bin=False, inv=False, alpha_color=(255, 255, 255)):
619+
def ocr(self,
620+
img,
621+
det=True,
622+
rec=True,
623+
cls=True,
624+
bin=False,
625+
inv=False,
626+
alpha_color=(255, 255, 255)):
620627
"""
621628
OCR with PaddleOCR
622629
args:
@@ -784,15 +791,13 @@ def main():
784791
img_name = os.path.basename(img_path).split('.')[0]
785792
logger.info('{}{}{}'.format('*' * 10, img_path, '*' * 10))
786793
if args.type == 'ocr':
787-
result = engine.ocr(
788-
img_path,
789-
det=args.det,
790-
rec=args.rec,
791-
cls=args.use_angle_cls,
792-
bin=args.binarize,
793-
inv=args.invert,
794-
alpha_color=args.alphacolor
795-
)
794+
result = engine.ocr(img_path,
795+
det=args.det,
796+
rec=args.rec,
797+
cls=args.use_angle_cls,
798+
bin=args.binarize,
799+
inv=args.invert,
800+
alpha_color=args.alphacolor)
796801
if result is not None:
797802
for idx in range(len(result)):
798803
res = result[idx]

ppstructure/recovery/recovery_to_doc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def convert_info_docx(img, res, save_folder, img_name):
3636

3737
flag = 1
3838
for i, region in enumerate(res):
39+
if len(region['res']) == 0:
40+
continue
3941
img_idx = region['img_idx']
4042
if flag == 2 and region['layout'] == 'single':
4143
section = doc.add_section(WD_SECTION.CONTINUOUS)

0 commit comments

Comments
 (0)