output / src /ocr_engine.py
jayanth-2005's picture
Update src/ocr_engine.py
180356f verified
Raw History Blame Contribute Delete
273 Bytes
from paddleocr import PaddleOCR
import numpy as np
ocr = PaddleOCR(use_angle_cls=True, lang="en")
def extract_text(image):
result = ocr.ocr(image)
text = ""
for line in result:
for word in line:
text += word[1][0] + "\n"
return text