Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct misuse of try_import from paddle.utils #11820

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ppocr/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def check_and_read(img_path):
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 = []
Expand Down
3 changes: 1 addition & 2 deletions ppstructure/pdf2word/pdf2word.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +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 (
Expand Down