feat: frigate-notify v2 (modular app, CLIP recognition) + clip-service
Splits the single main.py into config/database/models/routes/vision/recognition/ ollama_client/cleanup modules, adds a web UI, and introduces clip-service for CLIP (ViT-L-14) embeddings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
"""Centralized configuration for frigate-notify v2."""
|
||||
|
||||
import os
|
||||
|
||||
|
||||
class Config:
|
||||
"""Application configuration read from environment variables."""
|
||||
|
||||
# MQTT
|
||||
MQTT_HOST: str = os.environ.get("MQTT_HOST", "192.168.86.192")
|
||||
MQTT_PORT: int = int(os.environ.get("MQTT_PORT", "1883"))
|
||||
|
||||
# Frigate
|
||||
FRIGATE_URL: str = os.environ.get("FRIGATE_URL", "http://192.168.86.192:5000")
|
||||
|
||||
# Matrix
|
||||
MATRIX_HOMESERVER: str = os.environ.get(
|
||||
"MATRIX_HOMESERVER", "http://192.168.86.192:8008"
|
||||
)
|
||||
MATRIX_ACCESS_TOKEN: str = os.environ.get("MATRIX_ACCESS_TOKEN", "")
|
||||
MATRIX_ROOM_ID: str = os.environ.get("MATRIX_ROOM_ID", "")
|
||||
|
||||
# Vision - CLIP service
|
||||
CLIP_SERVICE_URL: str = os.environ.get(
|
||||
"CLIP_SERVICE_URL", "http://192.168.86.150:5200"
|
||||
)
|
||||
|
||||
# Vision - Ollama
|
||||
OLLAMA_URL: str = os.environ.get("OLLAMA_URL", "http://192.168.86.150:11434")
|
||||
OLLAMA_MODEL: str = os.environ.get("OLLAMA_MODEL", "llava:13b")
|
||||
|
||||
# Recognition thresholds
|
||||
RECOGNITION_THRESHOLD_HIGH: float = float(
|
||||
os.environ.get("RECOGNITION_THRESHOLD_HIGH", "0.85")
|
||||
)
|
||||
RECOGNITION_THRESHOLD_LOW: float = float(
|
||||
os.environ.get("RECOGNITION_THRESHOLD_LOW", "0.60")
|
||||
)
|
||||
|
||||
# Filtering
|
||||
ALLOWED_LABELS: set = set(
|
||||
os.environ.get("ALLOWED_LABELS", "person,car,dog,cat,bird").split(",")
|
||||
)
|
||||
MIN_SCORE: float = float(os.environ.get("MIN_SCORE", "0.7"))
|
||||
RATE_LIMIT_SECONDS: int = int(os.environ.get("RATE_LIMIT_SECONDS", "60"))
|
||||
DEDUP_WINDOW_SECONDS: int = int(os.environ.get("DEDUP_WINDOW_SECONDS", "30"))
|
||||
|
||||
# Server
|
||||
SERVER_HOST: str = os.environ.get("SERVER_HOST", "0.0.0.0")
|
||||
SERVER_PORT: int = int(os.environ.get("SERVER_PORT", "5199"))
|
||||
|
||||
# Database
|
||||
DB_PATH: str = os.environ.get("DB_PATH", "/data/frigate-notify.db")
|
||||
|
||||
|
||||
config = Config()
|
||||
Reference in New Issue
Block a user