Skip to content

Commit

Permalink
move the paddle ocr in to the method
Browse files Browse the repository at this point in the history
  • Loading branch information
MulongXie committed Apr 2, 2022
1 parent bb96f3f commit 4557d00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 2 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion detect_text/text_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import time
import os
from os.path import join as pjoin
from paddleocr import PaddleOCR


def save_detection_json(file_path, texts, img_shape):
Expand Down Expand Up @@ -146,6 +145,8 @@ def text_detection(input_file='../data/input/30800.jpg', output_file='../data/ou
texts = text_filter_noise(texts)
texts = text_sentences_recognition(texts)
elif method == 'paddle':
# The import of the paddle ocr can be separate to the beginning of the program if you decide to use this method
from paddleocr import PaddleOCR
print('*** Detect Text through Paddle OCR ***')
if paddle_model is None:
paddle_model = PaddleOCR(use_angle_cls=True, lang="ch")
Expand Down

0 comments on commit 4557d00

Please sign in to comment.