MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestEasyOCR

Class TestEasyOCR

tests/test_easyocr.py:5–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import easyocr
4
5class TestEasyOCR(unittest.TestCase):
6 def test_readtext(self):
7 # The model_storage_directory is only need in tests where we overwrite HOME=/tmp
8 reader = easyocr.Reader(['en'], gpu=False, model_storage_directory='/root/.EasyOCR/model')
9 result = reader.readtext('/input/tests/data/english.png', detail = 0)
10 # ['Reduce your risk of coronavirus infection:', 'Clean hands with soap and water',
11 # 'or alcohol based hand rub', 'Cover nose and mouth when coughing and',
12 # 'sneezing with tissue or flexed elbow', 'Avoid close contact with anyone with',
13 # 'cold or flu like symptoms', 'Thoroughly cook meat and eggs',
14 # 'No unprotected contact with live wild', 'or farm animals', 'World Health', 'Organization']
15 self.assertEqual(len(result), 12)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected