Skip to content

Commit 1d28355

Browse files
committed
🔀 [Merge] branch 'MODEL'
2 parents 0a49638 + 7f10ef0 commit 1d28355

2 files changed

Lines changed: 136 additions & 1 deletion

File tree

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: v9-t
2+
3+
anchor:
4+
reg_max: 16
5+
6+
model:
7+
backbone:
8+
- Conv:
9+
args: {out_channels: 16, kernel_size: 3, stride: 2}
10+
source: 0
11+
- Conv:
12+
args: {out_channels: 32, kernel_size: 3, stride: 2}
13+
- ELAN:
14+
args: {out_channels: 32, part_channels: 32}
15+
16+
- AConv:
17+
args: {out_channels: 64}
18+
- RepNCSPELAN:
19+
args:
20+
out_channels: 64
21+
part_channels: 64
22+
csp_args: {repeat_num: 3}
23+
tags: B3
24+
25+
- AConv:
26+
args: {out_channels: 96}
27+
- RepNCSPELAN:
28+
args:
29+
out_channels: 96
30+
part_channels: 96
31+
csp_args: {repeat_num: 3}
32+
tags: B4
33+
34+
- AConv:
35+
args: {out_channels: 128}
36+
- RepNCSPELAN:
37+
args:
38+
out_channels: 128
39+
part_channels: 128
40+
csp_args: {repeat_num: 3}
41+
tags: B5
42+
43+
neck:
44+
- SPPELAN:
45+
args: {out_channels: 128}
46+
tags: N3
47+
48+
- UpSample:
49+
args: {scale_factor: 2, mode: nearest}
50+
- Concat:
51+
source: [-1, B4]
52+
- RepNCSPELAN:
53+
args:
54+
out_channels: 96
55+
part_channels: 96
56+
csp_args: {repeat_num: 3}
57+
tags: N4
58+
59+
head:
60+
- UpSample:
61+
args: {scale_factor: 2, mode: nearest}
62+
- Concat:
63+
source: [-1, B3]
64+
65+
- RepNCSPELAN:
66+
args:
67+
out_channels: 64
68+
part_channels: 64
69+
csp_args: {repeat_num: 3}
70+
tags: P3
71+
- AConv:
72+
args: {out_channels: 48}
73+
- Concat:
74+
source: [-1, N4]
75+
76+
- RepNCSPELAN:
77+
args:
78+
out_channels: 96
79+
part_channels: 96
80+
csp_args: {repeat_num: 3}
81+
tags: P4
82+
- AConv:
83+
args: {out_channels: 64}
84+
- Concat:
85+
source: [-1, N3]
86+
87+
- RepNCSPELAN:
88+
args:
89+
out_channels: 128
90+
part_channels: 128
91+
csp_args: {repeat_num: 3}
92+
tags: P5
93+
94+
detection:
95+
- MultiheadDetection:
96+
source: [P3, P4, P5]
97+
tags: Main
98+
output: True
99+
100+
auxiliary:
101+
- SPPELAN:
102+
source: B5
103+
args: {out_channels: 128}
104+
tags: A5
105+
106+
- UpSample:
107+
args: {scale_factor: 2, mode: nearest}
108+
- Concat:
109+
source: [-1, B4]
110+
111+
- RepNCSPELAN:
112+
args:
113+
out_channels: 96
114+
part_channels: 96
115+
csp_args: {repeat_num: 3}
116+
tags: A4
117+
118+
- UpSample:
119+
args: {scale_factor: 2, mode: nearest}
120+
- Concat:
121+
source: [-1, B3]
122+
123+
- RepNCSPELAN:
124+
args:
125+
out_channels: 64
126+
part_channels: 64
127+
csp_args: {repeat_num: 3}
128+
tags: A3
129+
130+
- MultiheadDetection:
131+
source: [A3, A4, A5]
132+
tags: AUX
133+
output: True

‎yolo/model/yolo.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def build_model(self, model_arch: Dict[str, List[Dict[str, Dict[str, Dict]]]]):
6868
setattr(layer, "out_c", out_channels)
6969
layer_idx += 1
7070

71-
def forward(self, x, external: Optional[Dict] = None):
71+
def forward(self, x, external: Optional[Dict] = None, shortcut: Optional[str] = None):
7272
y = {0: x, **(external or {})}
7373
output = dict()
7474
for index, layer in enumerate(self.model, start=1):
@@ -85,6 +85,8 @@ def forward(self, x, external: Optional[Dict] = None):
8585
y[index] = x
8686
if layer.output:
8787
output[layer.tags] = x
88+
if layer.tags == shortcut:
89+
return output
8890
return output
8991

9092
def get_out_channels(self, layer_type: str, layer_args: dict, output_dim: list, source: Union[int, list]):

0 commit comments

Comments
 (0)