Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Update rapidocr to v1.3.0

SWHL1ce9a00e08e6
diff --git a/.github/workflows/gen_whl_to_pypi_rapidocr_ort.yml b/.github/workflows/gen_whl_to_pypi_rapidocr_ort.yml
index c203447..821a8b4 100644
--- a/.github/workflows/gen_whl_to_pypi_rapidocr_ort.yml
+++ b/.github/workflows/gen_whl_to_pypi_rapidocr_ort.yml
@@ -10,7 +10,7 @@ on:
- '.github/workflows/gen_whl_to_pypi_rapidocr_ort.yml'
env:
- RESOURCES_URL: https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.1.0.zip
+ RESOURCES_URL: https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.3.0.zip
jobs:
UnitTesting:
diff --git a/.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml b/.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml
index daf19ec..f6b5b16 100644
--- a/.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml
+++ b/.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml
@@ -10,7 +10,7 @@ on:
- '.github/workflows/gen_whl_to_pypi_rapidocr_vino.yml'
env:
- RESOURCES_URL: https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.1.0.zip
+ RESOURCES_URL: https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/required_for_whl_v1.3.0.zip
jobs:
UnitTesting:
diff --git a/python/rapidocr_onnxruntime/config.yaml b/python/rapidocr_onnxruntime/config.yaml
index 4607d7d..988e49e 100644
--- a/python/rapidocr_onnxruntime/config.yaml
+++ b/python/rapidocr_onnxruntime/config.yaml
@@ -9,7 +9,7 @@ Global:
Det:
use_cuda: false
- model_path: models/ch_PP-OCRv3_det_infer.onnx
+ model_path: models/ch_PP-OCRv4_det_infer.onnx
limit_side_len: 736
limit_type: min
@@ -34,7 +34,7 @@ Cls:
Rec:
use_cuda: false
- model_path: models/ch_PP-OCRv3_rec_infer.onnx
+ model_path: models/ch_PP-OCRv4_rec_infer.onnx
rec_img_shape: [3, 48, 320]
rec_batch_num: 6
diff --git a/python/rapidocr_openvino/config.yaml b/python/rapidocr_openvino/config.yaml
index 4607d7d..988e49e 100644
--- a/python/rapidocr_openvino/config.yaml
+++ b/python/rapidocr_openvino/config.yaml
@@ -9,7 +9,7 @@ Global:
Det:
use_cuda: false
- model_path: models/ch_PP-OCRv3_det_infer.onnx
+ model_path: models/ch_PP-OCRv4_det_infer.onnx
limit_side_len: 736
limit_type: min
@@ -34,7 +34,7 @@ Cls:
Rec:
use_cuda: false
- model_path: models/ch_PP-OCRv3_rec_infer.onnx
+ model_path: models/ch_PP-OCRv4_rec_infer.onnx
rec_img_shape: [3, 48, 320]
rec_batch_num: 6
diff --git a/python/tests/test_all_ort.py b/python/tests/test_all_ort.py
index 4427c6c..99f818d 100644
--- a/python/tests/test_all_ort.py
+++ b/python/tests/test_all_ort.py
@@ -4,16 +4,15 @@
import sys
from pathlib import Path
-import numpy as np
import cv2
+import numpy as np
import pytest
-
root_dir = Path(__file__).resolve().parent.parent
print(root_dir)
sys.path.append(str(root_dir))
-from rapidocr_onnxruntime import RapidOCR, LoadImageError
+from rapidocr_onnxruntime import LoadImageError, RapidOCR
rapid_ocr = RapidOCR()
tests_dir = root_dir / "tests" / "test_files"
@@ -24,7 +23,7 @@ def test_normal():
img = cv2.imread(str(image_path))
result, _ = rapid_ocr(img)
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_empty():
@@ -45,7 +44,7 @@ def test_input_str():
image_path = tests_dir / "ch_en_num.jpg"
result, _ = rapid_ocr(str(image_path))
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_bytes():
@@ -53,14 +52,14 @@ def test_input_bytes():
with open(image_path, "rb") as f:
result, _ = rapid_ocr(f.read())
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_path():
image_path = tests_dir / "ch_en_num.jpg"
result, _ = rapid_ocr(image_path)
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_parameters():
diff --git a/python/tests/test_all_vino.py b/python/tests/test_all_vino.py
index 530f04a..1ef92b8 100644
--- a/python/tests/test_all_vino.py
+++ b/python/tests/test_all_vino.py
@@ -4,15 +4,14 @@
import sys
from pathlib import Path
-import numpy as np
import cv2
+import numpy as np
import pytest
-
root_dir = Path(__file__).resolve().parent.parent
sys.path.append(str(root_dir))
-from rapidocr_openvino import RapidOCR, LoadImageError
+from rapidocr_openvino import LoadImageError, RapidOCR
rapid_ocr = RapidOCR()
@@ -24,7 +23,7 @@ def test_normal():
img = cv2.imread(str(image_path))
result, _ = rapid_ocr(img)
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_empty():
@@ -45,7 +44,7 @@ def test_input_str():
image_path = tests_dir / "ch_en_num.jpg"
result, _ = rapid_ocr(str(image_path))
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_bytes():
@@ -53,14 +52,14 @@ def test_input_bytes():
with open(image_path, "rb") as f:
result, _ = rapid_ocr(f.read())
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_path():
image_path = tests_dir / "ch_en_num.jpg"
result, _ = rapid_ocr(image_path)
assert result[0][1] == "正品促销"
- assert len(result) == 17
+ assert len(result) == 16
def test_input_parameters():