from .util import Args
import numpy as np
from paddleocr.tools.infer.predict_system import TextSystem


class Ocr:
    def __init__(self):
        self._args = Args(
            use_gpu=False,
            enable_mkldnn=True,
            det_model_dir="models/det/",
            rec_model_dir="models/rec/"
        )
        self._eng = TextSystem(self._args)
        img = np.random.uniform(0, 255, [640, 640, 3]).astype(np.uint8)
        [self._eng(img) for _ in range(10)]
