mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-07-28 19:29:29 +00:00
30 lines
655 B
Python
30 lines
655 B
Python
import pytest
|
|
|
|
from paddleocr import TextRecognition
|
|
from ..testing_utils import TEST_DATA_DIR, check_simple_inference_result
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def text_recognition_predictor():
|
|
return TextRecognition()
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"image_path",
|
|
[
|
|
TEST_DATA_DIR / "textline.png",
|
|
],
|
|
)
|
|
def test_predict(text_recognition_predictor, image_path):
|
|
result = text_recognition_predictor.predict(str(image_path))
|
|
|
|
check_simple_inference_result(result)
|
|
assert result[0].keys() == {
|
|
"input_path",
|
|
"page_index",
|
|
"input_img",
|
|
"rec_text",
|
|
"rec_score",
|
|
"vis_font",
|
|
}
|