Prepare 2.7.3 release ()

* fix: Correct misuse of `try_import` from `paddle.utils` ()

This commit addresses the incorrect usage of the `try_import` function from `paddle.utils` in both `ppocr/utils/utility.py` and `ppstructure/pdf2word/pdf2word.py`.

* bump version to 2.7.3

---------

Co-authored-by: NeterOster <neteroster@gmail.com>
pull/11828/head^2 v2.7.3
jzhang533 2024-03-28 11:43:15 +08:00 committed by GitHub
parent 89e0a15ce7
commit ddaa85ddaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions
ppocr/utils
ppstructure/pdf2word

View File

@ -59,7 +59,7 @@ __all__ = [
]
SUPPORT_DET_MODEL = ['DB']
VERSION = '2.7.2'
VERSION = '2.7.3'
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
BASE_DIR = os.path.expanduser("~/.paddleocr/")

View File

@ -108,7 +108,8 @@ def check_and_read(img_path):
return imgvalue, True, False
elif os.path.basename(img_path)[-3:].lower() == 'pdf':
from paddle.utils import try_import
try_import('fitz')
fitz = try_import("fitz")
from PIL import Image
imgs = []
with fitz.open(img_path) as pdf:

View File

@ -21,9 +21,9 @@ import functools
import cv2
import platform
import numpy as np
import fitz
from paddle.utils import try_import
try_import('fitz')
fitz = try_import("fitz")
from PIL import Image
from pdf2docx.converter import Converter
from qtpy.QtWidgets import QApplication, QWidget, QPushButton, QProgressBar, \