-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http:https://b/182904500
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import unittest | ||
|
||
import easyocr | ||
|
||
class TestEasyOCR(unittest.TestCase): | ||
def test_readtext(self): | ||
# The model_storage_directory is only need in tests where we overwrite HOME=/tmp | ||
reader = easyocr.Reader(['en'], gpu=False, model_storage_directory='/root/.EasyOCR/model') | ||
result = reader.readtext('/input/tests/data/english.png', detail = 0) | ||
# ['Reduce your risk of coronavirus infection:', 'Clean hands with soap and water', | ||
# 'or alcohol based hand rub', 'Cover nose and mouth when coughing and', | ||
# 'sneezing with tissue or flexed elbow', 'Avoid close contact with anyone with', | ||
# 'cold or flu like symptoms', 'Thoroughly cook meat and eggs', | ||
# 'No unprotected contact with live wild', 'or farm animals', 'World Health', 'Organization'] | ||
self.assertEqual(len(result), 12) |