Skip to content

Commit

Permalink
Update rapidocr to v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Aug 27, 2023
1 parent 58738b3 commit 1ce9a00
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gen_whl_to_pypi_rapidocr_ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gen_whl_to_pypi_rapidocr_vino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions python/rapidocr_onnxruntime/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions python/rapidocr_openvino/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
13 changes: 6 additions & 7 deletions python/tests/test_all_ort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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():
Expand All @@ -45,22 +44,22 @@ 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():
image_path = tests_dir / "ch_en_num.jpg"
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():
Expand Down
13 changes: 6 additions & 7 deletions python/tests/test_all_vino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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():
Expand All @@ -45,22 +44,22 @@ 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():
image_path = tests_dir / "ch_en_num.jpg"
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():
Expand Down

0 comments on commit 1ce9a00

Please sign in to comment.