Skip to content

Commit f3f66ca

Browse files
committed
feat: update model path handling in ONNX OCR integration
1 parent 0c22337 commit f3f66ca

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/onnxocr/onnx_paddleocr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ def _build_ppocrv6_defaults(kwargs):
5050
if not size:
5151
return {}
5252

53-
model_root = Path(__file__).resolve().parent / "models" / "ppocrv6"
53+
from one_dragon.utils import os_utils
54+
model_root = Path(os_utils.get_path_under_work_dir('assets', 'models', 'onnx_ocr', model_name))
5455
config = PPOCRV6_MODEL_CONFIGS[size]
5556

5657
defaults = {
57-
"det_model_dir": str(model_root / size / "det" / "det.onnx"),
58-
"rec_model_dir": str(model_root / size / "rec" / "rec.onnx"),
58+
"det_model_dir": str(model_root / "det.onnx"),
59+
"rec_model_dir": str(model_root / "rec.onnx"),
5960
"rec_char_dict_path": str(model_root / config["rec_char_dict_path"]),
6061
"rec_image_shape": "3, 48, 320",
6162
"det_limit_side_len": 960,

0 commit comments

Comments
 (0)