mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(ml) backend takes image over HTTP (#2783)
* using pydantic BaseSetting * ML API takes image file as input * keeping image in memory * reducing duplicate code * using bytes instead of UploadFile & other small code improvements * removed form-multipart, using HTTP body * format code --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
3e804f16df
commit
34201be74c
8 changed files with 116 additions and 80 deletions
22
machine-learning/app/config.py
Normal file
22
machine-learning/app/config.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from pydantic import BaseSettings
|
||||
|
||||
class Settings(BaseSettings):
|
||||
cache_folder: str = "/cache"
|
||||
classification_model: str = "microsoft/resnet-50"
|
||||
clip_image_model: str = "clip-ViT-B-32"
|
||||
clip_text_model: str = "clip-ViT-B-32"
|
||||
facial_recognition_model: str = "buffalo_l"
|
||||
min_tag_score: float = 0.9
|
||||
eager_startup: bool = True
|
||||
model_ttl: int = 300
|
||||
host: str = "0.0.0.0"
|
||||
port: int = 3003
|
||||
workers: int = 1
|
||||
min_face_score: float = 0.7
|
||||
|
||||
class Config(BaseSettings.Config):
|
||||
env_prefix = 'MACHINE_LEARNING_'
|
||||
case_sensitive = False
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Loading…
Add table
Add a link
Reference in a new issue