decoupled_light_FGEM_safe
This commit is contained in:
1 parent
36a232a655
commit
592c80a4ad
5 files changed
+121
-3
No files matched your search
+18
-1
@@ -48,6 +48,7 @@ from models.common import (
|
||||
GhostBottleneck,
|
||||
GhostConv,
|
||||
Proto,
|
||||
FGEMSafe,
|
||||
)
|
||||
from models.experimental import MixConv2d
|
||||
from utils.autoanchor import check_anchor_order
|
||||
@@ -152,7 +153,23 @@ class DetectDecoupledLite(nn.Module):
|
||||
self.regobj_convs = nn.ModuleList(Conv(head_c, head_c, 3, 1) for _ in ch)
|
||||
|
||||
# cls trunk
|
||||
self.cls_convs = nn.ModuleList(Conv(head_c, head_c, 3, 1) for _ in ch)
|
||||
# self.cls_convs = nn.ModuleList(Conv(head_c, head_c, 3, 1) for _ in ch)
|
||||
# cls trunk: only enhance higher-level scales for large-object bird recognition
|
||||
self.cls_convs = nn.ModuleList()
|
||||
for i, _ in enumerate(ch):
|
||||
if i < 2:
|
||||
# P3, P4: keep original cls trunk
|
||||
self.cls_convs.append(
|
||||
Conv(head_c, head_c, 3, 1)
|
||||
)
|
||||
else:
|
||||
# P5, P6: add safe FG enhancement
|
||||
self.cls_convs.append(
|
||||
nn.Sequential(
|
||||
Conv(head_c, head_c, 3, 1),
|
||||
FGEMSafe(head_c, head_c // 2, residual_scale=0.1)
|
||||
)
|
||||
)
|
||||
|
||||
# predictors
|
||||
self.box_preds = nn.ModuleList(nn.Conv2d(head_c, self.na * 4, 1) for _ in ch)
|
||||
|
||||
Reference in new issue
Block a user