Repository navigation
Releases
MaskFlow v3.0.0 — 一站式全自动:标注、训练与 MCP 智能体
MaskFlow v3.0.0 把 MaskFlow 从“AI 标注工具”升级为一站式、全自动的视觉数据平台:只管上传图片,标注、质检、训练、评估都能在平台里完成——在网页里点几下,或者直接在 Claude、ChatGPT、Codex 的对话框里说一句话。
亮点
💬 MCP 智能体
- 内置 MCP 服务(
/mcp,Streamable HTTP),25 个工具覆盖项目、标注、质检、训练、评估与导出。 - 智能体能“看图”:
view_image把标注画在图上返回,可叠加模型预测对比;view_training_plot查看混淆矩阵、预测效果。 - 两种连接方式:API Token(Claude Code、Codex、Cursor 等本地客户端),以及 OAuth 2.1(动态注册 + PKCE,供 ChatGPT、claude.ai 等云端连接器)。「账户设置 → 智能体连接」提供 MCP 地址、配置示例和已连接应用管理。
- 智能体新增或修改的目标一律保存为“待确认”,人工同意后才确认。
🧩 一站式训练与评估
- 基础权重管理:官方 YOLO26 / YOLO11 / YOLOv8(n–x,检测 / 分割 / 分类,共 45 个)一键下载,按官方文件大小和格式校验,可删除。
- 训练前数据检查:最少图片数与每类最少图片数为硬性要求;逐类显示训练 / 验证 / 测试的实际分布,并给出“还要补多少张、补什么样的图”的建议。
- 开始训练前确认:参与图片数、各集合分配、逐类分布和注意事项。
- 训练过程实时曲线;验证集 / 测试集与逐类评估;预测效果与人工标注左右对照、混淆矩阵、PR / F1 曲线、增强样本。
- 训练包一键下载:基础权重、本次数据集、可直接运行的
train.py/predict.py、requirements.txt、带指标的 README,以及训练产生的全部文件。 - 训练好的模型自动注册回标注工具,形成“标注 → 训练 → 自动标注”的闭环;还可以用人工确认的标注评估任意模型。
🤖 全自动标注
- SAM 3 按项目标签识别(中文标签可配英文提示词),每个目标直接带类别与置信度;可用自己训练或上传的 YOLO(ONNX)模型预标注。
- 后台批量标注:排队执行、进度可见、可取消,API 重启后续跑,不覆盖人工确认的目标;可对选中的图片批量运行。
- AI 未检测到目标的图片保持“未标注”并单独计数,不会被误当作完成,也不会被当作负样本进入导出和训练。
- 视频上传自动抽帧,标注一帧后逐帧向后传播。
数据、复核与协作
- 数据集导入(YOLO / COCO / LabelMe / VOC),导出新增 COCO、Pascal VOC,近重复图片自动归入同一集合。
- 统一的标注状态(未标注 / 待确认 / 已确认 / 背景图),多选(Shift 连选)批量 AI 标注、清除标注、删除;拖拽上传。
- 框与多边形编辑、撤销重做、全套快捷键、缩放平移、保存后自动下一张、低置信度优先复核、质量检查。
- 团队协作:项目成员与角色、邀请、图片分配、提交 / 通过 / 驳回审核;SMTP 邮件(找回密码、邀请、任务通知)。
安全、可靠性与性能
- 修复找回密码接口回显重置码导致的账号接管风险;反向代理后按真实 IP 限流;统一错误响应,不再泄露堆栈。
- 会话令牌改为哈希存储(启动时自动转换,已登录用户不受影响);数据库改为增量写入,读写快照隔离;存储对象与数据库保持一致。
- 修复 AI 标注框系统性偏大的问题;分类裁剪按 EXIF 方向处理;图像处理库换为 MIT 许可的 SkiaSharp;自定义模型只接受 ONNX(
.pt加载即可执行代码)。 - 推理与训练服务之间使用内部密钥;训练产物下载使用短时效签名链接。
升级说明
- 数据库:新增表和字段在 API 启动时自动创建,需要 MySQL 8.0.19 及以上(CI 使用 8.4)。
- 环境变量:请对照新的
.env.example/.env.production.example。docker-compose.yml中ASPNETCORE_ENVIRONMENT的默认值改为Production,MASKFLOW_BILLING_DEV_MODE默认关闭;MASKFLOW_PASSWORD_RESET_INLINE已移除。- 新增:
MASKFLOW_PUBLIC_URL(邮件链接与 MCP / OAuth 签发地址)、MASKFLOW_TRUSTED_PROXIES、MASKFLOW_SMTP_*、MASKFLOW_ADMIN_EMAILS、MASKFLOW_TRAIN_MIN_IMAGES、MASKFLOW_TRAIN_MIN_PER_CLASS、TRAIN_WEIGHT_BASE_URL。
- 训练服务(可选,需要 GPU):
docker compose --profile training up -d --build。权重目录资源/训练权重需要可写;第一个注册的账号(或MASKFLOW_ADMIN_EMAILS)可下载 / 删除基础权重。 - 反向代理:除
/api外,还需把/mcp(关闭缓冲)、/oauth/、/.well-known/oauth-*转发到 API(内置 nginx 已配置)。ChatGPT、Claude 网页版连接 MCP 需要公网 HTTPS。 - 行为变化:旧版本中 AI 没检测到目标而留下的空标注,现在视为“未标注”,不再作为负样本导出或训练;确实没有目标的图片请用「标为背景图」。
- SAM 3 权重仍需自行申请下载:https://huggingface.co/facebook/sam3 ,放到
资源/模型/sam3.pt。
验证
master上 CI 全部通过:前端测试与构建、npm audit,后端测试(含 MySQL 8.4 集成、真实 API 端到端、MCP 与 OAuth 流程),推理与训练服务 pytest,Compose 配置校验。- 发布前在本地:后端 184 项、推理与训练服务 37 项、前端 15 项测试全部通过;Release 构建无警告;NuGet / npm 漏洞检查通过。
- 已在实际使用中完成 248 张图片的标注、yolo26x 训练、评估与模型回用(见 README 截图)。
完整改动见 文档/修改记录.md,MCP 接入说明见 文档/智能体连接.md。
English summary
MaskFlow v3.0.0 turns MaskFlow into a one-stop, fully automatic vision data platform: upload images, and annotation, quality checks, training and evaluation all happen in one place — from the web app or from a chat with Claude, ChatGPT or Codex.
- MCP agents: built-in MCP server (
/mcp, Streamable HTTP) with 25 tools; agents can see labels drawn on images; connect with API tokens or OAuth 2.1 (dynamic registration + PKCE) for ChatGPT / claude.ai connectors. - One-stop training: one-click official YOLO26 / YOLO11 / YOLOv8 base weights; training data check with per-class split and concrete advice; confirmation dialog; live curves; val/test and per-class evaluation; predictions next to labels; a downloadable training package (base weight, dataset, runnable
train.py/predict.py, README with metrics, every output). Trained models are registered back into the annotation tool. - Automatic annotation: SAM 3 by label name, your own ONNX models, server-side batch runs (also on selected images); images where nothing is detected stay unannotated and never become false negatives.
- Data and teamwork: dataset import, COCO / VOC export, near-duplicate grouping, unified statuses with bulk actions, rich editing and shortcuts, roles, invitations and review workflow, SMTP email.
- Security and reliability: fixed an account-takeover issue in password reset, real-client-IP rate limiting, hashed session tokens, incremental persistence with snapshot isolation, storage/database consistency, tight AI boxes, ONNX-only custom models.
Upgrading: schema migrates automatically (MySQL 8.0.19+). Review .env.example — docker-compose.yml now defaults to Production, and there are new variables for the public URL, trusted proxies, SMTP, admins and training. Start the optional trainer with docker compose --profile training up -d --build (writable weights folder). Proxy /mcp, /oauth/ and /.well-known/oauth-* to the API. Empty AI results from older versions now count as unannotated.
MaskFlow v2.1.0 — Open Source Ready
MaskFlow v2.1.0 is the first formal open-source readiness release. It turns the existing product codebase into a safer, reproducible and contributor-friendly project.
Highlights
- Adopted the GNU AGPL-3.0 license and added third-party notices.
- Redesigned the README with four real product screenshots and a clearer upload → segment/review → export story.
- Added cross-platform quick-start and production deployment guidance.
- Made fresh Docker Compose deployments self-contained: MySQL and API volumes are created automatically.
- Bound Web, API, SAM, MySQL and MinIO to loopback by default for safer local deployment.
- Added production configuration that rejects example/development secrets and disables inline password reset and billing development mode.
- Enabled SAM internal authentication by default and switched key comparison to constant-time comparison.
- Added consistent minimum password validation for registration, reset and password change.
- Added GitHub Actions CI, Dependabot and protected the
masterbranch. - Updated vulnerable frontend transitive dependencies; high-severity npm audit findings are now zero.
CI verification
All checks passed on master:
- Frontend build and high-severity npm audit
- .NET 9 backend test suite
- Python source checks
- Docker Compose configuration validation
Deployment notes
Existing deployments should compare their .env with .env.example or .env.production.example. Production hosts must replace every replace-me value. Internal services remain bound to 127.0.0.1 unless an explicit bind address is configured.
SAM 3 weights are not included. Request access and download sam3.pt from https://huggingface.co/facebook/sam3, then place it at 资源/模型/sam3.pt.
See 文档/修改记录.md for the project changelog.
