feat: 训练与评估入口及 yaml 配置
- train.py: 先过 require_cuda() 守卫再建模型/数据,支持 --resume 与 --set 覆盖 - eval.py: 允许 CPU,输出定位与分类指标并可写 json - configs: model/dataset/train/eval 四类,通过 `_base_` 组合; classes 既可直接写列表,也可指向 YOLO data.yaml 由框架读 names Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
ef64e5bf77
commit
b0d0dfffbb
@@ -0,0 +1,15 @@
|
||||
# torchvision resnet18:stride 32 + 3 次上采样 => 输出 stride 4。
|
||||
model:
|
||||
name: defect_net
|
||||
backbone:
|
||||
name: torchvision
|
||||
arch: resnet18
|
||||
pretrained: true
|
||||
in_channels: 3
|
||||
neck:
|
||||
name: upsample
|
||||
channels: 64
|
||||
num_upsamples: 3
|
||||
head:
|
||||
hidden_channels: 64
|
||||
with_classification: true
|
||||
@@ -0,0 +1,18 @@
|
||||
# 自研轻量骨架:backbone stride 16 + 2 次上采样 => 输出 stride 4。
|
||||
model:
|
||||
name: defect_net
|
||||
backbone:
|
||||
name: tiny_conv
|
||||
in_channels: 3
|
||||
widths: [32, 64, 128, 256]
|
||||
depths: [1, 2, 2, 2]
|
||||
block: dw # dw=深度可分离(更快) / res=残差(更强)
|
||||
neck:
|
||||
name: upsample
|
||||
channels: 64
|
||||
num_upsamples: 2
|
||||
head:
|
||||
hidden_channels: 64
|
||||
with_classification: true
|
||||
classification:
|
||||
dropout: 0.1
|
||||
Reference in New Issue
Block a user