test_table_classifcation.py 609 B

1234567891011121314151617181920212223
  1. import pytest
  2. from paddleocr import TableClassification
  3. from ..testing_utils import TEST_DATA_DIR, check_simple_inference_result
  4. from .image_classification_common import check_result_item_keys
  5. @pytest.fixture(scope="module")
  6. def table_classification_predictor():
  7. return TableClassification()
  8. @pytest.mark.parametrize(
  9. "image_path",
  10. [
  11. TEST_DATA_DIR / "table.jpg",
  12. ],
  13. )
  14. def test_predict(table_classification_predictor, image_path):
  15. result = table_classification_predictor.predict(str(image_path))
  16. check_simple_inference_result(result)
  17. check_result_item_keys(result[0])