Update simple OCR test
This commit is contained in:
BIN
assets/pytest/OCR_test.png
Normal file
BIN
assets/pytest/OCR_test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
assets/pytest/image_upload_test.png
Normal file
BIN
assets/pytest/image_upload_test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
54
assets/pytest/receipt_ocr_test.txt
Normal file
54
assets/pytest/receipt_ocr_test.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
ave money. Live better.
|
||||
( 330 ) 339 - 3991
|
||||
MANAGER DIANA EARNEST
|
||||
231 BLUEBELL DR SW
|
||||
NEW PHILADELPHIA OH 44663
|
||||
ST# 02115 OP# 009044 TE# 44 TR# 01301
|
||||
PET TOY 004747571658 1.97 X
|
||||
FLOPPY PUPPY 004747514846 1.97 X
|
||||
SSSUPREME S 070060332153 4.97 X
|
||||
2 . 5 SQUEAK 084699803238 5.92 X
|
||||
MUNCHY DMBEL 068113108796 3.77 X
|
||||
DOG TREAT 007119013654 2.92 x
|
||||
PED PCH 1 002310011802 0.50 X
|
||||
PED PCH T 002310011802 0.50
|
||||
COUPON 23100 052310037000 1.00-0
|
||||
HNYMD SMORES 088491226837 F 3.98
|
||||
FRENCH DRSNG 004132100655 F 1 . 98
|
||||
3 ORANGES 001466835001 F 5.47
|
||||
BABY CARROTS 003338366602 I 1 . 48
|
||||
COLLARDS 0000000004614KI 1.24 N
|
||||
CALZONE 005208362080 F 2 . 50 O
|
||||
MM RVW MNT 003399105848 19.77 X
|
||||
STKOBRLPLABL 001558679414 1.97 x
|
||||
STKOBRLPLABL 001558679414 1.97
|
||||
STKO SUNFLWR 001558679410 0.97
|
||||
STKO SUNFLWR 001558679410 0.97
|
||||
STKO SUNFLWR 001558679410 0.97
|
||||
STKO SUNFLWR 001558679410 0.97 X
|
||||
BLING BEADS 076594060699 0.97
|
||||
GREAT VALUE 007874203191 F 9.97
|
||||
LIPTON 001200011224 F 4 . 48
|
||||
DRY DOG 002310011035 12.44
|
||||
SUBTOTAL 93.62
|
||||
TAX l 6.750 % 4.59
|
||||
TOTAL 98.21
|
||||
VISA TEND 98.21
|
||||
US DEBIT * * * * * * * * * * * * a I I 0
|
||||
APPROVAL # 572868
|
||||
REF # 720900544961
|
||||
TRANS ID - 387209239650894
|
||||
VALIDATION - 87HS
|
||||
PAYMENT SERVICE - E
|
||||
AID A0000000980840
|
||||
TC 51319CA81DC22BC7
|
||||
TERMINAL # SC010764
|
||||
*Signature Verified
|
||||
07/28/17 02 : 39 : 48
|
||||
CHANGE DUE 0.00
|
||||
ITEMS SOLD 2 5
|
||||
0223 1059 8001 e I 4 C
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Prices You Can Trust. Every
|
||||
07/28/17 02 : 39 : 48
|
||||
* CUSTOMER COPY ***
|
||||
@@ -1,7 +1,9 @@
|
||||
from src.ocr.surya import SuryaOCR
|
||||
from PIL.Image import open as pil_open
|
||||
|
||||
|
||||
def test_ocr_sample_image():
|
||||
image_path = "data/pytest/image_upload_test.png"
|
||||
output = ocr_image(image_path=image_path)
|
||||
assert output is not None
|
||||
image_path = pil_open("assets/pytest/OCR_test.png")
|
||||
ocr = SuryaOCR()
|
||||
output = ocr.ordered_ocr_text(image_path)
|
||||
assert output == "This is Line 1\nThis is Line 2\nThis is Line 5"
|
||||
|
||||
Reference in New Issue
Block a user