Files
rapidocr/python/rapidocr_onnxruntime/utils/__init__.py
T
SWHL fd520ffdad Fix issue 232 (#235)
* fix(rapidocr_onnxruntime): Fixed padding_h variable before assignment

* feat(rapidocr_onnxruntime): Add resize function

* feat(rapidocr_onnxruntime): Add limit of max_side_len and min_side_len

* tests: Add __init__
2024-10-17 22:24:31 +08:00

21 lines
619 B
Python

# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: liekkaskono@163.com
from pathlib import Path
from typing import Dict, Union
import yaml
from .infer_engine import OrtInferSession
from .load_image import LoadImage, LoadImageError
from .logger import get_logger
from .parse_parameters import UpdateParameters, init_args, update_model_path
from .process_img import add_round_letterbox, increase_min_side, reduce_max_side
from .vis_res import VisRes
def read_yaml(yaml_path: Union[str, Path]) -> Dict[str, Dict]:
with open(yaml_path, "rb") as f:
data = yaml.load(f, Loader=yaml.Loader)
return data