Skip to content

Commit

Permalink
Prepare 2.7.3 release (#11826)
Browse files Browse the repository at this point in the history
* fix: Correct misuse of `try_import` from `paddle.utils` (#11820)

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>
  • Loading branch information
jzhang533 and neteroster committed Mar 28, 2024
1 parent 89e0a15 commit ddaa85d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paddleocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _import_file(module_name, file_path, make_importable=False):
]

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

Expand Down
3 changes: 2 additions & 1 deletion ppocr/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions ppstructure/pdf2word/pdf2word.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
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, \
Expand Down

0 comments on commit ddaa85d

Please sign in to comment.