owaiskha9654 commited on
Commit
6da4e7a
·
1 Parent(s): 5e9c4db

Add Models

Browse files
app.py DELETED
@@ -1,186 +0,0 @@
1
- import gradio as gr
2
- import os
3
-
4
- os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt")
5
- os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6e.pt")
6
- os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt")
7
-
8
- import argparse
9
- import time
10
- from pathlib import Path
11
-
12
- import cv2
13
- import torch
14
- import torch.backends.cudnn as cudnn
15
- from numpy import random
16
-
17
- from models.experimental import attempt_load
18
- from utils.datasets import LoadStreams, LoadImages
19
- from utils.general import check_img_size, check_requirements, check_imshow, non_max_suppression, apply_classifier, \
20
- scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path
21
- from utils.plots import plot_one_box
22
- from utils.torch_utils import select_device, load_classifier, time_synchronized, TracedModel
23
- from PIL import Image
24
-
25
-
26
-
27
-
28
- def detect(img,model):
29
- parser = argparse.ArgumentParser()
30
- parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
31
- parser.add_argument('--source', type=str, default='Inference/', help='source') # file/folder, 0 for webcam
32
- parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
33
- parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
34
- parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
35
- parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
36
- parser.add_argument('--view-img', action='store_true', help='display results')
37
- parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
38
- parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
39
- parser.add_argument('--nosave', action='store_true', help='do not save images/videos')
40
- parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
41
- parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
42
- parser.add_argument('--augment', action='store_true', help='augmented inference')
43
- parser.add_argument('--update', action='store_true', help='update all models')
44
- parser.add_argument('--project', default='runs/detect', help='save results to project/name')
45
- parser.add_argument('--name', default='exp', help='save results to project/name')
46
- parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
47
- parser.add_argument('--trace', action='store_true', help='trace model')
48
- opt = parser.parse_args()
49
- img.save("Inference/test.jpg")
50
- source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
51
- save_img = True # save inference images
52
- webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
53
- ('rtsp://', 'rtmp://', 'http://', 'https://'))
54
-
55
- # Directories
56
- save_dir = Path(increment_path(Path(opt.project) / opt.name, exist_ok=opt.exist_ok)) # increment run
57
- (save_dir / 'labels' if save_txt else save_dir).mkdir(parents=True, exist_ok=True) # make dir
58
-
59
- # Initialize
60
- set_logging()
61
- device = select_device(opt.device)
62
- half = device.type != 'cpu' # half precision only supported on CUDA
63
-
64
- # Load model
65
- model = attempt_load(weights, map_location=device) # load FP32 model
66
- stride = int(model.stride.max()) # model stride
67
- imgsz = check_img_size(imgsz, s=stride) # check img_size
68
-
69
- if trace:
70
- model = TracedModel(model, device, opt.img_size)
71
-
72
- if half:
73
- model.half() # to FP16
74
-
75
- # Second-stage classifier
76
- classify = False
77
- if classify:
78
- modelc = load_classifier(name='resnet101', n=2) # initialize
79
- modelc.load_state_dict(torch.load('weights/resnet101.pt', map_location=device)['model']).to(device).eval()
80
-
81
- # Set Dataloader
82
- vid_path, vid_writer = None, None
83
- if webcam:
84
- view_img = check_imshow()
85
- cudnn.benchmark = True # set True to speed up constant image size inference
86
- dataset = LoadStreams(source, img_size=imgsz, stride=stride)
87
- else:
88
- dataset = LoadImages(source, img_size=imgsz, stride=stride)
89
-
90
- # Get names and colors
91
- names = model.module.names if hasattr(model, 'module') else model.names
92
- colors = [[random.randint(0, 255) for _ in range(3)] for _ in names]
93
-
94
- # Run inference
95
- if device.type != 'cpu':
96
- model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters()))) # run once
97
- t0 = time.time()
98
- for path, img, im0s, vid_cap in dataset:
99
- img = torch.from_numpy(img).to(device)
100
- img = img.half() if half else img.float() # uint8 to fp16/32
101
- img /= 255.0 # 0 - 255 to 0.0 - 1.0
102
- if img.ndimension() == 3:
103
- img = img.unsqueeze(0)
104
-
105
- # Inference
106
- t1 = time_synchronized()
107
- pred = model(img, augment=opt.augment)[0]
108
-
109
- # Apply NMS
110
- pred = non_max_suppression(pred, opt.conf_thres, opt.iou_thres, classes=opt.classes, agnostic=opt.agnostic_nms)
111
- t2 = time_synchronized()
112
-
113
- # Apply Classifier
114
- if classify:
115
- pred = apply_classifier(pred, modelc, img, im0s)
116
-
117
- # Process detections
118
- for i, det in enumerate(pred): # detections per image
119
- if webcam: # batch_size >= 1
120
- p, s, im0, frame = path[i], '%g: ' % i, im0s[i].copy(), dataset.count
121
- else:
122
- p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0)
123
-
124
- p = Path(p) # to Path
125
- save_path = str(save_dir / p.name) # img.jpg
126
- txt_path = str(save_dir / 'labels' / p.stem) + ('' if dataset.mode == 'image' else f'_{frame}') # img.txt
127
- s += '%gx%g ' % img.shape[2:] # print string
128
- gn = torch.tensor(im0.shape)[[1, 0, 1, 0]] # normalization gain whwh
129
- if len(det):
130
- # Rescale boxes from img_size to im0 size
131
- det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()
132
-
133
- # Print results
134
- for c in det[:, -1].unique():
135
- n = (det[:, -1] == c).sum() # detections per class
136
- s += f"{n} {names[int(c)]}{'s' * (n > 1)}, " # add to string
137
-
138
- # Write results
139
- for *xyxy, conf, cls in reversed(det):
140
- if save_txt: # Write to file
141
- xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh
142
- line = (cls, *xywh, conf) if opt.save_conf else (cls, *xywh) # label format
143
- with open(txt_path + '.txt', 'a') as f:
144
- f.write(('%g ' * len(line)).rstrip() % line + '\n')
145
-
146
- if save_img or view_img: # Add bbox to image
147
- label = f'{names[int(cls)]} {conf:.2f}'
148
- plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3)
149
-
150
- # Print time (inference + NMS)
151
- #print(f'{s}Done. ({t2 - t1:.3f}s)')
152
-
153
- # Stream results
154
- if view_img:
155
- cv2.imshow(str(p), im0)
156
- cv2.waitKey(1) # 1 millisecond
157
-
158
- # Save results (image with detections)
159
- if save_img:
160
- if dataset.mode == 'image':
161
- cv2.imwrite(save_path, im0)
162
- else: # 'video' or 'stream'
163
- if vid_path != save_path: # new video
164
- vid_path = save_path
165
- if isinstance(vid_writer, cv2.VideoWriter):
166
- vid_writer.release() # release previous video writer
167
- if vid_cap: # video
168
- fps = vid_cap.get(cv2.CAP_PROP_FPS)
169
- w = int(vid_cap.get(cv2.CAP_PROP_FRAME_WIDTH))
170
- h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
171
- else: # stream
172
- fps, w, h = 30, im0.shape[1], im0.shape[0]
173
- save_path += '.mp4'
174
- vid_writer = cv2.VideoWriter(save_path, cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h))
175
- vid_writer.write(im0)
176
-
177
- if save_txt or save_img:
178
- s = f"\n{len(list(save_dir.glob('labels/*.txt')))} labels saved to {save_dir / 'labels'}" if save_txt else ''
179
- #print(f"Results saved to {save_dir}{s}")
180
-
181
- print(f'Done. ({time.time() - t0:.3f}s)')
182
-
183
- return Image.fromarray(im0[:,:,::-1])
184
-
185
-
186
- gr.Interface(detect,[gr.Image(type="pil"),gr.Dropdown(choices=["yolov7","yolov7-e6"])], gr.Image(type="pil"),title="Yolov7",examples=[["horses.jpeg", "yolov7"]],description="demo for <a href='https://github.com/WongKinYiu/yolov7' style='text-decoration: underline' target='_blank'>WongKinYiu/yolov7</a> Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/r50-csp.yaml DELETED
@@ -1,49 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # CSP-ResNet backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Stem, [128]], # 0-P1/2
16
- [-1, 3, ResCSPC, [128]],
17
- [-1, 1, Conv, [256, 3, 2]], # 2-P3/8
18
- [-1, 4, ResCSPC, [256]],
19
- [-1, 1, Conv, [512, 3, 2]], # 4-P3/8
20
- [-1, 6, ResCSPC, [512]],
21
- [-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
22
- [-1, 3, ResCSPC, [1024]], # 7
23
- ]
24
-
25
- # CSP-Res-PAN head
26
- head:
27
- [[-1, 1, SPPCSPC, [512]], # 8
28
- [-1, 1, Conv, [256, 1, 1]],
29
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
30
- [5, 1, Conv, [256, 1, 1]], # route backbone P4
31
- [[-1, -2], 1, Concat, [1]],
32
- [-1, 2, ResCSPB, [256]], # 13
33
- [-1, 1, Conv, [128, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [3, 1, Conv, [128, 1, 1]], # route backbone P3
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 2, ResCSPB, [128]], # 18
38
- [-1, 1, Conv, [256, 3, 1]],
39
- [-2, 1, Conv, [256, 3, 2]],
40
- [[-1, 13], 1, Concat, [1]], # cat
41
- [-1, 2, ResCSPB, [256]], # 22
42
- [-1, 1, Conv, [512, 3, 1]],
43
- [-2, 1, Conv, [512, 3, 2]],
44
- [[-1, 8], 1, Concat, [1]], # cat
45
- [-1, 2, ResCSPB, [512]], # 26
46
- [-1, 1, Conv, [1024, 3, 1]],
47
-
48
- [[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
49
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/x50-csp.yaml DELETED
@@ -1,49 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # CSP-ResNeXt backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Stem, [128]], # 0-P1/2
16
- [-1, 3, ResXCSPC, [128]],
17
- [-1, 1, Conv, [256, 3, 2]], # 2-P3/8
18
- [-1, 4, ResXCSPC, [256]],
19
- [-1, 1, Conv, [512, 3, 2]], # 4-P3/8
20
- [-1, 6, ResXCSPC, [512]],
21
- [-1, 1, Conv, [1024, 3, 2]], # 6-P3/8
22
- [-1, 3, ResXCSPC, [1024]], # 7
23
- ]
24
-
25
- # CSP-ResX-PAN head
26
- head:
27
- [[-1, 1, SPPCSPC, [512]], # 8
28
- [-1, 1, Conv, [256, 1, 1]],
29
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
30
- [5, 1, Conv, [256, 1, 1]], # route backbone P4
31
- [[-1, -2], 1, Concat, [1]],
32
- [-1, 2, ResXCSPB, [256]], # 13
33
- [-1, 1, Conv, [128, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [3, 1, Conv, [128, 1, 1]], # route backbone P3
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 2, ResXCSPB, [128]], # 18
38
- [-1, 1, Conv, [256, 3, 1]],
39
- [-2, 1, Conv, [256, 3, 2]],
40
- [[-1, 13], 1, Concat, [1]], # cat
41
- [-1, 2, ResXCSPB, [256]], # 22
42
- [-1, 1, Conv, [512, 3, 1]],
43
- [-2, 1, Conv, [512, 3, 2]],
44
- [[-1, 8], 1, Concat, [1]], # cat
45
- [-1, 2, ResXCSPB, [512]], # 26
46
- [-1, 1, Conv, [1024, 3, 1]],
47
-
48
- [[19,23,27], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
49
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-csp-x.yaml DELETED
@@ -1,52 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.33 # model depth multiple
4
- width_multiple: 1.25 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # CSP-Darknet backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
17
- [-1, 1, Bottleneck, [64]],
18
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
19
- [-1, 2, BottleneckCSPC, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 5-P3/8
21
- [-1, 8, BottleneckCSPC, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 7-P4/16
23
- [-1, 8, BottleneckCSPC, [512]],
24
- [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
25
- [-1, 4, BottleneckCSPC, [1024]], # 10
26
- ]
27
-
28
- # CSP-Dark-PAN head
29
- head:
30
- [[-1, 1, SPPCSPC, [512]], # 11
31
- [-1, 1, Conv, [256, 1, 1]],
32
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
33
- [8, 1, Conv, [256, 1, 1]], # route backbone P4
34
- [[-1, -2], 1, Concat, [1]],
35
- [-1, 2, BottleneckCSPB, [256]], # 16
36
- [-1, 1, Conv, [128, 1, 1]],
37
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
38
- [6, 1, Conv, [128, 1, 1]], # route backbone P3
39
- [[-1, -2], 1, Concat, [1]],
40
- [-1, 2, BottleneckCSPB, [128]], # 21
41
- [-1, 1, Conv, [256, 3, 1]],
42
- [-2, 1, Conv, [256, 3, 2]],
43
- [[-1, 16], 1, Concat, [1]], # cat
44
- [-1, 2, BottleneckCSPB, [256]], # 25
45
- [-1, 1, Conv, [512, 3, 1]],
46
- [-2, 1, Conv, [512, 3, 2]],
47
- [[-1, 11], 1, Concat, [1]], # cat
48
- [-1, 2, BottleneckCSPB, [512]], # 29
49
- [-1, 1, Conv, [1024, 3, 1]],
50
-
51
- [[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
52
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-csp.yaml DELETED
@@ -1,52 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # CSP-Darknet backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
17
- [-1, 1, Bottleneck, [64]],
18
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
19
- [-1, 2, BottleneckCSPC, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 5-P3/8
21
- [-1, 8, BottleneckCSPC, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 7-P4/16
23
- [-1, 8, BottleneckCSPC, [512]],
24
- [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
25
- [-1, 4, BottleneckCSPC, [1024]], # 10
26
- ]
27
-
28
- # CSP-Dark-PAN head
29
- head:
30
- [[-1, 1, SPPCSPC, [512]], # 11
31
- [-1, 1, Conv, [256, 1, 1]],
32
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
33
- [8, 1, Conv, [256, 1, 1]], # route backbone P4
34
- [[-1, -2], 1, Concat, [1]],
35
- [-1, 2, BottleneckCSPB, [256]], # 16
36
- [-1, 1, Conv, [128, 1, 1]],
37
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
38
- [6, 1, Conv, [128, 1, 1]], # route backbone P3
39
- [[-1, -2], 1, Concat, [1]],
40
- [-1, 2, BottleneckCSPB, [128]], # 21
41
- [-1, 1, Conv, [256, 3, 1]],
42
- [-2, 1, Conv, [256, 3, 2]],
43
- [[-1, 16], 1, Concat, [1]], # cat
44
- [-1, 2, BottleneckCSPB, [256]], # 25
45
- [-1, 1, Conv, [512, 3, 1]],
46
- [-2, 1, Conv, [512, 3, 2]],
47
- [[-1, 11], 1, Concat, [1]], # cat
48
- [-1, 2, BottleneckCSPB, [512]], # 29
49
- [-1, 1, Conv, [1024, 3, 1]],
50
-
51
- [[22,26,30], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
52
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-d6.yaml DELETED
@@ -1,63 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # expand model depth
4
- width_multiple: 1.25 # expand layer channels
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # CSP-Darknet backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
- [-1, 1, DownC, [128]], # 2-P2/4
19
- [-1, 3, BottleneckCSPA, [128]],
20
- [-1, 1, DownC, [256]], # 4-P3/8
21
- [-1, 15, BottleneckCSPA, [256]],
22
- [-1, 1, DownC, [512]], # 6-P4/16
23
- [-1, 15, BottleneckCSPA, [512]],
24
- [-1, 1, DownC, [768]], # 8-P5/32
25
- [-1, 7, BottleneckCSPA, [768]],
26
- [-1, 1, DownC, [1024]], # 10-P6/64
27
- [-1, 7, BottleneckCSPA, [1024]], # 11
28
- ]
29
-
30
- # CSP-Dark-PAN head
31
- head:
32
- [[-1, 1, SPPCSPC, [512]], # 12
33
- [-1, 1, Conv, [384, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [-6, 1, Conv, [384, 1, 1]], # route backbone P5
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 3, BottleneckCSPB, [384]], # 17
38
- [-1, 1, Conv, [256, 1, 1]],
39
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
40
- [-13, 1, Conv, [256, 1, 1]], # route backbone P4
41
- [[-1, -2], 1, Concat, [1]],
42
- [-1, 3, BottleneckCSPB, [256]], # 22
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
45
- [-20, 1, Conv, [128, 1, 1]], # route backbone P3
46
- [[-1, -2], 1, Concat, [1]],
47
- [-1, 3, BottleneckCSPB, [128]], # 27
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-2, 1, DownC, [256]],
50
- [[-1, 22], 1, Concat, [1]], # cat
51
- [-1, 3, BottleneckCSPB, [256]], # 31
52
- [-1, 1, Conv, [512, 3, 1]],
53
- [-2, 1, DownC, [384]],
54
- [[-1, 17], 1, Concat, [1]], # cat
55
- [-1, 3, BottleneckCSPB, [384]], # 35
56
- [-1, 1, Conv, [768, 3, 1]],
57
- [-2, 1, DownC, [512]],
58
- [[-1, 12], 1, Concat, [1]], # cat
59
- [-1, 3, BottleneckCSPB, [512]], # 39
60
- [-1, 1, Conv, [1024, 3, 1]],
61
-
62
- [[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
63
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-e6.yaml DELETED
@@ -1,63 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # expand model depth
4
- width_multiple: 1.25 # expand layer channels
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # CSP-Darknet backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
- [-1, 1, DownC, [128]], # 2-P2/4
19
- [-1, 3, BottleneckCSPA, [128]],
20
- [-1, 1, DownC, [256]], # 4-P3/8
21
- [-1, 7, BottleneckCSPA, [256]],
22
- [-1, 1, DownC, [512]], # 6-P4/16
23
- [-1, 7, BottleneckCSPA, [512]],
24
- [-1, 1, DownC, [768]], # 8-P5/32
25
- [-1, 3, BottleneckCSPA, [768]],
26
- [-1, 1, DownC, [1024]], # 10-P6/64
27
- [-1, 3, BottleneckCSPA, [1024]], # 11
28
- ]
29
-
30
- # CSP-Dark-PAN head
31
- head:
32
- [[-1, 1, SPPCSPC, [512]], # 12
33
- [-1, 1, Conv, [384, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [-6, 1, Conv, [384, 1, 1]], # route backbone P5
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 3, BottleneckCSPB, [384]], # 17
38
- [-1, 1, Conv, [256, 1, 1]],
39
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
40
- [-13, 1, Conv, [256, 1, 1]], # route backbone P4
41
- [[-1, -2], 1, Concat, [1]],
42
- [-1, 3, BottleneckCSPB, [256]], # 22
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
45
- [-20, 1, Conv, [128, 1, 1]], # route backbone P3
46
- [[-1, -2], 1, Concat, [1]],
47
- [-1, 3, BottleneckCSPB, [128]], # 27
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-2, 1, DownC, [256]],
50
- [[-1, 22], 1, Concat, [1]], # cat
51
- [-1, 3, BottleneckCSPB, [256]], # 31
52
- [-1, 1, Conv, [512, 3, 1]],
53
- [-2, 1, DownC, [384]],
54
- [[-1, 17], 1, Concat, [1]], # cat
55
- [-1, 3, BottleneckCSPB, [384]], # 35
56
- [-1, 1, Conv, [768, 3, 1]],
57
- [-2, 1, DownC, [512]],
58
- [[-1, 12], 1, Concat, [1]], # cat
59
- [-1, 3, BottleneckCSPB, [512]], # 39
60
- [-1, 1, Conv, [1024, 3, 1]],
61
-
62
- [[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
63
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-p6.yaml DELETED
@@ -1,63 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # expand model depth
4
- width_multiple: 1.0 # expand layer channels
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # CSP-Darknet backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
- [-1, 1, Conv, [128, 3, 2]], # 2-P2/4
19
- [-1, 3, BottleneckCSPA, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 4-P3/8
21
- [-1, 7, BottleneckCSPA, [256]],
22
- [-1, 1, Conv, [384, 3, 2]], # 6-P4/16
23
- [-1, 7, BottleneckCSPA, [384]],
24
- [-1, 1, Conv, [512, 3, 2]], # 8-P5/32
25
- [-1, 3, BottleneckCSPA, [512]],
26
- [-1, 1, Conv, [640, 3, 2]], # 10-P6/64
27
- [-1, 3, BottleneckCSPA, [640]], # 11
28
- ]
29
-
30
- # CSP-Dark-PAN head
31
- head:
32
- [[-1, 1, SPPCSPC, [320]], # 12
33
- [-1, 1, Conv, [256, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [-6, 1, Conv, [256, 1, 1]], # route backbone P5
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 3, BottleneckCSPB, [256]], # 17
38
- [-1, 1, Conv, [192, 1, 1]],
39
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
40
- [-13, 1, Conv, [192, 1, 1]], # route backbone P4
41
- [[-1, -2], 1, Concat, [1]],
42
- [-1, 3, BottleneckCSPB, [192]], # 22
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
45
- [-20, 1, Conv, [128, 1, 1]], # route backbone P3
46
- [[-1, -2], 1, Concat, [1]],
47
- [-1, 3, BottleneckCSPB, [128]], # 27
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-2, 1, Conv, [192, 3, 2]],
50
- [[-1, 22], 1, Concat, [1]], # cat
51
- [-1, 3, BottleneckCSPB, [192]], # 31
52
- [-1, 1, Conv, [384, 3, 1]],
53
- [-2, 1, Conv, [256, 3, 2]],
54
- [[-1, 17], 1, Concat, [1]], # cat
55
- [-1, 3, BottleneckCSPB, [256]], # 35
56
- [-1, 1, Conv, [512, 3, 1]],
57
- [-2, 1, Conv, [320, 3, 2]],
58
- [[-1, 12], 1, Concat, [1]], # cat
59
- [-1, 3, BottleneckCSPB, [320]], # 39
60
- [-1, 1, Conv, [640, 3, 1]],
61
-
62
- [[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
63
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolor-w6.yaml DELETED
@@ -1,63 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # expand model depth
4
- width_multiple: 1.0 # expand layer channels
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # CSP-Darknet backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
- [-1, 1, Conv, [128, 3, 2]], # 2-P2/4
19
- [-1, 3, BottleneckCSPA, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 4-P3/8
21
- [-1, 7, BottleneckCSPA, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 6-P4/16
23
- [-1, 7, BottleneckCSPA, [512]],
24
- [-1, 1, Conv, [768, 3, 2]], # 8-P5/32
25
- [-1, 3, BottleneckCSPA, [768]],
26
- [-1, 1, Conv, [1024, 3, 2]], # 10-P6/64
27
- [-1, 3, BottleneckCSPA, [1024]], # 11
28
- ]
29
-
30
- # CSP-Dark-PAN head
31
- head:
32
- [[-1, 1, SPPCSPC, [512]], # 12
33
- [-1, 1, Conv, [384, 1, 1]],
34
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
35
- [-6, 1, Conv, [384, 1, 1]], # route backbone P5
36
- [[-1, -2], 1, Concat, [1]],
37
- [-1, 3, BottleneckCSPB, [384]], # 17
38
- [-1, 1, Conv, [256, 1, 1]],
39
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
40
- [-13, 1, Conv, [256, 1, 1]], # route backbone P4
41
- [[-1, -2], 1, Concat, [1]],
42
- [-1, 3, BottleneckCSPB, [256]], # 22
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
45
- [-20, 1, Conv, [128, 1, 1]], # route backbone P3
46
- [[-1, -2], 1, Concat, [1]],
47
- [-1, 3, BottleneckCSPB, [128]], # 27
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-2, 1, Conv, [256, 3, 2]],
50
- [[-1, 22], 1, Concat, [1]], # cat
51
- [-1, 3, BottleneckCSPB, [256]], # 31
52
- [-1, 1, Conv, [512, 3, 1]],
53
- [-2, 1, Conv, [384, 3, 2]],
54
- [[-1, 17], 1, Concat, [1]], # cat
55
- [-1, 3, BottleneckCSPB, [384]], # 35
56
- [-1, 1, Conv, [768, 3, 1]],
57
- [-2, 1, Conv, [512, 3, 2]],
58
- [[-1, 12], 1, Concat, [1]], # cat
59
- [-1, 3, BottleneckCSPB, [512]], # 39
60
- [-1, 1, Conv, [1024, 3, 1]],
61
-
62
- [[28,32,36,40], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
63
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolov3-spp.yaml DELETED
@@ -1,51 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [10,13, 16,30, 33,23] # P3/8
9
- - [30,61, 62,45, 59,119] # P4/16
10
- - [116,90, 156,198, 373,326] # P5/32
11
-
12
- # darknet53 backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
17
- [-1, 1, Bottleneck, [64]],
18
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
19
- [-1, 2, Bottleneck, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 5-P3/8
21
- [-1, 8, Bottleneck, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 7-P4/16
23
- [-1, 8, Bottleneck, [512]],
24
- [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
25
- [-1, 4, Bottleneck, [1024]], # 10
26
- ]
27
-
28
- # YOLOv3-SPP head
29
- head:
30
- [[-1, 1, Bottleneck, [1024, False]],
31
- [-1, 1, SPP, [512, [5, 9, 13]]],
32
- [-1, 1, Conv, [1024, 3, 1]],
33
- [-1, 1, Conv, [512, 1, 1]],
34
- [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large)
35
-
36
- [-2, 1, Conv, [256, 1, 1]],
37
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
38
- [[-1, 8], 1, Concat, [1]], # cat backbone P4
39
- [-1, 1, Bottleneck, [512, False]],
40
- [-1, 1, Bottleneck, [512, False]],
41
- [-1, 1, Conv, [256, 1, 1]],
42
- [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium)
43
-
44
- [-2, 1, Conv, [128, 1, 1]],
45
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
46
- [[-1, 6], 1, Concat, [1]], # cat backbone P3
47
- [-1, 1, Bottleneck, [256, False]],
48
- [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small)
49
-
50
- [[27, 22, 15], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
51
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolov3.yaml DELETED
@@ -1,51 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [10,13, 16,30, 33,23] # P3/8
9
- - [30,61, 62,45, 59,119] # P4/16
10
- - [116,90, 156,198, 373,326] # P5/32
11
-
12
- # darknet53 backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
17
- [-1, 1, Bottleneck, [64]],
18
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
19
- [-1, 2, Bottleneck, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 5-P3/8
21
- [-1, 8, Bottleneck, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 7-P4/16
23
- [-1, 8, Bottleneck, [512]],
24
- [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
25
- [-1, 4, Bottleneck, [1024]], # 10
26
- ]
27
-
28
- # YOLOv3 head
29
- head:
30
- [[-1, 1, Bottleneck, [1024, False]],
31
- [-1, 1, Conv, [512, [1, 1]]],
32
- [-1, 1, Conv, [1024, 3, 1]],
33
- [-1, 1, Conv, [512, 1, 1]],
34
- [-1, 1, Conv, [1024, 3, 1]], # 15 (P5/32-large)
35
-
36
- [-2, 1, Conv, [256, 1, 1]],
37
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
38
- [[-1, 8], 1, Concat, [1]], # cat backbone P4
39
- [-1, 1, Bottleneck, [512, False]],
40
- [-1, 1, Bottleneck, [512, False]],
41
- [-1, 1, Conv, [256, 1, 1]],
42
- [-1, 1, Conv, [512, 3, 1]], # 22 (P4/16-medium)
43
-
44
- [-2, 1, Conv, [128, 1, 1]],
45
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
46
- [[-1, 6], 1, Concat, [1]], # cat backbone P3
47
- [-1, 1, Bottleneck, [256, False]],
48
- [-1, 2, Bottleneck, [256, False]], # 27 (P3/8-small)
49
-
50
- [[27, 22, 15], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
51
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/baseline/yolov4-csp.yaml DELETED
@@ -1,52 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # CSP-Darknet backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
17
- [-1, 1, Bottleneck, [64]],
18
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
19
- [-1, 2, BottleneckCSPC, [128]],
20
- [-1, 1, Conv, [256, 3, 2]], # 5-P3/8
21
- [-1, 8, BottleneckCSPC, [256]],
22
- [-1, 1, Conv, [512, 3, 2]], # 7-P4/16
23
- [-1, 8, BottleneckCSPC, [512]],
24
- [-1, 1, Conv, [1024, 3, 2]], # 9-P5/32
25
- [-1, 4, BottleneckCSPC, [1024]], # 10
26
- ]
27
-
28
- # CSP-Dark-PAN head
29
- head:
30
- [[-1, 1, SPPCSPC, [512]], # 11
31
- [-1, 1, Conv, [256, 1, 1]],
32
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
33
- [8, 1, Conv, [256, 1, 1]], # route backbone P4
34
- [[-1, -2], 1, Concat, [1]],
35
- [-1, 2, BottleneckCSPB, [256]], # 16
36
- [-1, 1, Conv, [128, 1, 1]],
37
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
38
- [6, 1, Conv, [128, 1, 1]], # route backbone P3
39
- [[-1, -2], 1, Concat, [1]],
40
- [-1, 2, BottleneckCSPB, [128]], # 21
41
- [-1, 1, Conv, [256, 3, 1]],
42
- [-2, 1, Conv, [256, 3, 2]],
43
- [[-1, 16], 1, Concat, [1]], # cat
44
- [-1, 2, BottleneckCSPB, [256]], # 25
45
- [-1, 1, Conv, [512, 3, 1]],
46
- [-2, 1, Conv, [512, 3, 2]],
47
- [[-1, 11], 1, Concat, [1]], # cat
48
- [-1, 2, BottleneckCSPB, [512]], # 29
49
- [-1, 1, Conv, [1024, 3, 1]],
50
-
51
- [[22,26,30], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
52
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-d6.yaml DELETED
@@ -1,202 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7-d6 backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [96, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [192]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [-1, 1, Conv, [64, 3, 1]],
29
- [-1, 1, Conv, [64, 3, 1]],
30
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
31
- [-1, 1, Conv, [192, 1, 1]], # 14
32
-
33
- [-1, 1, DownC, [384]], # 15-P3/8
34
- [-1, 1, Conv, [128, 1, 1]],
35
- [-2, 1, Conv, [128, 1, 1]],
36
- [-1, 1, Conv, [128, 3, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [-1, 1, Conv, [128, 3, 1]],
42
- [-1, 1, Conv, [128, 3, 1]],
43
- [-1, 1, Conv, [128, 3, 1]],
44
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
45
- [-1, 1, Conv, [384, 1, 1]], # 27
46
-
47
- [-1, 1, DownC, [768]], # 28-P4/16
48
- [-1, 1, Conv, [256, 1, 1]],
49
- [-2, 1, Conv, [256, 1, 1]],
50
- [-1, 1, Conv, [256, 3, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [-1, 1, Conv, [256, 3, 1]],
53
- [-1, 1, Conv, [256, 3, 1]],
54
- [-1, 1, Conv, [256, 3, 1]],
55
- [-1, 1, Conv, [256, 3, 1]],
56
- [-1, 1, Conv, [256, 3, 1]],
57
- [-1, 1, Conv, [256, 3, 1]],
58
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
59
- [-1, 1, Conv, [768, 1, 1]], # 40
60
-
61
- [-1, 1, DownC, [1152]], # 41-P5/32
62
- [-1, 1, Conv, [384, 1, 1]],
63
- [-2, 1, Conv, [384, 1, 1]],
64
- [-1, 1, Conv, [384, 3, 1]],
65
- [-1, 1, Conv, [384, 3, 1]],
66
- [-1, 1, Conv, [384, 3, 1]],
67
- [-1, 1, Conv, [384, 3, 1]],
68
- [-1, 1, Conv, [384, 3, 1]],
69
- [-1, 1, Conv, [384, 3, 1]],
70
- [-1, 1, Conv, [384, 3, 1]],
71
- [-1, 1, Conv, [384, 3, 1]],
72
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
73
- [-1, 1, Conv, [1152, 1, 1]], # 53
74
-
75
- [-1, 1, DownC, [1536]], # 54-P6/64
76
- [-1, 1, Conv, [512, 1, 1]],
77
- [-2, 1, Conv, [512, 1, 1]],
78
- [-1, 1, Conv, [512, 3, 1]],
79
- [-1, 1, Conv, [512, 3, 1]],
80
- [-1, 1, Conv, [512, 3, 1]],
81
- [-1, 1, Conv, [512, 3, 1]],
82
- [-1, 1, Conv, [512, 3, 1]],
83
- [-1, 1, Conv, [512, 3, 1]],
84
- [-1, 1, Conv, [512, 3, 1]],
85
- [-1, 1, Conv, [512, 3, 1]],
86
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
87
- [-1, 1, Conv, [1536, 1, 1]], # 66
88
- ]
89
-
90
- # yolov7-d6 head
91
- head:
92
- [[-1, 1, SPPCSPC, [768]], # 67
93
-
94
- [-1, 1, Conv, [576, 1, 1]],
95
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
96
- [53, 1, Conv, [576, 1, 1]], # route backbone P5
97
- [[-1, -2], 1, Concat, [1]],
98
-
99
- [-1, 1, Conv, [384, 1, 1]],
100
- [-2, 1, Conv, [384, 1, 1]],
101
- [-1, 1, Conv, [192, 3, 1]],
102
- [-1, 1, Conv, [192, 3, 1]],
103
- [-1, 1, Conv, [192, 3, 1]],
104
- [-1, 1, Conv, [192, 3, 1]],
105
- [-1, 1, Conv, [192, 3, 1]],
106
- [-1, 1, Conv, [192, 3, 1]],
107
- [-1, 1, Conv, [192, 3, 1]],
108
- [-1, 1, Conv, [192, 3, 1]],
109
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
110
- [-1, 1, Conv, [576, 1, 1]], # 83
111
-
112
- [-1, 1, Conv, [384, 1, 1]],
113
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
114
- [40, 1, Conv, [384, 1, 1]], # route backbone P4
115
- [[-1, -2], 1, Concat, [1]],
116
-
117
- [-1, 1, Conv, [256, 1, 1]],
118
- [-2, 1, Conv, [256, 1, 1]],
119
- [-1, 1, Conv, [128, 3, 1]],
120
- [-1, 1, Conv, [128, 3, 1]],
121
- [-1, 1, Conv, [128, 3, 1]],
122
- [-1, 1, Conv, [128, 3, 1]],
123
- [-1, 1, Conv, [128, 3, 1]],
124
- [-1, 1, Conv, [128, 3, 1]],
125
- [-1, 1, Conv, [128, 3, 1]],
126
- [-1, 1, Conv, [128, 3, 1]],
127
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
128
- [-1, 1, Conv, [384, 1, 1]], # 99
129
-
130
- [-1, 1, Conv, [192, 1, 1]],
131
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
132
- [27, 1, Conv, [192, 1, 1]], # route backbone P3
133
- [[-1, -2], 1, Concat, [1]],
134
-
135
- [-1, 1, Conv, [128, 1, 1]],
136
- [-2, 1, Conv, [128, 1, 1]],
137
- [-1, 1, Conv, [64, 3, 1]],
138
- [-1, 1, Conv, [64, 3, 1]],
139
- [-1, 1, Conv, [64, 3, 1]],
140
- [-1, 1, Conv, [64, 3, 1]],
141
- [-1, 1, Conv, [64, 3, 1]],
142
- [-1, 1, Conv, [64, 3, 1]],
143
- [-1, 1, Conv, [64, 3, 1]],
144
- [-1, 1, Conv, [64, 3, 1]],
145
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
146
- [-1, 1, Conv, [192, 1, 1]], # 115
147
-
148
- [-1, 1, DownC, [384]],
149
- [[-1, 99], 1, Concat, [1]],
150
-
151
- [-1, 1, Conv, [256, 1, 1]],
152
- [-2, 1, Conv, [256, 1, 1]],
153
- [-1, 1, Conv, [128, 3, 1]],
154
- [-1, 1, Conv, [128, 3, 1]],
155
- [-1, 1, Conv, [128, 3, 1]],
156
- [-1, 1, Conv, [128, 3, 1]],
157
- [-1, 1, Conv, [128, 3, 1]],
158
- [-1, 1, Conv, [128, 3, 1]],
159
- [-1, 1, Conv, [128, 3, 1]],
160
- [-1, 1, Conv, [128, 3, 1]],
161
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
162
- [-1, 1, Conv, [384, 1, 1]], # 129
163
-
164
- [-1, 1, DownC, [576]],
165
- [[-1, 83], 1, Concat, [1]],
166
-
167
- [-1, 1, Conv, [384, 1, 1]],
168
- [-2, 1, Conv, [384, 1, 1]],
169
- [-1, 1, Conv, [192, 3, 1]],
170
- [-1, 1, Conv, [192, 3, 1]],
171
- [-1, 1, Conv, [192, 3, 1]],
172
- [-1, 1, Conv, [192, 3, 1]],
173
- [-1, 1, Conv, [192, 3, 1]],
174
- [-1, 1, Conv, [192, 3, 1]],
175
- [-1, 1, Conv, [192, 3, 1]],
176
- [-1, 1, Conv, [192, 3, 1]],
177
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
178
- [-1, 1, Conv, [576, 1, 1]], # 143
179
-
180
- [-1, 1, DownC, [768]],
181
- [[-1, 67], 1, Concat, [1]],
182
-
183
- [-1, 1, Conv, [512, 1, 1]],
184
- [-2, 1, Conv, [512, 1, 1]],
185
- [-1, 1, Conv, [256, 3, 1]],
186
- [-1, 1, Conv, [256, 3, 1]],
187
- [-1, 1, Conv, [256, 3, 1]],
188
- [-1, 1, Conv, [256, 3, 1]],
189
- [-1, 1, Conv, [256, 3, 1]],
190
- [-1, 1, Conv, [256, 3, 1]],
191
- [-1, 1, Conv, [256, 3, 1]],
192
- [-1, 1, Conv, [256, 3, 1]],
193
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
194
- [-1, 1, Conv, [768, 1, 1]], # 157
195
-
196
- [115, 1, Conv, [384, 3, 1]],
197
- [129, 1, Conv, [768, 3, 1]],
198
- [143, 1, Conv, [1152, 3, 1]],
199
- [157, 1, Conv, [1536, 3, 1]],
200
-
201
- [[158,159,160,161], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
202
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-e6.yaml DELETED
@@ -1,180 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7-e6 backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [80, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [160]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
29
- [-1, 1, Conv, [160, 1, 1]], # 12
30
-
31
- [-1, 1, DownC, [320]], # 13-P3/8
32
- [-1, 1, Conv, [128, 1, 1]],
33
- [-2, 1, Conv, [128, 1, 1]],
34
- [-1, 1, Conv, [128, 3, 1]],
35
- [-1, 1, Conv, [128, 3, 1]],
36
- [-1, 1, Conv, [128, 3, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
41
- [-1, 1, Conv, [320, 1, 1]], # 23
42
-
43
- [-1, 1, DownC, [640]], # 24-P4/16
44
- [-1, 1, Conv, [256, 1, 1]],
45
- [-2, 1, Conv, [256, 1, 1]],
46
- [-1, 1, Conv, [256, 3, 1]],
47
- [-1, 1, Conv, [256, 3, 1]],
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-1, 1, Conv, [256, 3, 1]],
50
- [-1, 1, Conv, [256, 3, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
53
- [-1, 1, Conv, [640, 1, 1]], # 34
54
-
55
- [-1, 1, DownC, [960]], # 35-P5/32
56
- [-1, 1, Conv, [384, 1, 1]],
57
- [-2, 1, Conv, [384, 1, 1]],
58
- [-1, 1, Conv, [384, 3, 1]],
59
- [-1, 1, Conv, [384, 3, 1]],
60
- [-1, 1, Conv, [384, 3, 1]],
61
- [-1, 1, Conv, [384, 3, 1]],
62
- [-1, 1, Conv, [384, 3, 1]],
63
- [-1, 1, Conv, [384, 3, 1]],
64
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
65
- [-1, 1, Conv, [960, 1, 1]], # 45
66
-
67
- [-1, 1, DownC, [1280]], # 46-P6/64
68
- [-1, 1, Conv, [512, 1, 1]],
69
- [-2, 1, Conv, [512, 1, 1]],
70
- [-1, 1, Conv, [512, 3, 1]],
71
- [-1, 1, Conv, [512, 3, 1]],
72
- [-1, 1, Conv, [512, 3, 1]],
73
- [-1, 1, Conv, [512, 3, 1]],
74
- [-1, 1, Conv, [512, 3, 1]],
75
- [-1, 1, Conv, [512, 3, 1]],
76
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
77
- [-1, 1, Conv, [1280, 1, 1]], # 56
78
- ]
79
-
80
- # yolov7-e6 head
81
- head:
82
- [[-1, 1, SPPCSPC, [640]], # 57
83
-
84
- [-1, 1, Conv, [480, 1, 1]],
85
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
86
- [45, 1, Conv, [480, 1, 1]], # route backbone P5
87
- [[-1, -2], 1, Concat, [1]],
88
-
89
- [-1, 1, Conv, [384, 1, 1]],
90
- [-2, 1, Conv, [384, 1, 1]],
91
- [-1, 1, Conv, [192, 3, 1]],
92
- [-1, 1, Conv, [192, 3, 1]],
93
- [-1, 1, Conv, [192, 3, 1]],
94
- [-1, 1, Conv, [192, 3, 1]],
95
- [-1, 1, Conv, [192, 3, 1]],
96
- [-1, 1, Conv, [192, 3, 1]],
97
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
98
- [-1, 1, Conv, [480, 1, 1]], # 71
99
-
100
- [-1, 1, Conv, [320, 1, 1]],
101
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
102
- [34, 1, Conv, [320, 1, 1]], # route backbone P4
103
- [[-1, -2], 1, Concat, [1]],
104
-
105
- [-1, 1, Conv, [256, 1, 1]],
106
- [-2, 1, Conv, [256, 1, 1]],
107
- [-1, 1, Conv, [128, 3, 1]],
108
- [-1, 1, Conv, [128, 3, 1]],
109
- [-1, 1, Conv, [128, 3, 1]],
110
- [-1, 1, Conv, [128, 3, 1]],
111
- [-1, 1, Conv, [128, 3, 1]],
112
- [-1, 1, Conv, [128, 3, 1]],
113
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
114
- [-1, 1, Conv, [320, 1, 1]], # 85
115
-
116
- [-1, 1, Conv, [160, 1, 1]],
117
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
118
- [23, 1, Conv, [160, 1, 1]], # route backbone P3
119
- [[-1, -2], 1, Concat, [1]],
120
-
121
- [-1, 1, Conv, [128, 1, 1]],
122
- [-2, 1, Conv, [128, 1, 1]],
123
- [-1, 1, Conv, [64, 3, 1]],
124
- [-1, 1, Conv, [64, 3, 1]],
125
- [-1, 1, Conv, [64, 3, 1]],
126
- [-1, 1, Conv, [64, 3, 1]],
127
- [-1, 1, Conv, [64, 3, 1]],
128
- [-1, 1, Conv, [64, 3, 1]],
129
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
130
- [-1, 1, Conv, [160, 1, 1]], # 99
131
-
132
- [-1, 1, DownC, [320]],
133
- [[-1, 85], 1, Concat, [1]],
134
-
135
- [-1, 1, Conv, [256, 1, 1]],
136
- [-2, 1, Conv, [256, 1, 1]],
137
- [-1, 1, Conv, [128, 3, 1]],
138
- [-1, 1, Conv, [128, 3, 1]],
139
- [-1, 1, Conv, [128, 3, 1]],
140
- [-1, 1, Conv, [128, 3, 1]],
141
- [-1, 1, Conv, [128, 3, 1]],
142
- [-1, 1, Conv, [128, 3, 1]],
143
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
144
- [-1, 1, Conv, [320, 1, 1]], # 111
145
-
146
- [-1, 1, DownC, [480]],
147
- [[-1, 71], 1, Concat, [1]],
148
-
149
- [-1, 1, Conv, [384, 1, 1]],
150
- [-2, 1, Conv, [384, 1, 1]],
151
- [-1, 1, Conv, [192, 3, 1]],
152
- [-1, 1, Conv, [192, 3, 1]],
153
- [-1, 1, Conv, [192, 3, 1]],
154
- [-1, 1, Conv, [192, 3, 1]],
155
- [-1, 1, Conv, [192, 3, 1]],
156
- [-1, 1, Conv, [192, 3, 1]],
157
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
158
- [-1, 1, Conv, [480, 1, 1]], # 123
159
-
160
- [-1, 1, DownC, [640]],
161
- [[-1, 57], 1, Concat, [1]],
162
-
163
- [-1, 1, Conv, [512, 1, 1]],
164
- [-2, 1, Conv, [512, 1, 1]],
165
- [-1, 1, Conv, [256, 3, 1]],
166
- [-1, 1, Conv, [256, 3, 1]],
167
- [-1, 1, Conv, [256, 3, 1]],
168
- [-1, 1, Conv, [256, 3, 1]],
169
- [-1, 1, Conv, [256, 3, 1]],
170
- [-1, 1, Conv, [256, 3, 1]],
171
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
172
- [-1, 1, Conv, [640, 1, 1]], # 135
173
-
174
- [99, 1, Conv, [320, 3, 1]],
175
- [111, 1, Conv, [640, 3, 1]],
176
- [123, 1, Conv, [960, 3, 1]],
177
- [135, 1, Conv, [1280, 3, 1]],
178
-
179
- [[136,137,138,139], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
180
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-e6e.yaml DELETED
@@ -1,301 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7-e6e backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [80, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [160]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
29
- [-1, 1, Conv, [160, 1, 1]], # 12
30
- [-11, 1, Conv, [64, 1, 1]],
31
- [-12, 1, Conv, [64, 1, 1]],
32
- [-1, 1, Conv, [64, 3, 1]],
33
- [-1, 1, Conv, [64, 3, 1]],
34
- [-1, 1, Conv, [64, 3, 1]],
35
- [-1, 1, Conv, [64, 3, 1]],
36
- [-1, 1, Conv, [64, 3, 1]],
37
- [-1, 1, Conv, [64, 3, 1]],
38
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
39
- [-1, 1, Conv, [160, 1, 1]], # 22
40
- [[-1, -11], 1, Shortcut, [1]], # 23
41
-
42
- [-1, 1, DownC, [320]], # 24-P3/8
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-2, 1, Conv, [128, 1, 1]],
45
- [-1, 1, Conv, [128, 3, 1]],
46
- [-1, 1, Conv, [128, 3, 1]],
47
- [-1, 1, Conv, [128, 3, 1]],
48
- [-1, 1, Conv, [128, 3, 1]],
49
- [-1, 1, Conv, [128, 3, 1]],
50
- [-1, 1, Conv, [128, 3, 1]],
51
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
52
- [-1, 1, Conv, [320, 1, 1]], # 34
53
- [-11, 1, Conv, [128, 1, 1]],
54
- [-12, 1, Conv, [128, 1, 1]],
55
- [-1, 1, Conv, [128, 3, 1]],
56
- [-1, 1, Conv, [128, 3, 1]],
57
- [-1, 1, Conv, [128, 3, 1]],
58
- [-1, 1, Conv, [128, 3, 1]],
59
- [-1, 1, Conv, [128, 3, 1]],
60
- [-1, 1, Conv, [128, 3, 1]],
61
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
62
- [-1, 1, Conv, [320, 1, 1]], # 44
63
- [[-1, -11], 1, Shortcut, [1]], # 45
64
-
65
- [-1, 1, DownC, [640]], # 46-P4/16
66
- [-1, 1, Conv, [256, 1, 1]],
67
- [-2, 1, Conv, [256, 1, 1]],
68
- [-1, 1, Conv, [256, 3, 1]],
69
- [-1, 1, Conv, [256, 3, 1]],
70
- [-1, 1, Conv, [256, 3, 1]],
71
- [-1, 1, Conv, [256, 3, 1]],
72
- [-1, 1, Conv, [256, 3, 1]],
73
- [-1, 1, Conv, [256, 3, 1]],
74
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
75
- [-1, 1, Conv, [640, 1, 1]], # 56
76
- [-11, 1, Conv, [256, 1, 1]],
77
- [-12, 1, Conv, [256, 1, 1]],
78
- [-1, 1, Conv, [256, 3, 1]],
79
- [-1, 1, Conv, [256, 3, 1]],
80
- [-1, 1, Conv, [256, 3, 1]],
81
- [-1, 1, Conv, [256, 3, 1]],
82
- [-1, 1, Conv, [256, 3, 1]],
83
- [-1, 1, Conv, [256, 3, 1]],
84
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
85
- [-1, 1, Conv, [640, 1, 1]], # 66
86
- [[-1, -11], 1, Shortcut, [1]], # 67
87
-
88
- [-1, 1, DownC, [960]], # 68-P5/32
89
- [-1, 1, Conv, [384, 1, 1]],
90
- [-2, 1, Conv, [384, 1, 1]],
91
- [-1, 1, Conv, [384, 3, 1]],
92
- [-1, 1, Conv, [384, 3, 1]],
93
- [-1, 1, Conv, [384, 3, 1]],
94
- [-1, 1, Conv, [384, 3, 1]],
95
- [-1, 1, Conv, [384, 3, 1]],
96
- [-1, 1, Conv, [384, 3, 1]],
97
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
98
- [-1, 1, Conv, [960, 1, 1]], # 78
99
- [-11, 1, Conv, [384, 1, 1]],
100
- [-12, 1, Conv, [384, 1, 1]],
101
- [-1, 1, Conv, [384, 3, 1]],
102
- [-1, 1, Conv, [384, 3, 1]],
103
- [-1, 1, Conv, [384, 3, 1]],
104
- [-1, 1, Conv, [384, 3, 1]],
105
- [-1, 1, Conv, [384, 3, 1]],
106
- [-1, 1, Conv, [384, 3, 1]],
107
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
108
- [-1, 1, Conv, [960, 1, 1]], # 88
109
- [[-1, -11], 1, Shortcut, [1]], # 89
110
-
111
- [-1, 1, DownC, [1280]], # 90-P6/64
112
- [-1, 1, Conv, [512, 1, 1]],
113
- [-2, 1, Conv, [512, 1, 1]],
114
- [-1, 1, Conv, [512, 3, 1]],
115
- [-1, 1, Conv, [512, 3, 1]],
116
- [-1, 1, Conv, [512, 3, 1]],
117
- [-1, 1, Conv, [512, 3, 1]],
118
- [-1, 1, Conv, [512, 3, 1]],
119
- [-1, 1, Conv, [512, 3, 1]],
120
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
121
- [-1, 1, Conv, [1280, 1, 1]], # 100
122
- [-11, 1, Conv, [512, 1, 1]],
123
- [-12, 1, Conv, [512, 1, 1]],
124
- [-1, 1, Conv, [512, 3, 1]],
125
- [-1, 1, Conv, [512, 3, 1]],
126
- [-1, 1, Conv, [512, 3, 1]],
127
- [-1, 1, Conv, [512, 3, 1]],
128
- [-1, 1, Conv, [512, 3, 1]],
129
- [-1, 1, Conv, [512, 3, 1]],
130
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
131
- [-1, 1, Conv, [1280, 1, 1]], # 110
132
- [[-1, -11], 1, Shortcut, [1]], # 111
133
- ]
134
-
135
- # yolov7-e6e head
136
- head:
137
- [[-1, 1, SPPCSPC, [640]], # 112
138
-
139
- [-1, 1, Conv, [480, 1, 1]],
140
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
141
- [89, 1, Conv, [480, 1, 1]], # route backbone P5
142
- [[-1, -2], 1, Concat, [1]],
143
-
144
- [-1, 1, Conv, [384, 1, 1]],
145
- [-2, 1, Conv, [384, 1, 1]],
146
- [-1, 1, Conv, [192, 3, 1]],
147
- [-1, 1, Conv, [192, 3, 1]],
148
- [-1, 1, Conv, [192, 3, 1]],
149
- [-1, 1, Conv, [192, 3, 1]],
150
- [-1, 1, Conv, [192, 3, 1]],
151
- [-1, 1, Conv, [192, 3, 1]],
152
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
153
- [-1, 1, Conv, [480, 1, 1]], # 126
154
- [-11, 1, Conv, [384, 1, 1]],
155
- [-12, 1, Conv, [384, 1, 1]],
156
- [-1, 1, Conv, [192, 3, 1]],
157
- [-1, 1, Conv, [192, 3, 1]],
158
- [-1, 1, Conv, [192, 3, 1]],
159
- [-1, 1, Conv, [192, 3, 1]],
160
- [-1, 1, Conv, [192, 3, 1]],
161
- [-1, 1, Conv, [192, 3, 1]],
162
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
163
- [-1, 1, Conv, [480, 1, 1]], # 136
164
- [[-1, -11], 1, Shortcut, [1]], # 137
165
-
166
- [-1, 1, Conv, [320, 1, 1]],
167
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
168
- [67, 1, Conv, [320, 1, 1]], # route backbone P4
169
- [[-1, -2], 1, Concat, [1]],
170
-
171
- [-1, 1, Conv, [256, 1, 1]],
172
- [-2, 1, Conv, [256, 1, 1]],
173
- [-1, 1, Conv, [128, 3, 1]],
174
- [-1, 1, Conv, [128, 3, 1]],
175
- [-1, 1, Conv, [128, 3, 1]],
176
- [-1, 1, Conv, [128, 3, 1]],
177
- [-1, 1, Conv, [128, 3, 1]],
178
- [-1, 1, Conv, [128, 3, 1]],
179
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
180
- [-1, 1, Conv, [320, 1, 1]], # 151
181
- [-11, 1, Conv, [256, 1, 1]],
182
- [-12, 1, Conv, [256, 1, 1]],
183
- [-1, 1, Conv, [128, 3, 1]],
184
- [-1, 1, Conv, [128, 3, 1]],
185
- [-1, 1, Conv, [128, 3, 1]],
186
- [-1, 1, Conv, [128, 3, 1]],
187
- [-1, 1, Conv, [128, 3, 1]],
188
- [-1, 1, Conv, [128, 3, 1]],
189
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
190
- [-1, 1, Conv, [320, 1, 1]], # 161
191
- [[-1, -11], 1, Shortcut, [1]], # 162
192
-
193
- [-1, 1, Conv, [160, 1, 1]],
194
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
195
- [45, 1, Conv, [160, 1, 1]], # route backbone P3
196
- [[-1, -2], 1, Concat, [1]],
197
-
198
- [-1, 1, Conv, [128, 1, 1]],
199
- [-2, 1, Conv, [128, 1, 1]],
200
- [-1, 1, Conv, [64, 3, 1]],
201
- [-1, 1, Conv, [64, 3, 1]],
202
- [-1, 1, Conv, [64, 3, 1]],
203
- [-1, 1, Conv, [64, 3, 1]],
204
- [-1, 1, Conv, [64, 3, 1]],
205
- [-1, 1, Conv, [64, 3, 1]],
206
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
207
- [-1, 1, Conv, [160, 1, 1]], # 176
208
- [-11, 1, Conv, [128, 1, 1]],
209
- [-12, 1, Conv, [128, 1, 1]],
210
- [-1, 1, Conv, [64, 3, 1]],
211
- [-1, 1, Conv, [64, 3, 1]],
212
- [-1, 1, Conv, [64, 3, 1]],
213
- [-1, 1, Conv, [64, 3, 1]],
214
- [-1, 1, Conv, [64, 3, 1]],
215
- [-1, 1, Conv, [64, 3, 1]],
216
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
217
- [-1, 1, Conv, [160, 1, 1]], # 186
218
- [[-1, -11], 1, Shortcut, [1]], # 187
219
-
220
- [-1, 1, DownC, [320]],
221
- [[-1, 162], 1, Concat, [1]],
222
-
223
- [-1, 1, Conv, [256, 1, 1]],
224
- [-2, 1, Conv, [256, 1, 1]],
225
- [-1, 1, Conv, [128, 3, 1]],
226
- [-1, 1, Conv, [128, 3, 1]],
227
- [-1, 1, Conv, [128, 3, 1]],
228
- [-1, 1, Conv, [128, 3, 1]],
229
- [-1, 1, Conv, [128, 3, 1]],
230
- [-1, 1, Conv, [128, 3, 1]],
231
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
232
- [-1, 1, Conv, [320, 1, 1]], # 199
233
- [-11, 1, Conv, [256, 1, 1]],
234
- [-12, 1, Conv, [256, 1, 1]],
235
- [-1, 1, Conv, [128, 3, 1]],
236
- [-1, 1, Conv, [128, 3, 1]],
237
- [-1, 1, Conv, [128, 3, 1]],
238
- [-1, 1, Conv, [128, 3, 1]],
239
- [-1, 1, Conv, [128, 3, 1]],
240
- [-1, 1, Conv, [128, 3, 1]],
241
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
242
- [-1, 1, Conv, [320, 1, 1]], # 209
243
- [[-1, -11], 1, Shortcut, [1]], # 210
244
-
245
- [-1, 1, DownC, [480]],
246
- [[-1, 137], 1, Concat, [1]],
247
-
248
- [-1, 1, Conv, [384, 1, 1]],
249
- [-2, 1, Conv, [384, 1, 1]],
250
- [-1, 1, Conv, [192, 3, 1]],
251
- [-1, 1, Conv, [192, 3, 1]],
252
- [-1, 1, Conv, [192, 3, 1]],
253
- [-1, 1, Conv, [192, 3, 1]],
254
- [-1, 1, Conv, [192, 3, 1]],
255
- [-1, 1, Conv, [192, 3, 1]],
256
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
257
- [-1, 1, Conv, [480, 1, 1]], # 222
258
- [-11, 1, Conv, [384, 1, 1]],
259
- [-12, 1, Conv, [384, 1, 1]],
260
- [-1, 1, Conv, [192, 3, 1]],
261
- [-1, 1, Conv, [192, 3, 1]],
262
- [-1, 1, Conv, [192, 3, 1]],
263
- [-1, 1, Conv, [192, 3, 1]],
264
- [-1, 1, Conv, [192, 3, 1]],
265
- [-1, 1, Conv, [192, 3, 1]],
266
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
267
- [-1, 1, Conv, [480, 1, 1]], # 232
268
- [[-1, -11], 1, Shortcut, [1]], # 233
269
-
270
- [-1, 1, DownC, [640]],
271
- [[-1, 112], 1, Concat, [1]],
272
-
273
- [-1, 1, Conv, [512, 1, 1]],
274
- [-2, 1, Conv, [512, 1, 1]],
275
- [-1, 1, Conv, [256, 3, 1]],
276
- [-1, 1, Conv, [256, 3, 1]],
277
- [-1, 1, Conv, [256, 3, 1]],
278
- [-1, 1, Conv, [256, 3, 1]],
279
- [-1, 1, Conv, [256, 3, 1]],
280
- [-1, 1, Conv, [256, 3, 1]],
281
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
282
- [-1, 1, Conv, [640, 1, 1]], # 245
283
- [-11, 1, Conv, [512, 1, 1]],
284
- [-12, 1, Conv, [512, 1, 1]],
285
- [-1, 1, Conv, [256, 3, 1]],
286
- [-1, 1, Conv, [256, 3, 1]],
287
- [-1, 1, Conv, [256, 3, 1]],
288
- [-1, 1, Conv, [256, 3, 1]],
289
- [-1, 1, Conv, [256, 3, 1]],
290
- [-1, 1, Conv, [256, 3, 1]],
291
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
292
- [-1, 1, Conv, [640, 1, 1]], # 255
293
- [[-1, -11], 1, Shortcut, [1]], # 256
294
-
295
- [187, 1, Conv, [320, 3, 1]],
296
- [210, 1, Conv, [640, 3, 1]],
297
- [233, 1, Conv, [960, 3, 1]],
298
- [256, 1, Conv, [1280, 3, 1]],
299
-
300
- [[257,258,259,260], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
301
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-tiny-silu.yaml DELETED
@@ -1,112 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [10,13, 16,30, 33,23] # P3/8
9
- - [30,61, 62,45, 59,119] # P4/16
10
- - [116,90, 156,198, 373,326] # P5/32
11
-
12
- # YOLOv7-tiny backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 2]], # 0-P1/2
16
-
17
- [-1, 1, Conv, [64, 3, 2]], # 1-P2/4
18
-
19
- [-1, 1, Conv, [32, 1, 1]],
20
- [-2, 1, Conv, [32, 1, 1]],
21
- [-1, 1, Conv, [32, 3, 1]],
22
- [-1, 1, Conv, [32, 3, 1]],
23
- [[-1, -2, -3, -4], 1, Concat, [1]],
24
- [-1, 1, Conv, [64, 1, 1]], # 7
25
-
26
- [-1, 1, MP, []], # 8-P3/8
27
- [-1, 1, Conv, [64, 1, 1]],
28
- [-2, 1, Conv, [64, 1, 1]],
29
- [-1, 1, Conv, [64, 3, 1]],
30
- [-1, 1, Conv, [64, 3, 1]],
31
- [[-1, -2, -3, -4], 1, Concat, [1]],
32
- [-1, 1, Conv, [128, 1, 1]], # 14
33
-
34
- [-1, 1, MP, []], # 15-P4/16
35
- [-1, 1, Conv, [128, 1, 1]],
36
- [-2, 1, Conv, [128, 1, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [[-1, -2, -3, -4], 1, Concat, [1]],
40
- [-1, 1, Conv, [256, 1, 1]], # 21
41
-
42
- [-1, 1, MP, []], # 22-P5/32
43
- [-1, 1, Conv, [256, 1, 1]],
44
- [-2, 1, Conv, [256, 1, 1]],
45
- [-1, 1, Conv, [256, 3, 1]],
46
- [-1, 1, Conv, [256, 3, 1]],
47
- [[-1, -2, -3, -4], 1, Concat, [1]],
48
- [-1, 1, Conv, [512, 1, 1]], # 28
49
- ]
50
-
51
- # YOLOv7-tiny head
52
- head:
53
- [[-1, 1, Conv, [256, 1, 1]],
54
- [-2, 1, Conv, [256, 1, 1]],
55
- [-1, 1, SP, [5]],
56
- [-2, 1, SP, [9]],
57
- [-3, 1, SP, [13]],
58
- [[-1, -2, -3, -4], 1, Concat, [1]],
59
- [-1, 1, Conv, [256, 1, 1]],
60
- [[-1, -7], 1, Concat, [1]],
61
- [-1, 1, Conv, [256, 1, 1]], # 37
62
-
63
- [-1, 1, Conv, [128, 1, 1]],
64
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
65
- [21, 1, Conv, [128, 1, 1]], # route backbone P4
66
- [[-1, -2], 1, Concat, [1]],
67
-
68
- [-1, 1, Conv, [64, 1, 1]],
69
- [-2, 1, Conv, [64, 1, 1]],
70
- [-1, 1, Conv, [64, 3, 1]],
71
- [-1, 1, Conv, [64, 3, 1]],
72
- [[-1, -2, -3, -4], 1, Concat, [1]],
73
- [-1, 1, Conv, [128, 1, 1]], # 47
74
-
75
- [-1, 1, Conv, [64, 1, 1]],
76
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
77
- [14, 1, Conv, [64, 1, 1]], # route backbone P3
78
- [[-1, -2], 1, Concat, [1]],
79
-
80
- [-1, 1, Conv, [32, 1, 1]],
81
- [-2, 1, Conv, [32, 1, 1]],
82
- [-1, 1, Conv, [32, 3, 1]],
83
- [-1, 1, Conv, [32, 3, 1]],
84
- [[-1, -2, -3, -4], 1, Concat, [1]],
85
- [-1, 1, Conv, [64, 1, 1]], # 57
86
-
87
- [-1, 1, Conv, [128, 3, 2]],
88
- [[-1, 47], 1, Concat, [1]],
89
-
90
- [-1, 1, Conv, [64, 1, 1]],
91
- [-2, 1, Conv, [64, 1, 1]],
92
- [-1, 1, Conv, [64, 3, 1]],
93
- [-1, 1, Conv, [64, 3, 1]],
94
- [[-1, -2, -3, -4], 1, Concat, [1]],
95
- [-1, 1, Conv, [128, 1, 1]], # 65
96
-
97
- [-1, 1, Conv, [256, 3, 2]],
98
- [[-1, 37], 1, Concat, [1]],
99
-
100
- [-1, 1, Conv, [128, 1, 1]],
101
- [-2, 1, Conv, [128, 1, 1]],
102
- [-1, 1, Conv, [128, 3, 1]],
103
- [-1, 1, Conv, [128, 3, 1]],
104
- [[-1, -2, -3, -4], 1, Concat, [1]],
105
- [-1, 1, Conv, [256, 1, 1]], # 73
106
-
107
- [57, 1, Conv, [128, 3, 1]],
108
- [65, 1, Conv, [256, 3, 1]],
109
- [73, 1, Conv, [512, 3, 1]],
110
-
111
- [[74,75,76], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
112
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-tiny.yaml DELETED
@@ -1,112 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [10,13, 16,30, 33,23] # P3/8
9
- - [30,61, 62,45, 59,119] # P4/16
10
- - [116,90, 156,198, 373,326] # P5/32
11
-
12
- # yolov7-tiny backbone
13
- backbone:
14
- # [from, number, module, args] c2, k=1, s=1, p=None, g=1, act=True
15
- [[-1, 1, Conv, [32, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 0-P1/2
16
-
17
- [-1, 1, Conv, [64, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 1-P2/4
18
-
19
- [-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
20
- [-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
21
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
22
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
23
- [[-1, -2, -3, -4], 1, Concat, [1]],
24
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 7
25
-
26
- [-1, 1, MP, []], # 8-P3/8
27
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
28
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
29
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
30
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
31
- [[-1, -2, -3, -4], 1, Concat, [1]],
32
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 14
33
-
34
- [-1, 1, MP, []], # 15-P4/16
35
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
36
- [-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
37
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
38
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
39
- [[-1, -2, -3, -4], 1, Concat, [1]],
40
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 21
41
-
42
- [-1, 1, MP, []], # 22-P5/32
43
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
44
- [-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
45
- [-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
46
- [-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
47
- [[-1, -2, -3, -4], 1, Concat, [1]],
48
- [-1, 1, Conv, [512, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 28
49
- ]
50
-
51
- # yolov7-tiny head
52
- head:
53
- [[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
54
- [-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
55
- [-1, 1, SP, [5]],
56
- [-2, 1, SP, [9]],
57
- [-3, 1, SP, [13]],
58
- [[-1, -2, -3, -4], 1, Concat, [1]],
59
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
60
- [[-1, -7], 1, Concat, [1]],
61
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 37
62
-
63
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
64
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
65
- [21, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P4
66
- [[-1, -2], 1, Concat, [1]],
67
-
68
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
69
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
70
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
71
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
72
- [[-1, -2, -3, -4], 1, Concat, [1]],
73
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 47
74
-
75
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
76
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
77
- [14, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P3
78
- [[-1, -2], 1, Concat, [1]],
79
-
80
- [-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
81
- [-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
82
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
83
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
84
- [[-1, -2, -3, -4], 1, Concat, [1]],
85
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 57
86
-
87
- [-1, 1, Conv, [128, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
88
- [[-1, 47], 1, Concat, [1]],
89
-
90
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
91
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
92
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
93
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
94
- [[-1, -2, -3, -4], 1, Concat, [1]],
95
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 65
96
-
97
- [-1, 1, Conv, [256, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
98
- [[-1, 37], 1, Concat, [1]],
99
-
100
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
101
- [-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
102
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
103
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
104
- [[-1, -2, -3, -4], 1, Concat, [1]],
105
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 73
106
-
107
- [57, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
108
- [65, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
109
- [73, 1, Conv, [512, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
110
-
111
- [[74,75,76], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
112
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7-w6.yaml DELETED
@@ -1,158 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7-w6 backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, Conv, [128, 3, 2]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [[-1, -3, -5, -6], 1, Concat, [1]],
27
- [-1, 1, Conv, [128, 1, 1]], # 10
28
-
29
- [-1, 1, Conv, [256, 3, 2]], # 11-P3/8
30
- [-1, 1, Conv, [128, 1, 1]],
31
- [-2, 1, Conv, [128, 1, 1]],
32
- [-1, 1, Conv, [128, 3, 1]],
33
- [-1, 1, Conv, [128, 3, 1]],
34
- [-1, 1, Conv, [128, 3, 1]],
35
- [-1, 1, Conv, [128, 3, 1]],
36
- [[-1, -3, -5, -6], 1, Concat, [1]],
37
- [-1, 1, Conv, [256, 1, 1]], # 19
38
-
39
- [-1, 1, Conv, [512, 3, 2]], # 20-P4/16
40
- [-1, 1, Conv, [256, 1, 1]],
41
- [-2, 1, Conv, [256, 1, 1]],
42
- [-1, 1, Conv, [256, 3, 1]],
43
- [-1, 1, Conv, [256, 3, 1]],
44
- [-1, 1, Conv, [256, 3, 1]],
45
- [-1, 1, Conv, [256, 3, 1]],
46
- [[-1, -3, -5, -6], 1, Concat, [1]],
47
- [-1, 1, Conv, [512, 1, 1]], # 28
48
-
49
- [-1, 1, Conv, [768, 3, 2]], # 29-P5/32
50
- [-1, 1, Conv, [384, 1, 1]],
51
- [-2, 1, Conv, [384, 1, 1]],
52
- [-1, 1, Conv, [384, 3, 1]],
53
- [-1, 1, Conv, [384, 3, 1]],
54
- [-1, 1, Conv, [384, 3, 1]],
55
- [-1, 1, Conv, [384, 3, 1]],
56
- [[-1, -3, -5, -6], 1, Concat, [1]],
57
- [-1, 1, Conv, [768, 1, 1]], # 37
58
-
59
- [-1, 1, Conv, [1024, 3, 2]], # 38-P6/64
60
- [-1, 1, Conv, [512, 1, 1]],
61
- [-2, 1, Conv, [512, 1, 1]],
62
- [-1, 1, Conv, [512, 3, 1]],
63
- [-1, 1, Conv, [512, 3, 1]],
64
- [-1, 1, Conv, [512, 3, 1]],
65
- [-1, 1, Conv, [512, 3, 1]],
66
- [[-1, -3, -5, -6], 1, Concat, [1]],
67
- [-1, 1, Conv, [1024, 1, 1]], # 46
68
- ]
69
-
70
- # yolov7-w6 head
71
- head:
72
- [[-1, 1, SPPCSPC, [512]], # 47
73
-
74
- [-1, 1, Conv, [384, 1, 1]],
75
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
76
- [37, 1, Conv, [384, 1, 1]], # route backbone P5
77
- [[-1, -2], 1, Concat, [1]],
78
-
79
- [-1, 1, Conv, [384, 1, 1]],
80
- [-2, 1, Conv, [384, 1, 1]],
81
- [-1, 1, Conv, [192, 3, 1]],
82
- [-1, 1, Conv, [192, 3, 1]],
83
- [-1, 1, Conv, [192, 3, 1]],
84
- [-1, 1, Conv, [192, 3, 1]],
85
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
86
- [-1, 1, Conv, [384, 1, 1]], # 59
87
-
88
- [-1, 1, Conv, [256, 1, 1]],
89
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
90
- [28, 1, Conv, [256, 1, 1]], # route backbone P4
91
- [[-1, -2], 1, Concat, [1]],
92
-
93
- [-1, 1, Conv, [256, 1, 1]],
94
- [-2, 1, Conv, [256, 1, 1]],
95
- [-1, 1, Conv, [128, 3, 1]],
96
- [-1, 1, Conv, [128, 3, 1]],
97
- [-1, 1, Conv, [128, 3, 1]],
98
- [-1, 1, Conv, [128, 3, 1]],
99
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
100
- [-1, 1, Conv, [256, 1, 1]], # 71
101
-
102
- [-1, 1, Conv, [128, 1, 1]],
103
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
104
- [19, 1, Conv, [128, 1, 1]], # route backbone P3
105
- [[-1, -2], 1, Concat, [1]],
106
-
107
- [-1, 1, Conv, [128, 1, 1]],
108
- [-2, 1, Conv, [128, 1, 1]],
109
- [-1, 1, Conv, [64, 3, 1]],
110
- [-1, 1, Conv, [64, 3, 1]],
111
- [-1, 1, Conv, [64, 3, 1]],
112
- [-1, 1, Conv, [64, 3, 1]],
113
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
114
- [-1, 1, Conv, [128, 1, 1]], # 83
115
-
116
- [-1, 1, Conv, [256, 3, 2]],
117
- [[-1, 71], 1, Concat, [1]], # cat
118
-
119
- [-1, 1, Conv, [256, 1, 1]],
120
- [-2, 1, Conv, [256, 1, 1]],
121
- [-1, 1, Conv, [128, 3, 1]],
122
- [-1, 1, Conv, [128, 3, 1]],
123
- [-1, 1, Conv, [128, 3, 1]],
124
- [-1, 1, Conv, [128, 3, 1]],
125
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
126
- [-1, 1, Conv, [256, 1, 1]], # 93
127
-
128
- [-1, 1, Conv, [384, 3, 2]],
129
- [[-1, 59], 1, Concat, [1]], # cat
130
-
131
- [-1, 1, Conv, [384, 1, 1]],
132
- [-2, 1, Conv, [384, 1, 1]],
133
- [-1, 1, Conv, [192, 3, 1]],
134
- [-1, 1, Conv, [192, 3, 1]],
135
- [-1, 1, Conv, [192, 3, 1]],
136
- [-1, 1, Conv, [192, 3, 1]],
137
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
138
- [-1, 1, Conv, [384, 1, 1]], # 103
139
-
140
- [-1, 1, Conv, [512, 3, 2]],
141
- [[-1, 47], 1, Concat, [1]], # cat
142
-
143
- [-1, 1, Conv, [512, 1, 1]],
144
- [-2, 1, Conv, [512, 1, 1]],
145
- [-1, 1, Conv, [256, 3, 1]],
146
- [-1, 1, Conv, [256, 3, 1]],
147
- [-1, 1, Conv, [256, 3, 1]],
148
- [-1, 1, Conv, [256, 3, 1]],
149
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
150
- [-1, 1, Conv, [512, 1, 1]], # 113
151
-
152
- [83, 1, Conv, [256, 3, 1]],
153
- [93, 1, Conv, [512, 3, 1]],
154
- [103, 1, Conv, [768, 3, 1]],
155
- [113, 1, Conv, [1024, 3, 1]],
156
-
157
- [[114,115,116,117], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5, P6)
158
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7.yaml DELETED
@@ -1,140 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # yolov7 backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
-
17
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
18
- [-1, 1, Conv, [64, 3, 1]],
19
-
20
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
21
- [-1, 1, Conv, [64, 1, 1]],
22
- [-2, 1, Conv, [64, 1, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [[-1, -3, -5, -6], 1, Concat, [1]],
28
- [-1, 1, Conv, [256, 1, 1]], # 11
29
-
30
- [-1, 1, MP, []],
31
- [-1, 1, Conv, [128, 1, 1]],
32
- [-3, 1, Conv, [128, 1, 1]],
33
- [-1, 1, Conv, [128, 3, 2]],
34
- [[-1, -3], 1, Concat, [1]], # 16-P3/8
35
- [-1, 1, Conv, [128, 1, 1]],
36
- [-2, 1, Conv, [128, 1, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [[-1, -3, -5, -6], 1, Concat, [1]],
42
- [-1, 1, Conv, [512, 1, 1]], # 24
43
-
44
- [-1, 1, MP, []],
45
- [-1, 1, Conv, [256, 1, 1]],
46
- [-3, 1, Conv, [256, 1, 1]],
47
- [-1, 1, Conv, [256, 3, 2]],
48
- [[-1, -3], 1, Concat, [1]], # 29-P4/16
49
- [-1, 1, Conv, [256, 1, 1]],
50
- [-2, 1, Conv, [256, 1, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [-1, 1, Conv, [256, 3, 1]],
53
- [-1, 1, Conv, [256, 3, 1]],
54
- [-1, 1, Conv, [256, 3, 1]],
55
- [[-1, -3, -5, -6], 1, Concat, [1]],
56
- [-1, 1, Conv, [1024, 1, 1]], # 37
57
-
58
- [-1, 1, MP, []],
59
- [-1, 1, Conv, [512, 1, 1]],
60
- [-3, 1, Conv, [512, 1, 1]],
61
- [-1, 1, Conv, [512, 3, 2]],
62
- [[-1, -3], 1, Concat, [1]], # 42-P5/32
63
- [-1, 1, Conv, [256, 1, 1]],
64
- [-2, 1, Conv, [256, 1, 1]],
65
- [-1, 1, Conv, [256, 3, 1]],
66
- [-1, 1, Conv, [256, 3, 1]],
67
- [-1, 1, Conv, [256, 3, 1]],
68
- [-1, 1, Conv, [256, 3, 1]],
69
- [[-1, -3, -5, -6], 1, Concat, [1]],
70
- [-1, 1, Conv, [1024, 1, 1]], # 50
71
- ]
72
-
73
- # yolov7 head
74
- head:
75
- [[-1, 1, SPPCSPC, [512]], # 51
76
-
77
- [-1, 1, Conv, [256, 1, 1]],
78
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
79
- [37, 1, Conv, [256, 1, 1]], # route backbone P4
80
- [[-1, -2], 1, Concat, [1]],
81
-
82
- [-1, 1, Conv, [256, 1, 1]],
83
- [-2, 1, Conv, [256, 1, 1]],
84
- [-1, 1, Conv, [128, 3, 1]],
85
- [-1, 1, Conv, [128, 3, 1]],
86
- [-1, 1, Conv, [128, 3, 1]],
87
- [-1, 1, Conv, [128, 3, 1]],
88
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
89
- [-1, 1, Conv, [256, 1, 1]], # 63
90
-
91
- [-1, 1, Conv, [128, 1, 1]],
92
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
93
- [24, 1, Conv, [128, 1, 1]], # route backbone P3
94
- [[-1, -2], 1, Concat, [1]],
95
-
96
- [-1, 1, Conv, [128, 1, 1]],
97
- [-2, 1, Conv, [128, 1, 1]],
98
- [-1, 1, Conv, [64, 3, 1]],
99
- [-1, 1, Conv, [64, 3, 1]],
100
- [-1, 1, Conv, [64, 3, 1]],
101
- [-1, 1, Conv, [64, 3, 1]],
102
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
103
- [-1, 1, Conv, [128, 1, 1]], # 75
104
-
105
- [-1, 1, MP, []],
106
- [-1, 1, Conv, [128, 1, 1]],
107
- [-3, 1, Conv, [128, 1, 1]],
108
- [-1, 1, Conv, [128, 3, 2]],
109
- [[-1, -3, 63], 1, Concat, [1]],
110
-
111
- [-1, 1, Conv, [256, 1, 1]],
112
- [-2, 1, Conv, [256, 1, 1]],
113
- [-1, 1, Conv, [128, 3, 1]],
114
- [-1, 1, Conv, [128, 3, 1]],
115
- [-1, 1, Conv, [128, 3, 1]],
116
- [-1, 1, Conv, [128, 3, 1]],
117
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
118
- [-1, 1, Conv, [256, 1, 1]], # 88
119
-
120
- [-1, 1, MP, []],
121
- [-1, 1, Conv, [256, 1, 1]],
122
- [-3, 1, Conv, [256, 1, 1]],
123
- [-1, 1, Conv, [256, 3, 2]],
124
- [[-1, -3, 51], 1, Concat, [1]],
125
-
126
- [-1, 1, Conv, [512, 1, 1]],
127
- [-2, 1, Conv, [512, 1, 1]],
128
- [-1, 1, Conv, [256, 3, 1]],
129
- [-1, 1, Conv, [256, 3, 1]],
130
- [-1, 1, Conv, [256, 3, 1]],
131
- [-1, 1, Conv, [256, 3, 1]],
132
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
133
- [-1, 1, Conv, [512, 1, 1]], # 101
134
-
135
- [75, 1, RepConv, [256, 3, 1]],
136
- [88, 1, RepConv, [512, 3, 1]],
137
- [101, 1, RepConv, [1024, 3, 1]],
138
-
139
- [[102,103,104], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
140
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/deploy/yolov7x.yaml DELETED
@@ -1,156 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # yolov7x backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [40, 3, 1]], # 0
16
-
17
- [-1, 1, Conv, [80, 3, 2]], # 1-P1/2
18
- [-1, 1, Conv, [80, 3, 1]],
19
-
20
- [-1, 1, Conv, [160, 3, 2]], # 3-P2/4
21
- [-1, 1, Conv, [64, 1, 1]],
22
- [-2, 1, Conv, [64, 1, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [-1, 1, Conv, [64, 3, 1]],
29
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
30
- [-1, 1, Conv, [320, 1, 1]], # 13
31
-
32
- [-1, 1, MP, []],
33
- [-1, 1, Conv, [160, 1, 1]],
34
- [-3, 1, Conv, [160, 1, 1]],
35
- [-1, 1, Conv, [160, 3, 2]],
36
- [[-1, -3], 1, Concat, [1]], # 18-P3/8
37
- [-1, 1, Conv, [128, 1, 1]],
38
- [-2, 1, Conv, [128, 1, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [-1, 1, Conv, [128, 3, 1]],
42
- [-1, 1, Conv, [128, 3, 1]],
43
- [-1, 1, Conv, [128, 3, 1]],
44
- [-1, 1, Conv, [128, 3, 1]],
45
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
46
- [-1, 1, Conv, [640, 1, 1]], # 28
47
-
48
- [-1, 1, MP, []],
49
- [-1, 1, Conv, [320, 1, 1]],
50
- [-3, 1, Conv, [320, 1, 1]],
51
- [-1, 1, Conv, [320, 3, 2]],
52
- [[-1, -3], 1, Concat, [1]], # 33-P4/16
53
- [-1, 1, Conv, [256, 1, 1]],
54
- [-2, 1, Conv, [256, 1, 1]],
55
- [-1, 1, Conv, [256, 3, 1]],
56
- [-1, 1, Conv, [256, 3, 1]],
57
- [-1, 1, Conv, [256, 3, 1]],
58
- [-1, 1, Conv, [256, 3, 1]],
59
- [-1, 1, Conv, [256, 3, 1]],
60
- [-1, 1, Conv, [256, 3, 1]],
61
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
62
- [-1, 1, Conv, [1280, 1, 1]], # 43
63
-
64
- [-1, 1, MP, []],
65
- [-1, 1, Conv, [640, 1, 1]],
66
- [-3, 1, Conv, [640, 1, 1]],
67
- [-1, 1, Conv, [640, 3, 2]],
68
- [[-1, -3], 1, Concat, [1]], # 48-P5/32
69
- [-1, 1, Conv, [256, 1, 1]],
70
- [-2, 1, Conv, [256, 1, 1]],
71
- [-1, 1, Conv, [256, 3, 1]],
72
- [-1, 1, Conv, [256, 3, 1]],
73
- [-1, 1, Conv, [256, 3, 1]],
74
- [-1, 1, Conv, [256, 3, 1]],
75
- [-1, 1, Conv, [256, 3, 1]],
76
- [-1, 1, Conv, [256, 3, 1]],
77
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
78
- [-1, 1, Conv, [1280, 1, 1]], # 58
79
- ]
80
-
81
- # yolov7x head
82
- head:
83
- [[-1, 1, SPPCSPC, [640]], # 59
84
-
85
- [-1, 1, Conv, [320, 1, 1]],
86
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
87
- [43, 1, Conv, [320, 1, 1]], # route backbone P4
88
- [[-1, -2], 1, Concat, [1]],
89
-
90
- [-1, 1, Conv, [256, 1, 1]],
91
- [-2, 1, Conv, [256, 1, 1]],
92
- [-1, 1, Conv, [256, 3, 1]],
93
- [-1, 1, Conv, [256, 3, 1]],
94
- [-1, 1, Conv, [256, 3, 1]],
95
- [-1, 1, Conv, [256, 3, 1]],
96
- [-1, 1, Conv, [256, 3, 1]],
97
- [-1, 1, Conv, [256, 3, 1]],
98
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
99
- [-1, 1, Conv, [320, 1, 1]], # 73
100
-
101
- [-1, 1, Conv, [160, 1, 1]],
102
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
103
- [28, 1, Conv, [160, 1, 1]], # route backbone P3
104
- [[-1, -2], 1, Concat, [1]],
105
-
106
- [-1, 1, Conv, [128, 1, 1]],
107
- [-2, 1, Conv, [128, 1, 1]],
108
- [-1, 1, Conv, [128, 3, 1]],
109
- [-1, 1, Conv, [128, 3, 1]],
110
- [-1, 1, Conv, [128, 3, 1]],
111
- [-1, 1, Conv, [128, 3, 1]],
112
- [-1, 1, Conv, [128, 3, 1]],
113
- [-1, 1, Conv, [128, 3, 1]],
114
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
115
- [-1, 1, Conv, [160, 1, 1]], # 87
116
-
117
- [-1, 1, MP, []],
118
- [-1, 1, Conv, [160, 1, 1]],
119
- [-3, 1, Conv, [160, 1, 1]],
120
- [-1, 1, Conv, [160, 3, 2]],
121
- [[-1, -3, 73], 1, Concat, [1]],
122
-
123
- [-1, 1, Conv, [256, 1, 1]],
124
- [-2, 1, Conv, [256, 1, 1]],
125
- [-1, 1, Conv, [256, 3, 1]],
126
- [-1, 1, Conv, [256, 3, 1]],
127
- [-1, 1, Conv, [256, 3, 1]],
128
- [-1, 1, Conv, [256, 3, 1]],
129
- [-1, 1, Conv, [256, 3, 1]],
130
- [-1, 1, Conv, [256, 3, 1]],
131
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
132
- [-1, 1, Conv, [320, 1, 1]], # 102
133
-
134
- [-1, 1, MP, []],
135
- [-1, 1, Conv, [320, 1, 1]],
136
- [-3, 1, Conv, [320, 1, 1]],
137
- [-1, 1, Conv, [320, 3, 2]],
138
- [[-1, -3, 59], 1, Concat, [1]],
139
-
140
- [-1, 1, Conv, [512, 1, 1]],
141
- [-2, 1, Conv, [512, 1, 1]],
142
- [-1, 1, Conv, [512, 3, 1]],
143
- [-1, 1, Conv, [512, 3, 1]],
144
- [-1, 1, Conv, [512, 3, 1]],
145
- [-1, 1, Conv, [512, 3, 1]],
146
- [-1, 1, Conv, [512, 3, 1]],
147
- [-1, 1, Conv, [512, 3, 1]],
148
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
149
- [-1, 1, Conv, [640, 1, 1]], # 117
150
-
151
- [87, 1, Conv, [320, 3, 1]],
152
- [102, 1, Conv, [640, 3, 1]],
153
- [117, 1, Conv, [1280, 3, 1]],
154
-
155
- [[118,119,120], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5)
156
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7-d6.yaml DELETED
@@ -1,207 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7 backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [96, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [192]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [-1, 1, Conv, [64, 3, 1]],
29
- [-1, 1, Conv, [64, 3, 1]],
30
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
31
- [-1, 1, Conv, [192, 1, 1]], # 14
32
-
33
- [-1, 1, DownC, [384]], # 15-P3/8
34
- [-1, 1, Conv, [128, 1, 1]],
35
- [-2, 1, Conv, [128, 1, 1]],
36
- [-1, 1, Conv, [128, 3, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [-1, 1, Conv, [128, 3, 1]],
42
- [-1, 1, Conv, [128, 3, 1]],
43
- [-1, 1, Conv, [128, 3, 1]],
44
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
45
- [-1, 1, Conv, [384, 1, 1]], # 27
46
-
47
- [-1, 1, DownC, [768]], # 28-P4/16
48
- [-1, 1, Conv, [256, 1, 1]],
49
- [-2, 1, Conv, [256, 1, 1]],
50
- [-1, 1, Conv, [256, 3, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [-1, 1, Conv, [256, 3, 1]],
53
- [-1, 1, Conv, [256, 3, 1]],
54
- [-1, 1, Conv, [256, 3, 1]],
55
- [-1, 1, Conv, [256, 3, 1]],
56
- [-1, 1, Conv, [256, 3, 1]],
57
- [-1, 1, Conv, [256, 3, 1]],
58
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
59
- [-1, 1, Conv, [768, 1, 1]], # 40
60
-
61
- [-1, 1, DownC, [1152]], # 41-P5/32
62
- [-1, 1, Conv, [384, 1, 1]],
63
- [-2, 1, Conv, [384, 1, 1]],
64
- [-1, 1, Conv, [384, 3, 1]],
65
- [-1, 1, Conv, [384, 3, 1]],
66
- [-1, 1, Conv, [384, 3, 1]],
67
- [-1, 1, Conv, [384, 3, 1]],
68
- [-1, 1, Conv, [384, 3, 1]],
69
- [-1, 1, Conv, [384, 3, 1]],
70
- [-1, 1, Conv, [384, 3, 1]],
71
- [-1, 1, Conv, [384, 3, 1]],
72
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
73
- [-1, 1, Conv, [1152, 1, 1]], # 53
74
-
75
- [-1, 1, DownC, [1536]], # 54-P6/64
76
- [-1, 1, Conv, [512, 1, 1]],
77
- [-2, 1, Conv, [512, 1, 1]],
78
- [-1, 1, Conv, [512, 3, 1]],
79
- [-1, 1, Conv, [512, 3, 1]],
80
- [-1, 1, Conv, [512, 3, 1]],
81
- [-1, 1, Conv, [512, 3, 1]],
82
- [-1, 1, Conv, [512, 3, 1]],
83
- [-1, 1, Conv, [512, 3, 1]],
84
- [-1, 1, Conv, [512, 3, 1]],
85
- [-1, 1, Conv, [512, 3, 1]],
86
- [[-1, -3, -5, -7, -9, -10], 1, Concat, [1]],
87
- [-1, 1, Conv, [1536, 1, 1]], # 66
88
- ]
89
-
90
- # yolov7 head
91
- head:
92
- [[-1, 1, SPPCSPC, [768]], # 67
93
-
94
- [-1, 1, Conv, [576, 1, 1]],
95
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
96
- [53, 1, Conv, [576, 1, 1]], # route backbone P5
97
- [[-1, -2], 1, Concat, [1]],
98
-
99
- [-1, 1, Conv, [384, 1, 1]],
100
- [-2, 1, Conv, [384, 1, 1]],
101
- [-1, 1, Conv, [192, 3, 1]],
102
- [-1, 1, Conv, [192, 3, 1]],
103
- [-1, 1, Conv, [192, 3, 1]],
104
- [-1, 1, Conv, [192, 3, 1]],
105
- [-1, 1, Conv, [192, 3, 1]],
106
- [-1, 1, Conv, [192, 3, 1]],
107
- [-1, 1, Conv, [192, 3, 1]],
108
- [-1, 1, Conv, [192, 3, 1]],
109
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
110
- [-1, 1, Conv, [576, 1, 1]], # 83
111
-
112
- [-1, 1, Conv, [384, 1, 1]],
113
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
114
- [40, 1, Conv, [384, 1, 1]], # route backbone P4
115
- [[-1, -2], 1, Concat, [1]],
116
-
117
- [-1, 1, Conv, [256, 1, 1]],
118
- [-2, 1, Conv, [256, 1, 1]],
119
- [-1, 1, Conv, [128, 3, 1]],
120
- [-1, 1, Conv, [128, 3, 1]],
121
- [-1, 1, Conv, [128, 3, 1]],
122
- [-1, 1, Conv, [128, 3, 1]],
123
- [-1, 1, Conv, [128, 3, 1]],
124
- [-1, 1, Conv, [128, 3, 1]],
125
- [-1, 1, Conv, [128, 3, 1]],
126
- [-1, 1, Conv, [128, 3, 1]],
127
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
128
- [-1, 1, Conv, [384, 1, 1]], # 99
129
-
130
- [-1, 1, Conv, [192, 1, 1]],
131
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
132
- [27, 1, Conv, [192, 1, 1]], # route backbone P3
133
- [[-1, -2], 1, Concat, [1]],
134
-
135
- [-1, 1, Conv, [128, 1, 1]],
136
- [-2, 1, Conv, [128, 1, 1]],
137
- [-1, 1, Conv, [64, 3, 1]],
138
- [-1, 1, Conv, [64, 3, 1]],
139
- [-1, 1, Conv, [64, 3, 1]],
140
- [-1, 1, Conv, [64, 3, 1]],
141
- [-1, 1, Conv, [64, 3, 1]],
142
- [-1, 1, Conv, [64, 3, 1]],
143
- [-1, 1, Conv, [64, 3, 1]],
144
- [-1, 1, Conv, [64, 3, 1]],
145
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
146
- [-1, 1, Conv, [192, 1, 1]], # 115
147
-
148
- [-1, 1, DownC, [384]],
149
- [[-1, 99], 1, Concat, [1]],
150
-
151
- [-1, 1, Conv, [256, 1, 1]],
152
- [-2, 1, Conv, [256, 1, 1]],
153
- [-1, 1, Conv, [128, 3, 1]],
154
- [-1, 1, Conv, [128, 3, 1]],
155
- [-1, 1, Conv, [128, 3, 1]],
156
- [-1, 1, Conv, [128, 3, 1]],
157
- [-1, 1, Conv, [128, 3, 1]],
158
- [-1, 1, Conv, [128, 3, 1]],
159
- [-1, 1, Conv, [128, 3, 1]],
160
- [-1, 1, Conv, [128, 3, 1]],
161
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
162
- [-1, 1, Conv, [384, 1, 1]], # 129
163
-
164
- [-1, 1, DownC, [576]],
165
- [[-1, 83], 1, Concat, [1]],
166
-
167
- [-1, 1, Conv, [384, 1, 1]],
168
- [-2, 1, Conv, [384, 1, 1]],
169
- [-1, 1, Conv, [192, 3, 1]],
170
- [-1, 1, Conv, [192, 3, 1]],
171
- [-1, 1, Conv, [192, 3, 1]],
172
- [-1, 1, Conv, [192, 3, 1]],
173
- [-1, 1, Conv, [192, 3, 1]],
174
- [-1, 1, Conv, [192, 3, 1]],
175
- [-1, 1, Conv, [192, 3, 1]],
176
- [-1, 1, Conv, [192, 3, 1]],
177
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
178
- [-1, 1, Conv, [576, 1, 1]], # 143
179
-
180
- [-1, 1, DownC, [768]],
181
- [[-1, 67], 1, Concat, [1]],
182
-
183
- [-1, 1, Conv, [512, 1, 1]],
184
- [-2, 1, Conv, [512, 1, 1]],
185
- [-1, 1, Conv, [256, 3, 1]],
186
- [-1, 1, Conv, [256, 3, 1]],
187
- [-1, 1, Conv, [256, 3, 1]],
188
- [-1, 1, Conv, [256, 3, 1]],
189
- [-1, 1, Conv, [256, 3, 1]],
190
- [-1, 1, Conv, [256, 3, 1]],
191
- [-1, 1, Conv, [256, 3, 1]],
192
- [-1, 1, Conv, [256, 3, 1]],
193
- [[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10], 1, Concat, [1]],
194
- [-1, 1, Conv, [768, 1, 1]], # 157
195
-
196
- [115, 1, Conv, [384, 3, 1]],
197
- [129, 1, Conv, [768, 3, 1]],
198
- [143, 1, Conv, [1152, 3, 1]],
199
- [157, 1, Conv, [1536, 3, 1]],
200
-
201
- [115, 1, Conv, [384, 3, 1]],
202
- [99, 1, Conv, [768, 3, 1]],
203
- [83, 1, Conv, [1152, 3, 1]],
204
- [67, 1, Conv, [1536, 3, 1]],
205
-
206
- [[158,159,160,161,162,163,164,165], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
207
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7-e6.yaml DELETED
@@ -1,185 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7 backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [80, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [160]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
29
- [-1, 1, Conv, [160, 1, 1]], # 12
30
-
31
- [-1, 1, DownC, [320]], # 13-P3/8
32
- [-1, 1, Conv, [128, 1, 1]],
33
- [-2, 1, Conv, [128, 1, 1]],
34
- [-1, 1, Conv, [128, 3, 1]],
35
- [-1, 1, Conv, [128, 3, 1]],
36
- [-1, 1, Conv, [128, 3, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
41
- [-1, 1, Conv, [320, 1, 1]], # 23
42
-
43
- [-1, 1, DownC, [640]], # 24-P4/16
44
- [-1, 1, Conv, [256, 1, 1]],
45
- [-2, 1, Conv, [256, 1, 1]],
46
- [-1, 1, Conv, [256, 3, 1]],
47
- [-1, 1, Conv, [256, 3, 1]],
48
- [-1, 1, Conv, [256, 3, 1]],
49
- [-1, 1, Conv, [256, 3, 1]],
50
- [-1, 1, Conv, [256, 3, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
53
- [-1, 1, Conv, [640, 1, 1]], # 34
54
-
55
- [-1, 1, DownC, [960]], # 35-P5/32
56
- [-1, 1, Conv, [384, 1, 1]],
57
- [-2, 1, Conv, [384, 1, 1]],
58
- [-1, 1, Conv, [384, 3, 1]],
59
- [-1, 1, Conv, [384, 3, 1]],
60
- [-1, 1, Conv, [384, 3, 1]],
61
- [-1, 1, Conv, [384, 3, 1]],
62
- [-1, 1, Conv, [384, 3, 1]],
63
- [-1, 1, Conv, [384, 3, 1]],
64
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
65
- [-1, 1, Conv, [960, 1, 1]], # 45
66
-
67
- [-1, 1, DownC, [1280]], # 46-P6/64
68
- [-1, 1, Conv, [512, 1, 1]],
69
- [-2, 1, Conv, [512, 1, 1]],
70
- [-1, 1, Conv, [512, 3, 1]],
71
- [-1, 1, Conv, [512, 3, 1]],
72
- [-1, 1, Conv, [512, 3, 1]],
73
- [-1, 1, Conv, [512, 3, 1]],
74
- [-1, 1, Conv, [512, 3, 1]],
75
- [-1, 1, Conv, [512, 3, 1]],
76
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
77
- [-1, 1, Conv, [1280, 1, 1]], # 56
78
- ]
79
-
80
- # yolov7 head
81
- head:
82
- [[-1, 1, SPPCSPC, [640]], # 57
83
-
84
- [-1, 1, Conv, [480, 1, 1]],
85
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
86
- [45, 1, Conv, [480, 1, 1]], # route backbone P5
87
- [[-1, -2], 1, Concat, [1]],
88
-
89
- [-1, 1, Conv, [384, 1, 1]],
90
- [-2, 1, Conv, [384, 1, 1]],
91
- [-1, 1, Conv, [192, 3, 1]],
92
- [-1, 1, Conv, [192, 3, 1]],
93
- [-1, 1, Conv, [192, 3, 1]],
94
- [-1, 1, Conv, [192, 3, 1]],
95
- [-1, 1, Conv, [192, 3, 1]],
96
- [-1, 1, Conv, [192, 3, 1]],
97
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
98
- [-1, 1, Conv, [480, 1, 1]], # 71
99
-
100
- [-1, 1, Conv, [320, 1, 1]],
101
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
102
- [34, 1, Conv, [320, 1, 1]], # route backbone P4
103
- [[-1, -2], 1, Concat, [1]],
104
-
105
- [-1, 1, Conv, [256, 1, 1]],
106
- [-2, 1, Conv, [256, 1, 1]],
107
- [-1, 1, Conv, [128, 3, 1]],
108
- [-1, 1, Conv, [128, 3, 1]],
109
- [-1, 1, Conv, [128, 3, 1]],
110
- [-1, 1, Conv, [128, 3, 1]],
111
- [-1, 1, Conv, [128, 3, 1]],
112
- [-1, 1, Conv, [128, 3, 1]],
113
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
114
- [-1, 1, Conv, [320, 1, 1]], # 85
115
-
116
- [-1, 1, Conv, [160, 1, 1]],
117
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
118
- [23, 1, Conv, [160, 1, 1]], # route backbone P3
119
- [[-1, -2], 1, Concat, [1]],
120
-
121
- [-1, 1, Conv, [128, 1, 1]],
122
- [-2, 1, Conv, [128, 1, 1]],
123
- [-1, 1, Conv, [64, 3, 1]],
124
- [-1, 1, Conv, [64, 3, 1]],
125
- [-1, 1, Conv, [64, 3, 1]],
126
- [-1, 1, Conv, [64, 3, 1]],
127
- [-1, 1, Conv, [64, 3, 1]],
128
- [-1, 1, Conv, [64, 3, 1]],
129
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
130
- [-1, 1, Conv, [160, 1, 1]], # 99
131
-
132
- [-1, 1, DownC, [320]],
133
- [[-1, 85], 1, Concat, [1]],
134
-
135
- [-1, 1, Conv, [256, 1, 1]],
136
- [-2, 1, Conv, [256, 1, 1]],
137
- [-1, 1, Conv, [128, 3, 1]],
138
- [-1, 1, Conv, [128, 3, 1]],
139
- [-1, 1, Conv, [128, 3, 1]],
140
- [-1, 1, Conv, [128, 3, 1]],
141
- [-1, 1, Conv, [128, 3, 1]],
142
- [-1, 1, Conv, [128, 3, 1]],
143
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
144
- [-1, 1, Conv, [320, 1, 1]], # 111
145
-
146
- [-1, 1, DownC, [480]],
147
- [[-1, 71], 1, Concat, [1]],
148
-
149
- [-1, 1, Conv, [384, 1, 1]],
150
- [-2, 1, Conv, [384, 1, 1]],
151
- [-1, 1, Conv, [192, 3, 1]],
152
- [-1, 1, Conv, [192, 3, 1]],
153
- [-1, 1, Conv, [192, 3, 1]],
154
- [-1, 1, Conv, [192, 3, 1]],
155
- [-1, 1, Conv, [192, 3, 1]],
156
- [-1, 1, Conv, [192, 3, 1]],
157
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
158
- [-1, 1, Conv, [480, 1, 1]], # 123
159
-
160
- [-1, 1, DownC, [640]],
161
- [[-1, 57], 1, Concat, [1]],
162
-
163
- [-1, 1, Conv, [512, 1, 1]],
164
- [-2, 1, Conv, [512, 1, 1]],
165
- [-1, 1, Conv, [256, 3, 1]],
166
- [-1, 1, Conv, [256, 3, 1]],
167
- [-1, 1, Conv, [256, 3, 1]],
168
- [-1, 1, Conv, [256, 3, 1]],
169
- [-1, 1, Conv, [256, 3, 1]],
170
- [-1, 1, Conv, [256, 3, 1]],
171
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
172
- [-1, 1, Conv, [640, 1, 1]], # 135
173
-
174
- [99, 1, Conv, [320, 3, 1]],
175
- [111, 1, Conv, [640, 3, 1]],
176
- [123, 1, Conv, [960, 3, 1]],
177
- [135, 1, Conv, [1280, 3, 1]],
178
-
179
- [99, 1, Conv, [320, 3, 1]],
180
- [85, 1, Conv, [640, 3, 1]],
181
- [71, 1, Conv, [960, 3, 1]],
182
- [57, 1, Conv, [1280, 3, 1]],
183
-
184
- [[136,137,138,139,140,141,142,143], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
185
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7-e6e.yaml DELETED
@@ -1,306 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7 backbone
14
- backbone:
15
- # [from, number, module, args],
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [80, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, DownC, [160]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
29
- [-1, 1, Conv, [160, 1, 1]], # 12
30
- [-11, 1, Conv, [64, 1, 1]],
31
- [-12, 1, Conv, [64, 1, 1]],
32
- [-1, 1, Conv, [64, 3, 1]],
33
- [-1, 1, Conv, [64, 3, 1]],
34
- [-1, 1, Conv, [64, 3, 1]],
35
- [-1, 1, Conv, [64, 3, 1]],
36
- [-1, 1, Conv, [64, 3, 1]],
37
- [-1, 1, Conv, [64, 3, 1]],
38
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
39
- [-1, 1, Conv, [160, 1, 1]], # 22
40
- [[-1, -11], 1, Shortcut, [1]], # 23
41
-
42
- [-1, 1, DownC, [320]], # 24-P3/8
43
- [-1, 1, Conv, [128, 1, 1]],
44
- [-2, 1, Conv, [128, 1, 1]],
45
- [-1, 1, Conv, [128, 3, 1]],
46
- [-1, 1, Conv, [128, 3, 1]],
47
- [-1, 1, Conv, [128, 3, 1]],
48
- [-1, 1, Conv, [128, 3, 1]],
49
- [-1, 1, Conv, [128, 3, 1]],
50
- [-1, 1, Conv, [128, 3, 1]],
51
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
52
- [-1, 1, Conv, [320, 1, 1]], # 34
53
- [-11, 1, Conv, [128, 1, 1]],
54
- [-12, 1, Conv, [128, 1, 1]],
55
- [-1, 1, Conv, [128, 3, 1]],
56
- [-1, 1, Conv, [128, 3, 1]],
57
- [-1, 1, Conv, [128, 3, 1]],
58
- [-1, 1, Conv, [128, 3, 1]],
59
- [-1, 1, Conv, [128, 3, 1]],
60
- [-1, 1, Conv, [128, 3, 1]],
61
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
62
- [-1, 1, Conv, [320, 1, 1]], # 44
63
- [[-1, -11], 1, Shortcut, [1]], # 45
64
-
65
- [-1, 1, DownC, [640]], # 46-P4/16
66
- [-1, 1, Conv, [256, 1, 1]],
67
- [-2, 1, Conv, [256, 1, 1]],
68
- [-1, 1, Conv, [256, 3, 1]],
69
- [-1, 1, Conv, [256, 3, 1]],
70
- [-1, 1, Conv, [256, 3, 1]],
71
- [-1, 1, Conv, [256, 3, 1]],
72
- [-1, 1, Conv, [256, 3, 1]],
73
- [-1, 1, Conv, [256, 3, 1]],
74
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
75
- [-1, 1, Conv, [640, 1, 1]], # 56
76
- [-11, 1, Conv, [256, 1, 1]],
77
- [-12, 1, Conv, [256, 1, 1]],
78
- [-1, 1, Conv, [256, 3, 1]],
79
- [-1, 1, Conv, [256, 3, 1]],
80
- [-1, 1, Conv, [256, 3, 1]],
81
- [-1, 1, Conv, [256, 3, 1]],
82
- [-1, 1, Conv, [256, 3, 1]],
83
- [-1, 1, Conv, [256, 3, 1]],
84
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
85
- [-1, 1, Conv, [640, 1, 1]], # 66
86
- [[-1, -11], 1, Shortcut, [1]], # 67
87
-
88
- [-1, 1, DownC, [960]], # 68-P5/32
89
- [-1, 1, Conv, [384, 1, 1]],
90
- [-2, 1, Conv, [384, 1, 1]],
91
- [-1, 1, Conv, [384, 3, 1]],
92
- [-1, 1, Conv, [384, 3, 1]],
93
- [-1, 1, Conv, [384, 3, 1]],
94
- [-1, 1, Conv, [384, 3, 1]],
95
- [-1, 1, Conv, [384, 3, 1]],
96
- [-1, 1, Conv, [384, 3, 1]],
97
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
98
- [-1, 1, Conv, [960, 1, 1]], # 78
99
- [-11, 1, Conv, [384, 1, 1]],
100
- [-12, 1, Conv, [384, 1, 1]],
101
- [-1, 1, Conv, [384, 3, 1]],
102
- [-1, 1, Conv, [384, 3, 1]],
103
- [-1, 1, Conv, [384, 3, 1]],
104
- [-1, 1, Conv, [384, 3, 1]],
105
- [-1, 1, Conv, [384, 3, 1]],
106
- [-1, 1, Conv, [384, 3, 1]],
107
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
108
- [-1, 1, Conv, [960, 1, 1]], # 88
109
- [[-1, -11], 1, Shortcut, [1]], # 89
110
-
111
- [-1, 1, DownC, [1280]], # 90-P6/64
112
- [-1, 1, Conv, [512, 1, 1]],
113
- [-2, 1, Conv, [512, 1, 1]],
114
- [-1, 1, Conv, [512, 3, 1]],
115
- [-1, 1, Conv, [512, 3, 1]],
116
- [-1, 1, Conv, [512, 3, 1]],
117
- [-1, 1, Conv, [512, 3, 1]],
118
- [-1, 1, Conv, [512, 3, 1]],
119
- [-1, 1, Conv, [512, 3, 1]],
120
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
121
- [-1, 1, Conv, [1280, 1, 1]], # 100
122
- [-11, 1, Conv, [512, 1, 1]],
123
- [-12, 1, Conv, [512, 1, 1]],
124
- [-1, 1, Conv, [512, 3, 1]],
125
- [-1, 1, Conv, [512, 3, 1]],
126
- [-1, 1, Conv, [512, 3, 1]],
127
- [-1, 1, Conv, [512, 3, 1]],
128
- [-1, 1, Conv, [512, 3, 1]],
129
- [-1, 1, Conv, [512, 3, 1]],
130
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
131
- [-1, 1, Conv, [1280, 1, 1]], # 110
132
- [[-1, -11], 1, Shortcut, [1]], # 111
133
- ]
134
-
135
- # yolov7 head
136
- head:
137
- [[-1, 1, SPPCSPC, [640]], # 112
138
-
139
- [-1, 1, Conv, [480, 1, 1]],
140
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
141
- [89, 1, Conv, [480, 1, 1]], # route backbone P5
142
- [[-1, -2], 1, Concat, [1]],
143
-
144
- [-1, 1, Conv, [384, 1, 1]],
145
- [-2, 1, Conv, [384, 1, 1]],
146
- [-1, 1, Conv, [192, 3, 1]],
147
- [-1, 1, Conv, [192, 3, 1]],
148
- [-1, 1, Conv, [192, 3, 1]],
149
- [-1, 1, Conv, [192, 3, 1]],
150
- [-1, 1, Conv, [192, 3, 1]],
151
- [-1, 1, Conv, [192, 3, 1]],
152
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
153
- [-1, 1, Conv, [480, 1, 1]], # 126
154
- [-11, 1, Conv, [384, 1, 1]],
155
- [-12, 1, Conv, [384, 1, 1]],
156
- [-1, 1, Conv, [192, 3, 1]],
157
- [-1, 1, Conv, [192, 3, 1]],
158
- [-1, 1, Conv, [192, 3, 1]],
159
- [-1, 1, Conv, [192, 3, 1]],
160
- [-1, 1, Conv, [192, 3, 1]],
161
- [-1, 1, Conv, [192, 3, 1]],
162
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
163
- [-1, 1, Conv, [480, 1, 1]], # 136
164
- [[-1, -11], 1, Shortcut, [1]], # 137
165
-
166
- [-1, 1, Conv, [320, 1, 1]],
167
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
168
- [67, 1, Conv, [320, 1, 1]], # route backbone P4
169
- [[-1, -2], 1, Concat, [1]],
170
-
171
- [-1, 1, Conv, [256, 1, 1]],
172
- [-2, 1, Conv, [256, 1, 1]],
173
- [-1, 1, Conv, [128, 3, 1]],
174
- [-1, 1, Conv, [128, 3, 1]],
175
- [-1, 1, Conv, [128, 3, 1]],
176
- [-1, 1, Conv, [128, 3, 1]],
177
- [-1, 1, Conv, [128, 3, 1]],
178
- [-1, 1, Conv, [128, 3, 1]],
179
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
180
- [-1, 1, Conv, [320, 1, 1]], # 151
181
- [-11, 1, Conv, [256, 1, 1]],
182
- [-12, 1, Conv, [256, 1, 1]],
183
- [-1, 1, Conv, [128, 3, 1]],
184
- [-1, 1, Conv, [128, 3, 1]],
185
- [-1, 1, Conv, [128, 3, 1]],
186
- [-1, 1, Conv, [128, 3, 1]],
187
- [-1, 1, Conv, [128, 3, 1]],
188
- [-1, 1, Conv, [128, 3, 1]],
189
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
190
- [-1, 1, Conv, [320, 1, 1]], # 161
191
- [[-1, -11], 1, Shortcut, [1]], # 162
192
-
193
- [-1, 1, Conv, [160, 1, 1]],
194
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
195
- [45, 1, Conv, [160, 1, 1]], # route backbone P3
196
- [[-1, -2], 1, Concat, [1]],
197
-
198
- [-1, 1, Conv, [128, 1, 1]],
199
- [-2, 1, Conv, [128, 1, 1]],
200
- [-1, 1, Conv, [64, 3, 1]],
201
- [-1, 1, Conv, [64, 3, 1]],
202
- [-1, 1, Conv, [64, 3, 1]],
203
- [-1, 1, Conv, [64, 3, 1]],
204
- [-1, 1, Conv, [64, 3, 1]],
205
- [-1, 1, Conv, [64, 3, 1]],
206
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
207
- [-1, 1, Conv, [160, 1, 1]], # 176
208
- [-11, 1, Conv, [128, 1, 1]],
209
- [-12, 1, Conv, [128, 1, 1]],
210
- [-1, 1, Conv, [64, 3, 1]],
211
- [-1, 1, Conv, [64, 3, 1]],
212
- [-1, 1, Conv, [64, 3, 1]],
213
- [-1, 1, Conv, [64, 3, 1]],
214
- [-1, 1, Conv, [64, 3, 1]],
215
- [-1, 1, Conv, [64, 3, 1]],
216
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
217
- [-1, 1, Conv, [160, 1, 1]], # 186
218
- [[-1, -11], 1, Shortcut, [1]], # 187
219
-
220
- [-1, 1, DownC, [320]],
221
- [[-1, 162], 1, Concat, [1]],
222
-
223
- [-1, 1, Conv, [256, 1, 1]],
224
- [-2, 1, Conv, [256, 1, 1]],
225
- [-1, 1, Conv, [128, 3, 1]],
226
- [-1, 1, Conv, [128, 3, 1]],
227
- [-1, 1, Conv, [128, 3, 1]],
228
- [-1, 1, Conv, [128, 3, 1]],
229
- [-1, 1, Conv, [128, 3, 1]],
230
- [-1, 1, Conv, [128, 3, 1]],
231
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
232
- [-1, 1, Conv, [320, 1, 1]], # 199
233
- [-11, 1, Conv, [256, 1, 1]],
234
- [-12, 1, Conv, [256, 1, 1]],
235
- [-1, 1, Conv, [128, 3, 1]],
236
- [-1, 1, Conv, [128, 3, 1]],
237
- [-1, 1, Conv, [128, 3, 1]],
238
- [-1, 1, Conv, [128, 3, 1]],
239
- [-1, 1, Conv, [128, 3, 1]],
240
- [-1, 1, Conv, [128, 3, 1]],
241
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
242
- [-1, 1, Conv, [320, 1, 1]], # 209
243
- [[-1, -11], 1, Shortcut, [1]], # 210
244
-
245
- [-1, 1, DownC, [480]],
246
- [[-1, 137], 1, Concat, [1]],
247
-
248
- [-1, 1, Conv, [384, 1, 1]],
249
- [-2, 1, Conv, [384, 1, 1]],
250
- [-1, 1, Conv, [192, 3, 1]],
251
- [-1, 1, Conv, [192, 3, 1]],
252
- [-1, 1, Conv, [192, 3, 1]],
253
- [-1, 1, Conv, [192, 3, 1]],
254
- [-1, 1, Conv, [192, 3, 1]],
255
- [-1, 1, Conv, [192, 3, 1]],
256
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
257
- [-1, 1, Conv, [480, 1, 1]], # 222
258
- [-11, 1, Conv, [384, 1, 1]],
259
- [-12, 1, Conv, [384, 1, 1]],
260
- [-1, 1, Conv, [192, 3, 1]],
261
- [-1, 1, Conv, [192, 3, 1]],
262
- [-1, 1, Conv, [192, 3, 1]],
263
- [-1, 1, Conv, [192, 3, 1]],
264
- [-1, 1, Conv, [192, 3, 1]],
265
- [-1, 1, Conv, [192, 3, 1]],
266
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
267
- [-1, 1, Conv, [480, 1, 1]], # 232
268
- [[-1, -11], 1, Shortcut, [1]], # 233
269
-
270
- [-1, 1, DownC, [640]],
271
- [[-1, 112], 1, Concat, [1]],
272
-
273
- [-1, 1, Conv, [512, 1, 1]],
274
- [-2, 1, Conv, [512, 1, 1]],
275
- [-1, 1, Conv, [256, 3, 1]],
276
- [-1, 1, Conv, [256, 3, 1]],
277
- [-1, 1, Conv, [256, 3, 1]],
278
- [-1, 1, Conv, [256, 3, 1]],
279
- [-1, 1, Conv, [256, 3, 1]],
280
- [-1, 1, Conv, [256, 3, 1]],
281
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
282
- [-1, 1, Conv, [640, 1, 1]], # 245
283
- [-11, 1, Conv, [512, 1, 1]],
284
- [-12, 1, Conv, [512, 1, 1]],
285
- [-1, 1, Conv, [256, 3, 1]],
286
- [-1, 1, Conv, [256, 3, 1]],
287
- [-1, 1, Conv, [256, 3, 1]],
288
- [-1, 1, Conv, [256, 3, 1]],
289
- [-1, 1, Conv, [256, 3, 1]],
290
- [-1, 1, Conv, [256, 3, 1]],
291
- [[-1, -2, -3, -4, -5, -6, -7, -8], 1, Concat, [1]],
292
- [-1, 1, Conv, [640, 1, 1]], # 255
293
- [[-1, -11], 1, Shortcut, [1]], # 256
294
-
295
- [187, 1, Conv, [320, 3, 1]],
296
- [210, 1, Conv, [640, 3, 1]],
297
- [233, 1, Conv, [960, 3, 1]],
298
- [256, 1, Conv, [1280, 3, 1]],
299
-
300
- [186, 1, Conv, [320, 3, 1]],
301
- [161, 1, Conv, [640, 3, 1]],
302
- [136, 1, Conv, [960, 3, 1]],
303
- [112, 1, Conv, [1280, 3, 1]],
304
-
305
- [[257,258,259,260,261,262,263,264], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
306
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7-tiny.yaml DELETED
@@ -1,112 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [10,13, 16,30, 33,23] # P3/8
9
- - [30,61, 62,45, 59,119] # P4/16
10
- - [116,90, 156,198, 373,326] # P5/32
11
-
12
- # yolov7-tiny backbone
13
- backbone:
14
- # [from, number, module, args] c2, k=1, s=1, p=None, g=1, act=True
15
- [[-1, 1, Conv, [32, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 0-P1/2
16
-
17
- [-1, 1, Conv, [64, 3, 2, None, 1, nn.LeakyReLU(0.1)]], # 1-P2/4
18
-
19
- [-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
20
- [-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
21
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
22
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
23
- [[-1, -2, -3, -4], 1, Concat, [1]],
24
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 7
25
-
26
- [-1, 1, MP, []], # 8-P3/8
27
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
28
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
29
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
30
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
31
- [[-1, -2, -3, -4], 1, Concat, [1]],
32
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 14
33
-
34
- [-1, 1, MP, []], # 15-P4/16
35
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
36
- [-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
37
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
38
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
39
- [[-1, -2, -3, -4], 1, Concat, [1]],
40
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 21
41
-
42
- [-1, 1, MP, []], # 22-P5/32
43
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
44
- [-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
45
- [-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
46
- [-1, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
47
- [[-1, -2, -3, -4], 1, Concat, [1]],
48
- [-1, 1, Conv, [512, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 28
49
- ]
50
-
51
- # yolov7-tiny head
52
- head:
53
- [[-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
54
- [-2, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
55
- [-1, 1, SP, [5]],
56
- [-2, 1, SP, [9]],
57
- [-3, 1, SP, [13]],
58
- [[-1, -2, -3, -4], 1, Concat, [1]],
59
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
60
- [[-1, -7], 1, Concat, [1]],
61
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 37
62
-
63
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
64
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
65
- [21, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P4
66
- [[-1, -2], 1, Concat, [1]],
67
-
68
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
69
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
70
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
71
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
72
- [[-1, -2, -3, -4], 1, Concat, [1]],
73
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 47
74
-
75
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
76
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
77
- [14, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # route backbone P3
78
- [[-1, -2], 1, Concat, [1]],
79
-
80
- [-1, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
81
- [-2, 1, Conv, [32, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
82
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
83
- [-1, 1, Conv, [32, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
84
- [[-1, -2, -3, -4], 1, Concat, [1]],
85
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 57
86
-
87
- [-1, 1, Conv, [128, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
88
- [[-1, 47], 1, Concat, [1]],
89
-
90
- [-1, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
91
- [-2, 1, Conv, [64, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
92
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
93
- [-1, 1, Conv, [64, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
94
- [[-1, -2, -3, -4], 1, Concat, [1]],
95
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 65
96
-
97
- [-1, 1, Conv, [256, 3, 2, None, 1, nn.LeakyReLU(0.1)]],
98
- [[-1, 37], 1, Concat, [1]],
99
-
100
- [-1, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
101
- [-2, 1, Conv, [128, 1, 1, None, 1, nn.LeakyReLU(0.1)]],
102
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
103
- [-1, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
104
- [[-1, -2, -3, -4], 1, Concat, [1]],
105
- [-1, 1, Conv, [256, 1, 1, None, 1, nn.LeakyReLU(0.1)]], # 73
106
-
107
- [57, 1, Conv, [128, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
108
- [65, 1, Conv, [256, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
109
- [73, 1, Conv, [512, 3, 1, None, 1, nn.LeakyReLU(0.1)]],
110
-
111
- [[74,75,76], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
112
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7-w6.yaml DELETED
@@ -1,163 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [ 19,27, 44,40, 38,94 ] # P3/8
9
- - [ 96,68, 86,152, 180,137 ] # P4/16
10
- - [ 140,301, 303,264, 238,542 ] # P5/32
11
- - [ 436,615, 739,380, 925,792 ] # P6/64
12
-
13
- # yolov7 backbone
14
- backbone:
15
- # [from, number, module, args]
16
- [[-1, 1, ReOrg, []], # 0
17
- [-1, 1, Conv, [64, 3, 1]], # 1-P1/2
18
-
19
- [-1, 1, Conv, [128, 3, 2]], # 2-P2/4
20
- [-1, 1, Conv, [64, 1, 1]],
21
- [-2, 1, Conv, [64, 1, 1]],
22
- [-1, 1, Conv, [64, 3, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [[-1, -3, -5, -6], 1, Concat, [1]],
27
- [-1, 1, Conv, [128, 1, 1]], # 10
28
-
29
- [-1, 1, Conv, [256, 3, 2]], # 11-P3/8
30
- [-1, 1, Conv, [128, 1, 1]],
31
- [-2, 1, Conv, [128, 1, 1]],
32
- [-1, 1, Conv, [128, 3, 1]],
33
- [-1, 1, Conv, [128, 3, 1]],
34
- [-1, 1, Conv, [128, 3, 1]],
35
- [-1, 1, Conv, [128, 3, 1]],
36
- [[-1, -3, -5, -6], 1, Concat, [1]],
37
- [-1, 1, Conv, [256, 1, 1]], # 19
38
-
39
- [-1, 1, Conv, [512, 3, 2]], # 20-P4/16
40
- [-1, 1, Conv, [256, 1, 1]],
41
- [-2, 1, Conv, [256, 1, 1]],
42
- [-1, 1, Conv, [256, 3, 1]],
43
- [-1, 1, Conv, [256, 3, 1]],
44
- [-1, 1, Conv, [256, 3, 1]],
45
- [-1, 1, Conv, [256, 3, 1]],
46
- [[-1, -3, -5, -6], 1, Concat, [1]],
47
- [-1, 1, Conv, [512, 1, 1]], # 28
48
-
49
- [-1, 1, Conv, [768, 3, 2]], # 29-P5/32
50
- [-1, 1, Conv, [384, 1, 1]],
51
- [-2, 1, Conv, [384, 1, 1]],
52
- [-1, 1, Conv, [384, 3, 1]],
53
- [-1, 1, Conv, [384, 3, 1]],
54
- [-1, 1, Conv, [384, 3, 1]],
55
- [-1, 1, Conv, [384, 3, 1]],
56
- [[-1, -3, -5, -6], 1, Concat, [1]],
57
- [-1, 1, Conv, [768, 1, 1]], # 37
58
-
59
- [-1, 1, Conv, [1024, 3, 2]], # 38-P6/64
60
- [-1, 1, Conv, [512, 1, 1]],
61
- [-2, 1, Conv, [512, 1, 1]],
62
- [-1, 1, Conv, [512, 3, 1]],
63
- [-1, 1, Conv, [512, 3, 1]],
64
- [-1, 1, Conv, [512, 3, 1]],
65
- [-1, 1, Conv, [512, 3, 1]],
66
- [[-1, -3, -5, -6], 1, Concat, [1]],
67
- [-1, 1, Conv, [1024, 1, 1]], # 46
68
- ]
69
-
70
- # yolov7 head
71
- head:
72
- [[-1, 1, SPPCSPC, [512]], # 47
73
-
74
- [-1, 1, Conv, [384, 1, 1]],
75
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
76
- [37, 1, Conv, [384, 1, 1]], # route backbone P5
77
- [[-1, -2], 1, Concat, [1]],
78
-
79
- [-1, 1, Conv, [384, 1, 1]],
80
- [-2, 1, Conv, [384, 1, 1]],
81
- [-1, 1, Conv, [192, 3, 1]],
82
- [-1, 1, Conv, [192, 3, 1]],
83
- [-1, 1, Conv, [192, 3, 1]],
84
- [-1, 1, Conv, [192, 3, 1]],
85
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
86
- [-1, 1, Conv, [384, 1, 1]], # 59
87
-
88
- [-1, 1, Conv, [256, 1, 1]],
89
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
90
- [28, 1, Conv, [256, 1, 1]], # route backbone P4
91
- [[-1, -2], 1, Concat, [1]],
92
-
93
- [-1, 1, Conv, [256, 1, 1]],
94
- [-2, 1, Conv, [256, 1, 1]],
95
- [-1, 1, Conv, [128, 3, 1]],
96
- [-1, 1, Conv, [128, 3, 1]],
97
- [-1, 1, Conv, [128, 3, 1]],
98
- [-1, 1, Conv, [128, 3, 1]],
99
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
100
- [-1, 1, Conv, [256, 1, 1]], # 71
101
-
102
- [-1, 1, Conv, [128, 1, 1]],
103
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
104
- [19, 1, Conv, [128, 1, 1]], # route backbone P3
105
- [[-1, -2], 1, Concat, [1]],
106
-
107
- [-1, 1, Conv, [128, 1, 1]],
108
- [-2, 1, Conv, [128, 1, 1]],
109
- [-1, 1, Conv, [64, 3, 1]],
110
- [-1, 1, Conv, [64, 3, 1]],
111
- [-1, 1, Conv, [64, 3, 1]],
112
- [-1, 1, Conv, [64, 3, 1]],
113
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
114
- [-1, 1, Conv, [128, 1, 1]], # 83
115
-
116
- [-1, 1, Conv, [256, 3, 2]],
117
- [[-1, 71], 1, Concat, [1]], # cat
118
-
119
- [-1, 1, Conv, [256, 1, 1]],
120
- [-2, 1, Conv, [256, 1, 1]],
121
- [-1, 1, Conv, [128, 3, 1]],
122
- [-1, 1, Conv, [128, 3, 1]],
123
- [-1, 1, Conv, [128, 3, 1]],
124
- [-1, 1, Conv, [128, 3, 1]],
125
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
126
- [-1, 1, Conv, [256, 1, 1]], # 93
127
-
128
- [-1, 1, Conv, [384, 3, 2]],
129
- [[-1, 59], 1, Concat, [1]], # cat
130
-
131
- [-1, 1, Conv, [384, 1, 1]],
132
- [-2, 1, Conv, [384, 1, 1]],
133
- [-1, 1, Conv, [192, 3, 1]],
134
- [-1, 1, Conv, [192, 3, 1]],
135
- [-1, 1, Conv, [192, 3, 1]],
136
- [-1, 1, Conv, [192, 3, 1]],
137
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
138
- [-1, 1, Conv, [384, 1, 1]], # 103
139
-
140
- [-1, 1, Conv, [512, 3, 2]],
141
- [[-1, 47], 1, Concat, [1]], # cat
142
-
143
- [-1, 1, Conv, [512, 1, 1]],
144
- [-2, 1, Conv, [512, 1, 1]],
145
- [-1, 1, Conv, [256, 3, 1]],
146
- [-1, 1, Conv, [256, 3, 1]],
147
- [-1, 1, Conv, [256, 3, 1]],
148
- [-1, 1, Conv, [256, 3, 1]],
149
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
150
- [-1, 1, Conv, [512, 1, 1]], # 113
151
-
152
- [83, 1, Conv, [256, 3, 1]],
153
- [93, 1, Conv, [512, 3, 1]],
154
- [103, 1, Conv, [768, 3, 1]],
155
- [113, 1, Conv, [1024, 3, 1]],
156
-
157
- [83, 1, Conv, [320, 3, 1]],
158
- [71, 1, Conv, [640, 3, 1]],
159
- [59, 1, Conv, [960, 3, 1]],
160
- [47, 1, Conv, [1280, 3, 1]],
161
-
162
- [[114,115,116,117,118,119,120,121], 1, IAuxDetect, [nc, anchors]], # Detect(P3, P4, P5, P6)
163
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7.yaml DELETED
@@ -1,140 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # yolov7 backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [32, 3, 1]], # 0
16
-
17
- [-1, 1, Conv, [64, 3, 2]], # 1-P1/2
18
- [-1, 1, Conv, [64, 3, 1]],
19
-
20
- [-1, 1, Conv, [128, 3, 2]], # 3-P2/4
21
- [-1, 1, Conv, [64, 1, 1]],
22
- [-2, 1, Conv, [64, 1, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [[-1, -3, -5, -6], 1, Concat, [1]],
28
- [-1, 1, Conv, [256, 1, 1]], # 11
29
-
30
- [-1, 1, MP, []],
31
- [-1, 1, Conv, [128, 1, 1]],
32
- [-3, 1, Conv, [128, 1, 1]],
33
- [-1, 1, Conv, [128, 3, 2]],
34
- [[-1, -3], 1, Concat, [1]], # 16-P3/8
35
- [-1, 1, Conv, [128, 1, 1]],
36
- [-2, 1, Conv, [128, 1, 1]],
37
- [-1, 1, Conv, [128, 3, 1]],
38
- [-1, 1, Conv, [128, 3, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [[-1, -3, -5, -6], 1, Concat, [1]],
42
- [-1, 1, Conv, [512, 1, 1]], # 24
43
-
44
- [-1, 1, MP, []],
45
- [-1, 1, Conv, [256, 1, 1]],
46
- [-3, 1, Conv, [256, 1, 1]],
47
- [-1, 1, Conv, [256, 3, 2]],
48
- [[-1, -3], 1, Concat, [1]], # 29-P4/16
49
- [-1, 1, Conv, [256, 1, 1]],
50
- [-2, 1, Conv, [256, 1, 1]],
51
- [-1, 1, Conv, [256, 3, 1]],
52
- [-1, 1, Conv, [256, 3, 1]],
53
- [-1, 1, Conv, [256, 3, 1]],
54
- [-1, 1, Conv, [256, 3, 1]],
55
- [[-1, -3, -5, -6], 1, Concat, [1]],
56
- [-1, 1, Conv, [1024, 1, 1]], # 37
57
-
58
- [-1, 1, MP, []],
59
- [-1, 1, Conv, [512, 1, 1]],
60
- [-3, 1, Conv, [512, 1, 1]],
61
- [-1, 1, Conv, [512, 3, 2]],
62
- [[-1, -3], 1, Concat, [1]], # 42-P5/32
63
- [-1, 1, Conv, [256, 1, 1]],
64
- [-2, 1, Conv, [256, 1, 1]],
65
- [-1, 1, Conv, [256, 3, 1]],
66
- [-1, 1, Conv, [256, 3, 1]],
67
- [-1, 1, Conv, [256, 3, 1]],
68
- [-1, 1, Conv, [256, 3, 1]],
69
- [[-1, -3, -5, -6], 1, Concat, [1]],
70
- [-1, 1, Conv, [1024, 1, 1]], # 50
71
- ]
72
-
73
- # yolov7 head
74
- head:
75
- [[-1, 1, SPPCSPC, [512]], # 51
76
-
77
- [-1, 1, Conv, [256, 1, 1]],
78
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
79
- [37, 1, Conv, [256, 1, 1]], # route backbone P4
80
- [[-1, -2], 1, Concat, [1]],
81
-
82
- [-1, 1, Conv, [256, 1, 1]],
83
- [-2, 1, Conv, [256, 1, 1]],
84
- [-1, 1, Conv, [128, 3, 1]],
85
- [-1, 1, Conv, [128, 3, 1]],
86
- [-1, 1, Conv, [128, 3, 1]],
87
- [-1, 1, Conv, [128, 3, 1]],
88
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
89
- [-1, 1, Conv, [256, 1, 1]], # 63
90
-
91
- [-1, 1, Conv, [128, 1, 1]],
92
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
93
- [24, 1, Conv, [128, 1, 1]], # route backbone P3
94
- [[-1, -2], 1, Concat, [1]],
95
-
96
- [-1, 1, Conv, [128, 1, 1]],
97
- [-2, 1, Conv, [128, 1, 1]],
98
- [-1, 1, Conv, [64, 3, 1]],
99
- [-1, 1, Conv, [64, 3, 1]],
100
- [-1, 1, Conv, [64, 3, 1]],
101
- [-1, 1, Conv, [64, 3, 1]],
102
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
103
- [-1, 1, Conv, [128, 1, 1]], # 75
104
-
105
- [-1, 1, MP, []],
106
- [-1, 1, Conv, [128, 1, 1]],
107
- [-3, 1, Conv, [128, 1, 1]],
108
- [-1, 1, Conv, [128, 3, 2]],
109
- [[-1, -3, 63], 1, Concat, [1]],
110
-
111
- [-1, 1, Conv, [256, 1, 1]],
112
- [-2, 1, Conv, [256, 1, 1]],
113
- [-1, 1, Conv, [128, 3, 1]],
114
- [-1, 1, Conv, [128, 3, 1]],
115
- [-1, 1, Conv, [128, 3, 1]],
116
- [-1, 1, Conv, [128, 3, 1]],
117
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
118
- [-1, 1, Conv, [256, 1, 1]], # 88
119
-
120
- [-1, 1, MP, []],
121
- [-1, 1, Conv, [256, 1, 1]],
122
- [-3, 1, Conv, [256, 1, 1]],
123
- [-1, 1, Conv, [256, 3, 2]],
124
- [[-1, -3, 51], 1, Concat, [1]],
125
-
126
- [-1, 1, Conv, [512, 1, 1]],
127
- [-2, 1, Conv, [512, 1, 1]],
128
- [-1, 1, Conv, [256, 3, 1]],
129
- [-1, 1, Conv, [256, 3, 1]],
130
- [-1, 1, Conv, [256, 3, 1]],
131
- [-1, 1, Conv, [256, 3, 1]],
132
- [[-1, -2, -3, -4, -5, -6], 1, Concat, [1]],
133
- [-1, 1, Conv, [512, 1, 1]], # 101
134
-
135
- [75, 1, RepConv, [256, 3, 1]],
136
- [88, 1, RepConv, [512, 3, 1]],
137
- [101, 1, RepConv, [1024, 3, 1]],
138
-
139
- [[102,103,104], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
140
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cfg/training/yolov7x.yaml DELETED
@@ -1,156 +0,0 @@
1
- # parameters
2
- nc: 80 # number of classes
3
- depth_multiple: 1.0 # model depth multiple
4
- width_multiple: 1.0 # layer channel multiple
5
-
6
- # anchors
7
- anchors:
8
- - [12,16, 19,36, 40,28] # P3/8
9
- - [36,75, 76,55, 72,146] # P4/16
10
- - [142,110, 192,243, 459,401] # P5/32
11
-
12
- # yolov7 backbone
13
- backbone:
14
- # [from, number, module, args]
15
- [[-1, 1, Conv, [40, 3, 1]], # 0
16
-
17
- [-1, 1, Conv, [80, 3, 2]], # 1-P1/2
18
- [-1, 1, Conv, [80, 3, 1]],
19
-
20
- [-1, 1, Conv, [160, 3, 2]], # 3-P2/4
21
- [-1, 1, Conv, [64, 1, 1]],
22
- [-2, 1, Conv, [64, 1, 1]],
23
- [-1, 1, Conv, [64, 3, 1]],
24
- [-1, 1, Conv, [64, 3, 1]],
25
- [-1, 1, Conv, [64, 3, 1]],
26
- [-1, 1, Conv, [64, 3, 1]],
27
- [-1, 1, Conv, [64, 3, 1]],
28
- [-1, 1, Conv, [64, 3, 1]],
29
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
30
- [-1, 1, Conv, [320, 1, 1]], # 13
31
-
32
- [-1, 1, MP, []],
33
- [-1, 1, Conv, [160, 1, 1]],
34
- [-3, 1, Conv, [160, 1, 1]],
35
- [-1, 1, Conv, [160, 3, 2]],
36
- [[-1, -3], 1, Concat, [1]], # 18-P3/8
37
- [-1, 1, Conv, [128, 1, 1]],
38
- [-2, 1, Conv, [128, 1, 1]],
39
- [-1, 1, Conv, [128, 3, 1]],
40
- [-1, 1, Conv, [128, 3, 1]],
41
- [-1, 1, Conv, [128, 3, 1]],
42
- [-1, 1, Conv, [128, 3, 1]],
43
- [-1, 1, Conv, [128, 3, 1]],
44
- [-1, 1, Conv, [128, 3, 1]],
45
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
46
- [-1, 1, Conv, [640, 1, 1]], # 28
47
-
48
- [-1, 1, MP, []],
49
- [-1, 1, Conv, [320, 1, 1]],
50
- [-3, 1, Conv, [320, 1, 1]],
51
- [-1, 1, Conv, [320, 3, 2]],
52
- [[-1, -3], 1, Concat, [1]], # 33-P4/16
53
- [-1, 1, Conv, [256, 1, 1]],
54
- [-2, 1, Conv, [256, 1, 1]],
55
- [-1, 1, Conv, [256, 3, 1]],
56
- [-1, 1, Conv, [256, 3, 1]],
57
- [-1, 1, Conv, [256, 3, 1]],
58
- [-1, 1, Conv, [256, 3, 1]],
59
- [-1, 1, Conv, [256, 3, 1]],
60
- [-1, 1, Conv, [256, 3, 1]],
61
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
62
- [-1, 1, Conv, [1280, 1, 1]], # 43
63
-
64
- [-1, 1, MP, []],
65
- [-1, 1, Conv, [640, 1, 1]],
66
- [-3, 1, Conv, [640, 1, 1]],
67
- [-1, 1, Conv, [640, 3, 2]],
68
- [[-1, -3], 1, Concat, [1]], # 48-P5/32
69
- [-1, 1, Conv, [256, 1, 1]],
70
- [-2, 1, Conv, [256, 1, 1]],
71
- [-1, 1, Conv, [256, 3, 1]],
72
- [-1, 1, Conv, [256, 3, 1]],
73
- [-1, 1, Conv, [256, 3, 1]],
74
- [-1, 1, Conv, [256, 3, 1]],
75
- [-1, 1, Conv, [256, 3, 1]],
76
- [-1, 1, Conv, [256, 3, 1]],
77
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
78
- [-1, 1, Conv, [1280, 1, 1]], # 58
79
- ]
80
-
81
- # yolov7 head
82
- head:
83
- [[-1, 1, SPPCSPC, [640]], # 59
84
-
85
- [-1, 1, Conv, [320, 1, 1]],
86
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
87
- [43, 1, Conv, [320, 1, 1]], # route backbone P4
88
- [[-1, -2], 1, Concat, [1]],
89
-
90
- [-1, 1, Conv, [256, 1, 1]],
91
- [-2, 1, Conv, [256, 1, 1]],
92
- [-1, 1, Conv, [256, 3, 1]],
93
- [-1, 1, Conv, [256, 3, 1]],
94
- [-1, 1, Conv, [256, 3, 1]],
95
- [-1, 1, Conv, [256, 3, 1]],
96
- [-1, 1, Conv, [256, 3, 1]],
97
- [-1, 1, Conv, [256, 3, 1]],
98
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
99
- [-1, 1, Conv, [320, 1, 1]], # 73
100
-
101
- [-1, 1, Conv, [160, 1, 1]],
102
- [-1, 1, nn.Upsample, [None, 2, 'nearest']],
103
- [28, 1, Conv, [160, 1, 1]], # route backbone P3
104
- [[-1, -2], 1, Concat, [1]],
105
-
106
- [-1, 1, Conv, [128, 1, 1]],
107
- [-2, 1, Conv, [128, 1, 1]],
108
- [-1, 1, Conv, [128, 3, 1]],
109
- [-1, 1, Conv, [128, 3, 1]],
110
- [-1, 1, Conv, [128, 3, 1]],
111
- [-1, 1, Conv, [128, 3, 1]],
112
- [-1, 1, Conv, [128, 3, 1]],
113
- [-1, 1, Conv, [128, 3, 1]],
114
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
115
- [-1, 1, Conv, [160, 1, 1]], # 87
116
-
117
- [-1, 1, MP, []],
118
- [-1, 1, Conv, [160, 1, 1]],
119
- [-3, 1, Conv, [160, 1, 1]],
120
- [-1, 1, Conv, [160, 3, 2]],
121
- [[-1, -3, 73], 1, Concat, [1]],
122
-
123
- [-1, 1, Conv, [256, 1, 1]],
124
- [-2, 1, Conv, [256, 1, 1]],
125
- [-1, 1, Conv, [256, 3, 1]],
126
- [-1, 1, Conv, [256, 3, 1]],
127
- [-1, 1, Conv, [256, 3, 1]],
128
- [-1, 1, Conv, [256, 3, 1]],
129
- [-1, 1, Conv, [256, 3, 1]],
130
- [-1, 1, Conv, [256, 3, 1]],
131
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
132
- [-1, 1, Conv, [320, 1, 1]], # 102
133
-
134
- [-1, 1, MP, []],
135
- [-1, 1, Conv, [320, 1, 1]],
136
- [-3, 1, Conv, [320, 1, 1]],
137
- [-1, 1, Conv, [320, 3, 2]],
138
- [[-1, -3, 59], 1, Concat, [1]],
139
-
140
- [-1, 1, Conv, [512, 1, 1]],
141
- [-2, 1, Conv, [512, 1, 1]],
142
- [-1, 1, Conv, [512, 3, 1]],
143
- [-1, 1, Conv, [512, 3, 1]],
144
- [-1, 1, Conv, [512, 3, 1]],
145
- [-1, 1, Conv, [512, 3, 1]],
146
- [-1, 1, Conv, [512, 3, 1]],
147
- [-1, 1, Conv, [512, 3, 1]],
148
- [[-1, -3, -5, -7, -8], 1, Concat, [1]],
149
- [-1, 1, Conv, [640, 1, 1]], # 117
150
-
151
- [87, 1, Conv, [320, 3, 1]],
152
- [102, 1, Conv, [640, 3, 1]],
153
- [117, 1, Conv, [1280, 3, 1]],
154
-
155
- [[118,119,120], 1, IDetect, [nc, anchors]], # Detect(P3, P4, P5)
156
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Usage: pip install -r requirements.txt
2
+
3
+ # Base ----------------------------------------
4
+ matplotlib>=3.2.2
5
+ numpy>=1.18.5
6
+ opencv-python>=4.1.1
7
+ Pillow>=7.1.2
8
+ PyYAML>=5.3.1
9
+ requests>=2.23.0
10
+ scipy>=1.4.1
11
+ torch>=1.7.0,!=1.12.0
12
+ torchvision>=0.8.1,!=0.13.0
13
+ tqdm>=4.41.0
14
+ protobuf<4.21.3
15
+
16
+ # Logging -------------------------------------
17
+ tensorboard>=2.4.1
18
+ # wandb
19
+
20
+ # Plotting ------------------------------------
21
+ pandas>=1.1.4
22
+ seaborn>=0.11.0
23
+
24
+ # Export --------------------------------------
25
+ # coremltools>=4.1 # CoreML export
26
+ # onnx>=1.9.0 # ONNX export
27
+ # onnx-simplifier>=0.3.6 # ONNX simplifier
28
+ # scikit-learn==0.19.2 # CoreML quantization
29
+ # tensorflow>=2.4.1 # TFLite export
30
+ # tensorflowjs>=3.9.0 # TF.js export
31
+ # openvino-dev # OpenVINO export
32
+
33
+ # Extras --------------------------------------
34
+ ipython # interactive notebook
35
+ psutil # system utilization
36
+ thop # FLOPs computation
37
+ # albumentations>=1.0.3
38
+ # pycocotools>=2.0 # COCO mAP
39
+ # roboflow