Duplicated from gaunernst/layoutlm-docvqa-paddleocr
23 unmodified lines242526272728293023 unmodified lines def predict(image: Image.Image, question: str, ocr_engine: str): image_np = np.asarray(image) image_np = np.array(image) if ocr_engine == PADDLE_OCR_LABEL: ocr_result = OCR.ocr(image_np)[0]