13 lines
331 B
Python
Executable File
13 lines
331 B
Python
Executable File
from ..utils.ocr_yolox import OcrEngineForYoloX_Invoice
|
|
|
|
|
|
det_ckpt = "yolox-s-general-text-pretrain-20221226"
|
|
cls_ckpt = "satrn-lite-general-pretrain-20230106"
|
|
|
|
ocr_engine = OcrEngineForYoloX_Invoice(det_ckpt, cls_ckpt)
|
|
|
|
|
|
def ocr_predict(image_url):
|
|
|
|
bboxes, texts = ocr_engine.run_image(image_url)
|
|
return bboxes, texts |