Skip to content

Commit ddaa85d

Browse files
Prepare 2.7.3 release (#11826)
* 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>
1 parent 89e0a15 commit ddaa85d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

paddleocr.py

Lines changed: 1 addition & 1 deletion
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.2'
62+
VERSION = '2.7.3'
6363
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
6464
BASE_DIR = os.path.expanduser("~/.paddleocr/")
6565

ppocr/utils/utility.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def check_and_read(img_path):
108108
return imgvalue, True, False
109109
elif os.path.basename(img_path)[-3:].lower() == 'pdf':
110110
from paddle.utils import try_import
111-
try_import('fitz')
111+
112+
fitz = try_import("fitz")
112113
from PIL import Image
113114
imgs = []
114115
with fitz.open(img_path) as pdf:

ppstructure/pdf2word/pdf2word.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import cv2
2222
import platform
2323
import numpy as np
24-
import fitz
2524
from paddle.utils import try_import
26-
try_import('fitz')
25+
fitz = try_import("fitz")
26+
2727
from PIL import Image
2828
from pdf2docx.converter import Converter
2929
from qtpy.QtWidgets import QApplication, QWidget, QPushButton, QProgressBar, \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy