- 新增 Seg_Server_Docker 自包含部署内容,包含前后端、FastAPI、Celery、PostgreSQL、Redis、MinIO、演示视频和 DICOM 数据。 - 保留 demo 数据以支持恢复演示出厂设置,排除 SAM 2.1 .pt 权重并在 README 中补充下载命令。 - 补充 GPU 部署、backend/worker 镜像复用、frpc/frps + NPM 公网域名反代部署说明。 - 在 .env/.env.example 中用 # XXXX 标注局域网和公网域名部署需要修改的配置项。 - 添加部署分支 .gitignore,忽略本地模型权重、构建产物、缓存和日志。
52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
"""Application configuration using Pydantic Settings."""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# Database
|
|
db_url: str = "postgresql://seguser:segpass123@localhost:5432/segserver"
|
|
|
|
# Redis
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
|
|
# MinIO
|
|
minio_endpoint: str = "192.168.3.11:9000"
|
|
minio_public_endpoint: str | None = None
|
|
minio_access_key: str = "minioadmin"
|
|
minio_secret_key: str = "minioadmin"
|
|
minio_secure: bool = False
|
|
|
|
# SAM
|
|
sam_default_model: str = "sam2.1_hiera_tiny"
|
|
sam_model_path: str = "/home/wkmgc/Desktop/Seg_Server/models/sam2.1_hiera_tiny.pt"
|
|
sam_model_config: str = "configs/sam2.1/sam2.1_hiera_t.yaml"
|
|
sam3_model_version: str = "sam3"
|
|
sam3_checkpoint_path: str = "/home/wkmgc/Desktop/Seg_Server/sam3权重/sam3.pt"
|
|
sam3_external_enabled: bool = False
|
|
sam3_external_python: str = "/home/wkmgc/miniconda3/envs/sam3/bin/python"
|
|
sam3_timeout_seconds: int = 300
|
|
sam3_status_cache_seconds: int = 30
|
|
sam3_confidence_threshold: float = 0.5
|
|
|
|
# App
|
|
app_env: str = "development"
|
|
cors_origins: list[str] = ["http://localhost:3000", "http://192.168.3.11:3000"]
|
|
jwt_secret_key: str = "seg-server-dev-secret-change-me"
|
|
jwt_algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 60 * 24
|
|
default_admin_username: str = "admin"
|
|
default_admin_password: str = "123456"
|
|
demo_video_path: str = "/home/wkmgc/Desktop/Seg_Server/demo/演视LC视频序列.mp4"
|
|
demo_dicom_dir: str = "/home/wkmgc/Desktop/Seg_Server/demo/演视DICOM序列"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
extra = "ignore"
|
|
|
|
|
|
settings = Settings()
|