from pathlib import Path
from paddleocr import PaddleOCR
root=Path(__file__).resolve().parent
ocr=PaddleOCR(device='cpu',text_detection_model_name='PP-OCRv5_mobile_det',text_recognition_model_name='PP-OCRv5_mobile_rec',use_doc_orientation_classify=False,use_doc_unwarping=False,use_textline_orientation=False)
for item in ocr.predict(str(root/'source.png')):
    item.save_to_json(str(root/'ocr-output'))
    item.save_to_img(str(root/'ocr-output'))
