feat(detect): 默认模型换成 yolo26n

CLAUDE.md 已把"只用 convolution 模型"收窄到聚类与数据集生成阶段,检测这一步
不再受限,于是换成最新的 YOLO26:端到端(NMS-free),推理侧少一道后处理。
取最小的 n 档——数据 1.1 万张且标签是弱监督的,模型大了容易把标注噪声学进去。

同时去掉 test_config.py 里"不许用 yolo11/yolo12"的断言,它的依据已随
CLAUDE.md 的改动失效。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Shaun Zhou
2026-09-11 14:34:16 +08:00
co-authored by Claude Opus 5
parent 0e830fe253
commit d6c6aca325
3 changed files with 10 additions and 13 deletions
+3 -3
View File
@@ -629,9 +629,9 @@ data/boxes_gradcam/
### 模型与增强的取舍
- **选 YOLOv8 而不是 v11/v12**:CLAUDE.md 限定只用 convolution 模型,而 YOLO11 骨架里有
C2PSA(position-sensitive attention)、YOLO12 更是以注意力为主。YOLOv8 的 C2f + SPPF 是纯卷积。
`s` 是精度/速度折中——数据只有 1.1 万张且标签是弱监督的,模型再大容易把标注噪声一起学进去。
- **默认 YOLO26 的 `n` 档**:CLAUDE.md 的"只用 convolution 模型"只约束聚类与数据集生成阶段,
检测这一步不受限,所以用最新的 YOLO26——它是端到端的(NMS-free),推理侧少一道后处理。
选最小的 `n`:数据只有 1.1 万张且标签是弱监督的,模型再大容易把标注噪声一起学进去。
- **关掉 mosaic / mixup**:它们把四张图拼一起,而我们每张图只有一个弱监督框,拼接后小目标被
缩得更小,对 `blackdot`/`whitedot` 这类本就只占千分之几面积的类别是净伤害。
- **关掉 hsv_h**:薄膜图近乎单色,色相扰动没有意义。翻转照旧开着(缺陷没有固定朝向)。
+4 -5
View File
@@ -17,11 +17,10 @@ data:
yaml: data/boxes_shap/data.yaml
model:
# 选 v8 而不是 v11/v12:CLAUDE.md 限定只用 convolution 模型,
# 而 YOLO11 的骨架里有 C2PSA(position-sensitive attention)、YOLO12 更是以注意力为主。
# YOLOv8 的 C2f + SPPF 是纯卷积。
# s 是精度/速度的折中;数据只有 1.1 万张且标签是弱监督的,再大容易把标注噪声也学进去。
weights: yolov8s.pt
# CLAUDE.md 的"只用 convolution 模型"只约束聚类与数据集生成阶段,检测这一步不受限,
# 所以用最新的 YOLO26。它是端到端的(NMS-free),推理侧少一道后处理。
# n 是最小的一档:数据只有 1.1 万张且标签是弱监督的,模型大了容易把标注噪声也学进去。
weights: yolo26n.pt
train:
epochs: 100
+3 -5
View File
@@ -140,11 +140,9 @@ def test_every_shipped_config_builds_its_components(config_path):
# 分类配置
model_cfg = cfg.get("model")
if model_cfg and "weights" in model_cfg:
# 检测配置:model 是 ultralytics 的权重名(yolov8s.pt),不走本仓库的注册表。
# 只校验它是纯卷积的那一档——CLAUDE.md 限定只用 convolution 模型,
# YOLO11 的 C2PSA 与 YOLO12 都带注意力。
assert "yolo11" not in model_cfg["weights"]
assert "yolo12" not in model_cfg["weights"]
# 检测配置:model 是 ultralytics 的权重名(yolo26n.pt),不走本仓库的注册表,
# 这里只确认它确实是个权重文件名。
assert model_cfg["weights"].endswith(".pt")
elif model_cfg:
import torch