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