Skip to content

Commit 6df0e2e

Browse files
Get rid of confidence assertions in EasyOCR
1 parent 0e0b195 commit 6df0e2e

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

inference_experimental/inference_exp/models/easy_ocr/easy_ocr_torch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def from_pretrained(
6262
gpu=device_string,
6363
)
6464
except Exception as error:
65-
raise error
6665
raise CorruptedModelPackageError(
6766
message=f"EasyOCR model package is broken - could not parse model config file. Error: {error}"
6867
f"If you attempt to run `inference-exp` locally - inspect the contents of local directory to check "

inference_experimental/tests/integration_tests/models/test_easy_ocr_predictions.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ def test_easy_ocr_predictions_for_numpy_image(
2323
assert np.allclose(
2424
result[1][0].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
2525
)
26-
assert np.allclose(
27-
result[1][0].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
28-
)
2926

3027

3128
@pytest.mark.slow
@@ -47,16 +44,10 @@ def test_easy_ocr_predictions_for_numpy_image_list(
4744
assert np.allclose(
4845
result[1][0].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
4946
)
50-
assert np.allclose(
51-
result[1][0].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
52-
)
5347
assert result[0][1].startswith("This is a test image for OCR")
5448
assert np.allclose(
5549
result[1][1].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
5650
)
57-
assert np.allclose(
58-
result[1][1].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
59-
)
6051

6152

6253
@pytest.mark.slow
@@ -78,9 +69,6 @@ def test_easy_ocr_predictions_for_torch_image(
7869
assert np.allclose(
7970
result[1][0].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
8071
)
81-
assert np.allclose(
82-
result[1][0].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
83-
)
8472

8573

8674
@pytest.mark.slow
@@ -102,16 +90,10 @@ def test_easy_ocr_predictions_for_torch_batch(
10290
assert np.allclose(
10391
result[1][0].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
10492
)
105-
assert np.allclose(
106-
result[1][0].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
107-
)
10893
assert result[0][1].startswith("This is a test image for OCR")
10994
assert np.allclose(
11095
result[1][1].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
11196
)
112-
assert np.allclose(
113-
result[1][1].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
114-
)
11597

11698

11799
@pytest.mark.slow
@@ -133,13 +115,7 @@ def test_easy_ocr_predictions_for_torch_list(
133115
assert np.allclose(
134116
result[1][0].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
135117
)
136-
assert np.allclose(
137-
result[1][0].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
138-
)
139118
assert result[0][1].startswith("This is a test image for OCR")
140119
assert np.allclose(
141120
result[1][1].xyxy.cpu().numpy(), np.array([[6, 2, 786, 83]]), atol=5
142121
)
143-
assert np.allclose(
144-
result[1][1].confidence.cpu().numpy(), np.array([0.75062007]), atol=2e-2
145-
)

0 commit comments

Comments
 (0)