mirror-immich/machine-learning/immich_ml
pneuly a838167f11
fix(ml): pass model_root_dir to OcrOptions for RapidOCR compatibility (#28610)
* fix(ml): pass model_root_dir to OcrOptions for RapidOCR compatibility

Fix a TypeError (Path(None)) when the OCR model is invoked, caused by an upstream change in RapidOCR v3.8.1 (RapidAI/RapidOCR@8ea9626).
RapidOCR now internally calls `Path(cfg.get("model_root_dir"))`. Since `model_root_dir` was missing from `OcrOptions`, it evaluated to `None` and triggered a `TypeError: argument should be a str or an os.PathLike`.
This fix adds the missing `model_root_dir` argument to prevent the error.
Ref: #28331

* fix(ml-test): update OCR tests for RapidOCR schema change

* chore(ml-test): remove unused `cache_dir` parameter from `TextRecognizer`

* Revert "chore(ml-test): remove unused `cache_dir` parameter from `TextRecognizer`"

This reverts commit 007ad7b3f2.

* fix(ml): use self.cache_dir for model_root_dir in OcrOptions
2026-05-28 22:54:04 -04:00
..
models fix(ml): pass model_root_dir to OcrOptions for RapidOCR compatibility (#28610) 2026-05-28 22:54:04 -04:00
sessions fix(ml): stabilize MIGraphX inference (#28444) 2026-05-26 18:41:56 +00:00
__init__.py chore(ml): installable package (#17153) 2025-03-27 19:49:09 +00:00
__main__.py fix(ml): ipv6 check (#22735) 2025-10-07 12:24:23 -04:00
config.py fix(ml): stabilize MIGraphX inference (#28444) 2026-05-26 18:41:56 +00:00
gunicorn_conf.py chore(ml): installable package (#17153) 2025-03-27 19:49:09 +00:00
log_conf.json chore(ml): installable package (#17153) 2025-03-27 19:49:09 +00:00
main.py chore(ml)!: remove deprecated envs (#28326) 2026-05-09 22:40:05 +00:00
schemas.py feat(ml): add preload and fp16 settings for ocr (#23576) 2025-11-06 17:55:11 +00:00