Spaces:
Sleeping
Sleeping
| 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() |