Files
observer/server/config.yml
T
2026-08-27 17:54:48 +08:00

105 lines
4.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 视野后端配置
server:
address: ":18080"
openapiPath: "/api.json"
# 请求体上限(默认 8MB):APK 上传(管理端下发新版本)可能数百 MB,必须放大
clientMaxBodySize: "512mb"
database:
default:
type: sqlite
# SQLite 数据文件(运行时数据,不提交 git)
link: "sqlite::@file(./data/observer.db)"
cache:
# 查询缓存 TTL(秒)
ttl: 30
auth:
# 登录 token 签名密钥(HMAC-SHA256,必填):换值即全员下线
secret: "changeme-auth-secret"
# 登录 token 有效期(秒),默认 30 天
tokenTtl: 2592000
admin:
# 后台管理端静态 token:请求头 X-Admin-Token 必须匹配;为空时管理接口全部拒绝
token: "Tongli686^*^"
app:
# Android APK 上传目录(运行时数据,与 ./data 平级、docker-compose 挂载持久化;
# 目录下永远只保留最新一个文件 observer-latest.apk,下载地址固定 /download/observer-latest.apk
apkDir: "./workspace"
# 模型训练体系运行时数据根目录(图片/标注/模型/训练产物;与 apkDir 同目录时共用 workspace
datasetDir: "./workspace"
# 图像生成(管理端「AI 生成图片」):provider 必填项缺失时生成接口返回「图像生成服务未配置」
imageGen:
provider: localai # dashscope | localai
baseUrl: "http://192.168.3.210:18080" # localai 必填:训练机 local-ai 地址(/v1/images/generations
model: z-image-turbo # localai 上加载的模型名;dashscope 用 qwen-image-3.0
apiKey: "" # dashscope 必填:DashScope API Key
timeoutSeconds: 1800 # 每张生成超时(默认 120localai 训练机 704x1248 竖版实测约 26min/张)
# 训练通道(并发度 1:GPU 独占,同时仅一个 running 任务):
# mode=subprocess 训练机与服务器同机;mode=ssh 异机(训练脚本/数据集经 ssh 通道同步)
training:
mode: ssh # subprocess | ssh
ssh:
host: "192.168.3.210" # 训练机地址(mode=ssh 必填)
user: "root"
port: 22
privateKeyPath: "" # 私钥路径与 password 二选一
password: "123"
workdir: /opt/pheasant_data # 训练机工作目录(train_server.py / yolov8n.pt 所在)
venvPython: /opt/pheasant_data/venv/bin/python
datasetDir: datasets # 训练机数据集根目录(相对 workdiryolo/<name> 为子目录)
timeoutMinutes: 240 # 训练超时判死(started_at 起算;实测 100 张约 3 分钟,千图级约 1 小时)
imgsz: 704 # 训练/导出分辨率(须与 App 端推理输入对齐)
epochs: 150 # 训练轮数(patience 30 早停,设大可自动停)
batch: 16 # 批大小(按训练机显存调整)
device: "0" # GPU 编号(cpu 用 cpu
# RF-DETR 预标注服务(管理端标注工作台):需从服务器可达,未配置时预标注接口返回「标注服务未配置」
localAi:
baseUrl: "http://192.168.3.210:18080" # 如 http://127.0.0.1:18080local-ai 兼容 /v1/detection
model: rfdetr-xlarge
threshold: 0.08 # 候选置信度阈值(宁多勿漏)
confConfirmed: 0.2 # 高于此视为确认(class 0),否则疑似(class 1)
overlapThreshold: 0.3 # 重叠去重阈值(交叠/较小框面积,NMS 风格;RF-DETR 同目标常输出一大一小两框,minIoU 比 IoU 更能命中)
inputSize: 700 # 提交前整图等比缩放最长边
classNames: [pheasant, suspect] # 标注类别名(写入 data.yaml,随 result.json 存模型 labels
labelTask:
# 预标注并发度(逐张调 RF-DETR,缺失或非法时回退默认值)
poolSize: 4
# 套餐定价(静态配置,改价 = 改本节点后重启服务;金额单位为分,展示名由 days 派生"N天"
plans:
- id: day
days: 1
price_cents: 1000
- id: week
days: 7
price_cents: 5600
- id: month
days: 30
price_cents: 18000
payment:
# 回调验签/IO 处理并发度(缺失或非法时回退默认值)
poolSize: 16
wechat:
# 微信支付 APP 支付(APIv3),商户号未配置时接口返回「支付未配置」
appid: "" # 开放平台 AppID
mchid: "" # 商户号
apiV3Key: "" # APIv3 密钥
serialNo: "" # 商户证书序列号
privateKey: "" # 商户 API 私钥文件路径(PEM)
notifyUrl: "" # 回调地址,如 https://api.example.com/api/v1/payment/wechat/notify
alipay:
# 支付宝 APP 支付,未配置时接口返回「支付未配置」
appid: "" # 开放平台 AppID
privateKey: "" # 应用私钥文件路径(PEM)
alipayPublicKey: "" # 支付宝公钥文件路径(PEM)
sellerId: "" # 收款方 PID(回调校验 app_id/seller_id 用)
notifyUrl: "" # 回调地址,如 https://api.example.com/api/v1/payment/alipay/notify