Synchronize PR #151 and set it to openvino and paddle versions.

This commit is contained in:
SWHL committed 2024-02-04 17:29:40 +08:00
1 parent c2b12e51fb
commit b2349ae4e6
6 files changed
+82 -49

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ package_name = "rapidocr_onnxruntime"
(
"test_letterbox_like.jpg",
2,
"A::取决于所使用的执行提供者,它可能没有完全支持模型中的所有操作。回落到CPU操作可能会导致性能速度的下降。此外,即使一个操作是由CUDAexecution",
"A::取决于所使用的执行提供者,它可能没有完全支持模型中的所有操作。回落到CPU操作可能会导致性能速度的下降。此外,即使一个操作是由CUDAeXecution",
),
("test_without_det.jpg", 1, "在中国作家协会第三届儿童文学"),
],
+20 -8
View File
@@ -20,11 +20,23 @@ img_path = tests_dir / "ch_en_num.jpg"
package_name = "rapidocr_paddle"
def test_without_det():
img_path = tests_dir / "test_without_det.png"
@pytest.mark.parametrize(
"img_name,gt_len,gt_first_len",
[
(
"test_letterbox_like.jpg",
2,
"A::取决于所使用的执行提供者,它可能没有完全支持模型中的所有操作。回落到CPU操作可能会导致性能速度的下降。此外,即使一个操作是由CUDAeXecution",
),
("test_without_det.jpg", 1, "在中国作家协会第三届儿童文学"),
],
)
def test_letterbox_like(img_name, gt_len, gt_first_len):
img_path = tests_dir / img_name
result, _ = engine(img_path)
assert result[0][1] == "の持、持场所无。"
assert len(result) == 1
assert len(result) == gt_len
assert result[0][1] == gt_first_len
def test_only_det():
@@ -114,7 +126,7 @@ def test_input_parameters():
def test_input_det_parameters():
with pytest.raises(FileNotFoundError) as exc_info:
engine = RapidOCR(det_model_path="1")
engine = RapidOCR(det_model_path="1.onnx")
result, _ = engine(img_path)
raise FileNotFoundError()
assert exc_info.type is FileNotFoundError
@@ -122,7 +134,7 @@ def test_input_det_parameters():
def test_input_cls_parameters():
with pytest.raises(FileNotFoundError) as exc_info:
engine = RapidOCR(cls_model_path="1")
engine = RapidOCR(cls_model_path="1.onnx")
result, _ = engine(img_path)
raise FileNotFoundError()
assert exc_info.type is FileNotFoundError
@@ -130,7 +142,7 @@ def test_input_cls_parameters():
def test_input_rec_parameters():
with pytest.raises(FileNotFoundError) as exc_info:
engine = RapidOCR(rec_model_path="1")
engine = RapidOCR(rec_model_path="1.onnx")
result, _ = engine(img_path)
raise FileNotFoundError()
assert exc_info.type is FileNotFoundError
@@ -142,7 +154,7 @@ def test_input_three_ndim_two_channel():
result, _ = engine(image_array)
assert len(result) == 1
assert result[0][1] == " TREND PLOT REPORT"
assert result[0][1] == "TREND PLOT REPORT"
def test_input_three_ndim_one_channel():
+17 -5
View File
@@ -20,11 +20,23 @@ img_path = tests_dir / "ch_en_num.jpg"
package_name = "rapidocr_openvino"
def test_without_det():
img_path = tests_dir / "test_without_det.png"
@pytest.mark.parametrize(
"img_name,gt_len,gt_first_len",
[
(
"test_letterbox_like.jpg",
2,
"A::取决于所使用的执行提供者,它可能没有完全支持模型中的所有操作。回落到CPU操作可能会导致性能速度的下降。此外,即使一个操作是由CUDAeXecution",
),
("test_without_det.jpg", 1, "在中国作家协会第三届儿童文学"),
],
)
def test_letterbox_like(img_name, gt_len, gt_first_len):
img_path = tests_dir / img_name
result, _ = engine(img_path)
assert result[0][1] == "の持、持场所无。"
assert len(result) == 1
assert len(result) == gt_len
assert result[0][1] == gt_first_len
def test_only_det():
@@ -142,7 +154,7 @@ def test_input_three_ndim_two_channel():
result, _ = engine(image_array)
assert len(result) == 1
assert result[0][1] == " TREND PLOT REPORT"
assert result[0][1] == "TREND PLOT REPORT"
def test_input_three_ndim_one_channel():