File size: 2,247 Bytes
8e0b903
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# YOLOv9

# parameters
nc: 80  # number of classes
depth_multiple: 1.0  # model depth multiple
width_multiple: 1.0  # layer channel multiple
#activation: nn.LeakyReLU(0.1)
#activation: nn.ReLU()

# anchors
anchors: 3

# gelan backbone
backbone:
  [
   # conv down
   [-1, 1, Conv, [32, 3, 2]],  # 0-P1/2

   # conv down
   [-1, 1, Conv, [64, 3, 2]],  # 1-P2/4

   # elan-1 block
   [-1, 1, ELAN1, [64, 64, 32]],  # 2

   # avg-conv down
   [-1, 1, AConv, [128]],  # 3-P3/8

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [128, 128, 64, 3]],  # 4

   # avg-conv down
   [-1, 1, AConv, [192]],  # 5-P4/16

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [192, 192, 96, 3]],  # 6

   # avg-conv down
   [-1, 1, AConv, [256]],  # 7-P5/32

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [256, 256, 128, 3]],  # 8
  ]

# elan head
head:
  [
   # elan-spp block
   [-1, 1, SPPELAN, [256, 128]],  # 9

   # up-concat merge
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 6], 1, Concat, [1]],  # cat backbone P4

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [192, 192, 96, 3]],  # 12

   # up-concat merge
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 4], 1, Concat, [1]],  # cat backbone P3

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [128, 128, 64, 3]],  # 15

   # avg-conv-down merge
   [-1, 1, AConv, [96]],
   [[-1, 12], 1, Concat, [1]],  # cat head P4

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [192, 192, 96, 3]],  # 18 (P4/16-medium)

   # avg-conv-down merge
   [-1, 1, AConv, [128]],
   [[-1, 9], 1, Concat, [1]],  # cat head P5

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [256, 256, 128, 3]],  # 21 (P5/32-large)
   
   # elan-spp block
   [8, 1, SPPELAN, [256, 128]],  # 22

   # up-concat merge
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 6], 1, Concat, [1]],  # cat backbone P4

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [192, 192, 96, 3]],  # 25

   # up-concat merge
   [-1, 1, nn.Upsample, [None, 2, 'nearest']],
   [[-1, 4], 1, Concat, [1]],  # cat backbone P3

   # elan-2 block
   [-1, 1, RepNCSPELAN4, [128, 128, 64, 3]],  # 28

   # detect
   [[28, 25, 22, 15, 18, 21], 1, DualDDetect, [nc]],  # Detect(P3, P4, P5)
  ]