SIngtel-Bill-Scanner / final_test.py
Cosmo125's picture
Upload 26 files
795183d verified
raw
history blame contribute delete
358 Bytes
print("Testing TrOCR model...")
from transformers import pipeline
pipe = pipeline("image-to-text", model="microsoft/trocr-base-handwritten")
print("SUCCESS! Model loaded!")
from PIL import Image
img = Image.open("test_singtel_bill.png")
result = pipe(img)
print(f"Extracted: {result[0]['generated_text']}")
print("COMPLETE! Ready to scan bills!")