修改了v3(支持自然场景、混合文字场景识别)版本的inference.py模版

This commit is contained in:
三洋三洋
2024-04-05 07:25:06 +00:00
parent 5b730329b4
commit 34ac31504a
3 changed files with 46 additions and 10 deletions

19
src/utils.py Normal file
View File

@@ -0,0 +1,19 @@
import numpy as np
from models.ocr_model.utils.inference import inference as latex_inference
def load_lang_models(language: str):
...
# language: 'ch' or 'en'
# return det_model, rec_model (or model)
def load_det_tex_model():
...
# return the loaded latex detection model
def mix_inference(latex_det_model, latex_rec_model, lang_model, img: np.ndarray, use_cuda: bool) -> str:
...
# latex_inference(...)