Spaces:
Running
Running
File size: 966 Bytes
12d0de7 e3a4ee9 12d0de7 e3a4ee9 12d0de7 e3a4ee9 12d0de7 e3a4ee9 12d0de7 e3a4ee9 12d0de7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
# Application settings with defaults
APP_NAME: str = "FaceRecognitionAPI"
APP_VERSION: str = "1.0.0"
APP_VARIENT: str = "v1"
# Server settings with defaults
host: str = "0.0.0.0"
port: int = 7860
# Detection settings with defaults
DETECTION_MODEL: str = "mtcnn" # Options: mtcnn, yoloface
YOLOFACE_MODEL_PATH: str = "assets/yolov11n-face.pt"
# Database settings with defaults
CHROMA_DB_PATH: str = "./chroma_data"
COLLECTION_NAME: str = "face_embeddings_collection"
# Recognition settings with defaults
SIMILARITY_THRESHOLD: float = 0.7
MAX_RESULTS: int = 1
class Config:
env_file = ".env"
env_file_encoding = 'utf-8'
case_sensitive = False
extra = "ignore" # Ignore extra environment variables
def get_settings():
return Settings() |