* fix(ml): handle empty/corrupt images in face detection
When a corrupt or degenerate image with zero-dimension (0 width or 0 height)
reaches the face detection pipeline, insightface's RetinaFace.detect() calls
cv2.resize() with a target size of 0, triggering an OpenCV assertion failure:
error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'
This crashes the ML worker and returns a 500 error to the server.
Add an early return in FaceDetector._predict() that checks for zero-dimension
images after decoding and returns empty detection results instead of passing
them to the insightface model.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(ml): move empty image validation to request level
Per review feedback, validate image dimensions in the predict endpoint
(returning 400) rather than in each model's _predict method. This
catches all zero-dimension images before they reach any model task.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(ml): resolve mypy strict type error in predict endpoint
Use intermediate `decoded` variable so mypy knows `.width` and `.height`
are accessed on `Image`, not on `Image | str`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Enable OpenVINO CPU acceleration in Immich
* Remove unnecessary debug log
* Removing checking for device_ids for openvino since cpu will always be available
* Find OpenVINOExecutionProvider index instead of assuming index 0
* Fix openvino tests
* Fix failing test mock. OpenVINO expects provider options, but cuda provide doesn't so use that for mocked tests.
* Support empty provider options in OrtSessions in which case ONNXRuntime will use its own defaults
* Use OpenVINOExecutionProvider for test_sets_provider_options_kwarg
* fix mock
* simplify
* unused variable
---------
Co-authored-by: Aleksander <pejcic@adobe.com>
Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
* fix: update ONNX runtime version to 1.21.0 to fix the failing checksum of 1.20.1
* update patch
* update to 1.22.1
---------
Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>