2026-05-24 21:18:34 +08:00
|
|
|
from pathlib import Path
|
|
|
|
|
from pydantic import BaseSettings # pydantic v1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
model_path: str = str(Path(__file__).parent / "models" / "best.pt")
|
|
|
|
|
runtime: str = "ultralytics" # ultralytics | onnx
|
|
|
|
|
device: str = "cuda" # cuda | cpu
|
|
|
|
|
conf_threshold: float = 0.45
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
env_file = ".env"
|
|
|
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settings = Settings()
|