[G1][Backbone] add CBAM and export scripts

This commit is contained in:
Zhang Wei committed 2025-12-18 15:40:26 +08:00
1 parent 85acef3a28
commit bc7d124645
17 files changed
+1044 -95

No files matched your search

+4 -1
View File
@@ -27,6 +27,8 @@ if platform.system() != "Windows":
from models.common import (
C3,
C3CBAM, # ★ 新增
CBAM, # ★ 可选(严格来说不是必须,但建议)
C3SPP,
C3TR,
SPP,
@@ -414,6 +416,7 @@ def parse_model(d, ch):
CrossConv,
BottleneckCSP,
C3,
C3CBAM,
C3TR,
C3SPP,
C3Ghost,
@@ -426,7 +429,7 @@ def parse_model(d, ch):
c2 = make_divisible(c2 * gw, ch_mul)
args = [c1, c2, *args[1:]]
if m in {BottleneckCSP, C3, C3TR, C3Ghost, C3x}:
if m in {BottleneckCSP, C3, C3CBAM, C3TR, C3Ghost, C3x}:
args.insert(2, n) # number of repeats
n = 1
elif m is nn.BatchNorm2d: