diff --git a/python/demo.py b/python/demo.py index e33dd6eaf..5449c2851 100644 --- a/python/demo.py +++ b/python/demo.py @@ -8,10 +8,9 @@ import cv2 import numpy as np from PIL import Image, ImageDraw, ImageFont +from rapidocr_openvino import RapidOCR -from rapidocr_onnxruntime import RapidOCR - -# from rapidocr_openvino import RapidOCR +# from rapidocr_onnxruntime import RapidOCR def draw_ocr_box_txt(image, boxes, txts, font_path, scores=None, text_score=0.5): diff --git a/python/rapidocr_openvino/ch_ppocr_v3_rec/config.yaml b/python/rapidocr_openvino/ch_ppocr_v3_rec/config.yaml index 70e957311..9453c0856 100644 --- a/python/rapidocr_openvino/ch_ppocr_v3_rec/config.yaml +++ b/python/rapidocr_openvino/ch_ppocr_v3_rec/config.yaml @@ -1,4 +1,4 @@ model_path: models/ch_PP-OCRv4_rec_infer.onnx -rec_img_shape: [3, 32, 320] +rec_img_shape: [3, 48, 320] rec_batch_num: 6 diff --git a/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py b/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py index ff274f805..d804eb9ae 100644 --- a/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py +++ b/python/rapidocr_openvino/ch_ppocr_v3_rec/text_recognize.py @@ -22,7 +22,6 @@ import cv2 import numpy as np - from rapidocr_openvino.utils import OpenVINOInferSession, read_yaml from .utils import CTCLabelDecode diff --git a/python/tests/test_rec.py b/python/tests/test_rec.py index e75a9d6ce..ac9428925 100644 --- a/python/tests/test_rec.py +++ b/python/tests/test_rec.py @@ -22,5 +22,5 @@ def test_det(package_name): img_path = base.tests_dir / "test_files" / "text_rec.jpg" img = cv2.imread(str(img_path)) - rec_res, elapse = text_rec([img]) + rec_res, elapse = text_rec(img) assert rec_res[0][0] == "韩国小馆"