mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 17:23:16 +03:00
feat(ml): multilingual ocr (#23527)
* handle other languages in ml server * add variants to model selector * no need to override path * unused import
This commit is contained in:
@@ -23,7 +23,7 @@ class TextDetector(InferenceModel):
|
||||
identity = (ModelType.DETECTION, ModelTask.OCR)
|
||||
|
||||
def __init__(self, model_name: str, **model_kwargs: Any) -> None:
|
||||
super().__init__(model_name, **model_kwargs, model_format=ModelFormat.ONNX)
|
||||
super().__init__(model_name.split("__")[-1], **model_kwargs, model_format=ModelFormat.ONNX)
|
||||
self.max_resolution = 736
|
||||
self.mean = np.array([0.5, 0.5, 0.5], dtype=np.float32)
|
||||
self.std_inv = np.float32(1.0) / (np.array([0.5, 0.5, 0.5], dtype=np.float32) * 255.0)
|
||||
|
||||
Reference in New Issue
Block a user