19 lines
884 B
Python
19 lines
884 B
Python
import os
|
|
|
|
# 运行模式:mock(默认,无模型文件)| onnx(加载 best.onnx 真实推理)
|
|
MODEL_MODE = os.getenv("MODEL_MODE", "mock")
|
|
MODEL_PATH = os.getenv("MODEL_PATH", "models/best.onnx")
|
|
# YOLO 类别(二分类训练基线:healthy/sick;7 类病种扩展后再调整)
|
|
MODEL_LABELS = os.getenv("MODEL_LABELS", "healthy,sick").split(",")
|
|
# mock 模式返回的固定结果
|
|
MOCK_CLASS = os.getenv("MOCK_CLASS", "healthy")
|
|
MOCK_CONFIDENCE = float(os.getenv("MOCK_CONFIDENCE", "0.95"))
|
|
INTERNAL_API_KEY = os.getenv("INTERNAL_API_KEY", "silk-internal-2026")
|
|
ALLOWED_STREAM_HOSTS = [
|
|
item.strip()
|
|
for item in os.getenv("ALLOWED_STREAM_HOSTS", "localhost,127.0.0.1,100.83.103.1").split(",")
|
|
if item.strip()
|
|
]
|
|
STREAM_TASK_MAX_WORKERS = int(os.getenv("STREAM_TASK_MAX_WORKERS", "2"))
|
|
STREAM_TASK_MAX_FRAMES = int(os.getenv("STREAM_TASK_MAX_FRAMES", "10"))
|