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!") | |