Spaces:
Runtime error
Runtime error
Xu Ma
commited on
Commit
•
29a4916
1
Parent(s):
2488a15
update
Browse files- README.md +8 -6
- __init__.py +2 -0
- app.py +286 -116
- cls_name/cls_name.csv +80 -0
- cls_name/cls_name.yaml +7 -0
- icon/logo.ico +0 -0
- img_example/Millenial-at-work.jpg +0 -0
- img_example/bus.jpg +0 -0
- img_example/zidane.jpg +0 -0
- model_config/model_name_p5_all.csv +5 -0
- model_config/model_name_p5_all.yaml +1 -0
- model_config/model_name_p5_n.csv +1 -0
- model_config/model_name_p5_n.yaml +1 -0
- model_config/model_name_p6_all.csv +5 -0
- model_config/model_name_p6_all.yaml +1 -0
- model_download/yolov5_model_p5_all.sh +8 -0
- model_download/yolov5_model_p5_n.sh +4 -0
- model_download/yolov5_model_p6_all.sh +8 -0
- requirements.txt +35 -7
README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 2.9.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
license:
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Gradio_yolov5_det
|
3 |
+
emoji: 📊
|
4 |
+
colorFrom: pink
|
5 |
+
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 2.9.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
license: gpl-3.0
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
14 |
+
|
15 |
+
🚀 项目主页:https://gitee.com/CV_Lab/gradio_yolov5_det
|
__init__.py
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
__author__ = "Xu Ma"
|
2 |
+
__email__ = "[email protected]"
|
app.py
CHANGED
@@ -1,119 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import DPTFeatureExtractor, DPTForDepthEstimation
|
3 |
import torch
|
4 |
-
import
|
5 |
from PIL import Image
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Gradio YOLOv5 Det v0.1
|
2 |
+
# 创建人:曾逸夫
|
3 |
+
# 创建时间:2022-04-03
|
4 |
+
# email:[email protected]
|
5 |
+
# 项目主页:https://gitee.com/CV_Lab/gradio_yolov5_det
|
6 |
+
|
7 |
+
import argparse
|
8 |
+
import csv
|
9 |
+
import sys
|
10 |
+
from pathlib import Path
|
11 |
+
|
12 |
import gradio as gr
|
|
|
13 |
import torch
|
14 |
+
import yaml
|
15 |
from PIL import Image
|
16 |
+
|
17 |
+
ROOT_PATH = sys.path[0] # 根目录
|
18 |
+
|
19 |
+
# 模型路径
|
20 |
+
model_path = "ultralytics/yolov5"
|
21 |
+
|
22 |
+
|
23 |
+
# 模型名称临时变量
|
24 |
+
model_name_tmp = ""
|
25 |
+
|
26 |
+
# 设备临时变量
|
27 |
+
device_tmp = ""
|
28 |
+
|
29 |
+
# 文件后缀
|
30 |
+
suffix_list = [".csv", ".yaml"]
|
31 |
+
|
32 |
+
|
33 |
+
def parse_args(known=False):
|
34 |
+
parser = argparse.ArgumentParser(description="Gradio YOLOv5 Det v0.1")
|
35 |
+
parser.add_argument(
|
36 |
+
"--model_name", "-mn", default="yolov5s", type=str, help="model name"
|
37 |
+
)
|
38 |
+
parser.add_argument(
|
39 |
+
"--model_cfg",
|
40 |
+
"-mc",
|
41 |
+
default="./model_config/model_name_p5_all.yaml",
|
42 |
+
type=str,
|
43 |
+
help="model config",
|
44 |
+
)
|
45 |
+
parser.add_argument(
|
46 |
+
"--cls_name",
|
47 |
+
"-cls",
|
48 |
+
default="./cls_name/cls_name.yaml",
|
49 |
+
type=str,
|
50 |
+
help="cls name",
|
51 |
+
)
|
52 |
+
parser.add_argument(
|
53 |
+
"--nms_conf",
|
54 |
+
"-conf",
|
55 |
+
default=0.5,
|
56 |
+
type=float,
|
57 |
+
help="model NMS confidence threshold",
|
58 |
+
)
|
59 |
+
parser.add_argument(
|
60 |
+
"--nms_iou", "-iou", default=0.45, type=float, help="model NMS IoU threshold"
|
61 |
+
)
|
62 |
+
|
63 |
+
parser.add_argument(
|
64 |
+
"--label_dnt_show",
|
65 |
+
"-lds",
|
66 |
+
action="store_false",
|
67 |
+
default=True,
|
68 |
+
help="label show",
|
69 |
+
)
|
70 |
+
parser.add_argument(
|
71 |
+
"--device",
|
72 |
+
"-dev",
|
73 |
+
default="cpu",
|
74 |
+
type=str,
|
75 |
+
help="cuda or cpu, hugging face only cpu",
|
76 |
+
)
|
77 |
+
parser.add_argument(
|
78 |
+
"--inference_size", "-isz", default=640, type=int, help="model inference size"
|
79 |
+
)
|
80 |
+
|
81 |
+
args = parser.parse_known_args()[0] if known else parser.parse_args()
|
82 |
+
return args
|
83 |
+
|
84 |
+
|
85 |
+
# 模型加载
|
86 |
+
def model_loading(model_name, device):
|
87 |
+
|
88 |
+
# 加载本地模型
|
89 |
+
model = torch.hub.load(model_path, model_name, force_reload=True, device=device)
|
90 |
+
|
91 |
+
return model
|
92 |
+
|
93 |
+
|
94 |
+
# 检测信息
|
95 |
+
def export_json(results, model, img_size):
|
96 |
+
|
97 |
+
return [
|
98 |
+
[
|
99 |
+
{
|
100 |
+
"id": int(i),
|
101 |
+
"class": int(result[i][5]),
|
102 |
+
"class_name": model.model.names[int(result[i][5])],
|
103 |
+
"normalized_box": {
|
104 |
+
"x0": round(result[i][:4].tolist()[0], 6),
|
105 |
+
"y0": round(result[i][:4].tolist()[1], 6),
|
106 |
+
"x1": round(result[i][:4].tolist()[2], 6),
|
107 |
+
"y1": round(result[i][:4].tolist()[3], 6),
|
108 |
+
},
|
109 |
+
"confidence": round(float(result[i][4]), 2),
|
110 |
+
"fps": round(1000 / float(results.t[1]), 2),
|
111 |
+
"width": img_size[0],
|
112 |
+
"height": img_size[1],
|
113 |
+
}
|
114 |
+
for i in range(len(result))
|
115 |
+
]
|
116 |
+
for result in results.xyxyn
|
117 |
+
]
|
118 |
+
|
119 |
+
|
120 |
+
# YOLOv5图片检测函数
|
121 |
+
def yolo_det(img, device, model_name, inference_size, conf, iou, label_opt, model_cls):
|
122 |
+
|
123 |
+
global model, model_name_tmp, device_tmp
|
124 |
+
|
125 |
+
if model_name_tmp != model_name:
|
126 |
+
# 模型判断,避免反复加载
|
127 |
+
model_name_tmp = model_name
|
128 |
+
model = model_loading(model_name_tmp, device)
|
129 |
+
elif device_tmp != device:
|
130 |
+
device_tmp = device
|
131 |
+
model = model_loading(model_name_tmp, device)
|
132 |
+
|
133 |
+
# -----------模型调参-----------
|
134 |
+
model.conf = conf # NMS 置信度阈值
|
135 |
+
model.iou = iou # NMS IOU阈值
|
136 |
+
model.max_det = 1000 # 最大检测框数
|
137 |
+
model.classes = model_cls # 模型类别
|
138 |
+
|
139 |
+
results = model(img, size=inference_size) # 检测
|
140 |
+
results.render(labels=label_opt) # 渲染
|
141 |
+
|
142 |
+
det_img = Image.fromarray(results.imgs[0]) # 检测图片
|
143 |
+
|
144 |
+
det_json = export_json(results, model, img.size)[0] # 检测信息
|
145 |
+
|
146 |
+
return det_img, det_json
|
147 |
+
|
148 |
+
|
149 |
+
# yaml文件解析
|
150 |
+
def yaml_parse(file_path):
|
151 |
+
return yaml.safe_load(open(file_path, "r", encoding="utf-8").read())
|
152 |
+
|
153 |
+
|
154 |
+
# yaml csv 文件解析
|
155 |
+
def yaml_csv(file_path, file_tag):
|
156 |
+
file_suffix = Path(file_path).suffix
|
157 |
+
if file_suffix == suffix_list[0]:
|
158 |
+
# 模型名称
|
159 |
+
file_names = [i[0] for i in list(csv.reader(open(file_path)))] # csv版
|
160 |
+
elif file_suffix == suffix_list[1]:
|
161 |
+
# 模型名称
|
162 |
+
file_names = yaml_parse(file_path).get(file_tag) # yaml版
|
163 |
+
else:
|
164 |
+
print(f"{file_path}格式不正确!程序退出!")
|
165 |
+
sys.exit()
|
166 |
+
|
167 |
+
return file_names
|
168 |
+
|
169 |
+
|
170 |
+
def main(args):
|
171 |
+
gr.close_all()
|
172 |
+
|
173 |
+
global model
|
174 |
+
|
175 |
+
slider_step = 0.05 # 滑动步长
|
176 |
+
|
177 |
+
nms_conf = args.nms_conf
|
178 |
+
nms_iou = args.nms_iou
|
179 |
+
label_opt = args.label_dnt_show
|
180 |
+
model_name = args.model_name
|
181 |
+
model_cfg = args.model_cfg
|
182 |
+
cls_name = args.cls_name
|
183 |
+
device = args.device
|
184 |
+
inference_size = args.inference_size
|
185 |
+
|
186 |
+
# 模型加载
|
187 |
+
model = model_loading(model_name, device)
|
188 |
+
|
189 |
+
model_names = yaml_csv(model_cfg, "model_names")
|
190 |
+
model_cls_name = yaml_csv(cls_name, "model_cls_name")
|
191 |
+
|
192 |
+
# -------------------输入组件-------------------
|
193 |
+
inputs_img = gr.inputs.Image(type="pil", label="原始图片")
|
194 |
+
device = gr.inputs.Dropdown(
|
195 |
+
choices=["cpu"], default=device, type="value", label="设备"
|
196 |
+
)
|
197 |
+
inputs_model = gr.inputs.Dropdown(
|
198 |
+
choices=model_names, default=model_name, type="value", label="模型"
|
199 |
+
)
|
200 |
+
inputs_size = gr.inputs.Radio(
|
201 |
+
choices=[320, 640], default=inference_size, label="推理尺寸"
|
202 |
+
)
|
203 |
+
input_conf = gr.inputs.Slider(
|
204 |
+
0, 1, step=slider_step, default=nms_conf, label="置信度阈值"
|
205 |
+
)
|
206 |
+
inputs_iou = gr.inputs.Slider(
|
207 |
+
0, 1, step=slider_step, default=nms_iou, label="IoU 阈值"
|
208 |
+
)
|
209 |
+
inputs_label = gr.inputs.Checkbox(default=label_opt, label="标签显示")
|
210 |
+
inputs_clsName = gr.inputs.CheckboxGroup(
|
211 |
+
choices=model_cls_name, default=model_cls_name, type="index", label="类别"
|
212 |
+
)
|
213 |
+
|
214 |
+
# 输入参数
|
215 |
+
inputs = [
|
216 |
+
inputs_img, # 输入图片
|
217 |
+
device, # 设备
|
218 |
+
inputs_model, # 模型
|
219 |
+
inputs_size, # 推理尺寸
|
220 |
+
input_conf, # 置信度阈值
|
221 |
+
inputs_iou, # IoU阈值
|
222 |
+
inputs_label, # 标签显示
|
223 |
+
inputs_clsName, # 类别
|
224 |
+
]
|
225 |
+
# 输出参数
|
226 |
+
outputs = gr.outputs.Image(type="pil", label="检测图片")
|
227 |
+
outputs02 = gr.outputs.JSON(label="检测信息")
|
228 |
+
|
229 |
+
# 标题
|
230 |
+
title = "基于Gradio的YOLOv5通用目标检测系统"
|
231 |
+
# 描述
|
232 |
+
description = "<div align='center'>可自定义目标检测模型、安装简单、使用方便</div>"
|
233 |
+
|
234 |
+
# 示例图片
|
235 |
+
examples = [
|
236 |
+
[
|
237 |
+
"./img_example/bus.jpg",
|
238 |
+
"cpu",
|
239 |
+
"yolov5s",
|
240 |
+
640,
|
241 |
+
0.6,
|
242 |
+
0.5,
|
243 |
+
True,
|
244 |
+
["人", "公交车"],
|
245 |
+
],
|
246 |
+
[
|
247 |
+
"./img_example/Millenial-at-work.jpg",
|
248 |
+
"cpu",
|
249 |
+
"yolov5l",
|
250 |
+
320,
|
251 |
+
0.5,
|
252 |
+
0.45,
|
253 |
+
True,
|
254 |
+
["人", "椅子", "杯子", "笔记本电脑"],
|
255 |
+
],
|
256 |
+
[
|
257 |
+
"./img_example/zidane.jpg",
|
258 |
+
"cpu",
|
259 |
+
"yolov5m",
|
260 |
+
640,
|
261 |
+
0.25,
|
262 |
+
0.5,
|
263 |
+
False,
|
264 |
+
["人", "领带"],
|
265 |
+
],
|
266 |
+
]
|
267 |
+
|
268 |
+
# 接口
|
269 |
+
gr.Interface(
|
270 |
+
fn=yolo_det,
|
271 |
+
inputs=inputs,
|
272 |
+
outputs=[outputs, outputs02],
|
273 |
+
title=title,
|
274 |
+
description=description,
|
275 |
+
examples=examples,
|
276 |
+
theme="seafoam",
|
277 |
+
# live=True, # 实时变更输出
|
278 |
+
flagging_dir="run" # 输出目录
|
279 |
+
# ).launch(inbrowser=True, auth=['admin', 'admin'])
|
280 |
+
).launch(
|
281 |
+
inbrowser=True, # 自动打开默认浏览器
|
282 |
+
show_tips=True, # 自动显示gradio最新功能
|
283 |
+
favicon_path="./icon/logo.ico",
|
284 |
+
)
|
285 |
+
|
286 |
+
|
287 |
+
if __name__ == "__main__":
|
288 |
+
args = parse_args()
|
289 |
+
main(args)
|
cls_name/cls_name.csv
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
人
|
2 |
+
自行车
|
3 |
+
汽车
|
4 |
+
摩托车
|
5 |
+
飞机
|
6 |
+
公交车
|
7 |
+
火车
|
8 |
+
卡车
|
9 |
+
船
|
10 |
+
红绿灯
|
11 |
+
消防栓
|
12 |
+
停止标志
|
13 |
+
停车收费表
|
14 |
+
长凳
|
15 |
+
鸟
|
16 |
+
猫
|
17 |
+
狗
|
18 |
+
马
|
19 |
+
羊
|
20 |
+
牛
|
21 |
+
象
|
22 |
+
熊
|
23 |
+
斑马
|
24 |
+
长颈鹿
|
25 |
+
背包
|
26 |
+
雨伞
|
27 |
+
手提包
|
28 |
+
领带
|
29 |
+
手提箱
|
30 |
+
飞盘
|
31 |
+
滑雪板
|
32 |
+
单板滑雪
|
33 |
+
运动球
|
34 |
+
风筝
|
35 |
+
棒球棒
|
36 |
+
棒球手套
|
37 |
+
滑板
|
38 |
+
冲浪板
|
39 |
+
网球拍
|
40 |
+
瓶子
|
41 |
+
红酒杯
|
42 |
+
杯子
|
43 |
+
叉子
|
44 |
+
刀
|
45 |
+
勺
|
46 |
+
碗
|
47 |
+
香蕉
|
48 |
+
苹果
|
49 |
+
三明治
|
50 |
+
橙子
|
51 |
+
西兰花
|
52 |
+
胡萝卜
|
53 |
+
热狗
|
54 |
+
比萨
|
55 |
+
甜甜圈
|
56 |
+
蛋糕
|
57 |
+
椅子
|
58 |
+
长椅
|
59 |
+
盆栽
|
60 |
+
床
|
61 |
+
餐桌
|
62 |
+
马桶
|
63 |
+
电视
|
64 |
+
笔记本电脑
|
65 |
+
鼠标
|
66 |
+
遥控器
|
67 |
+
键盘
|
68 |
+
手机
|
69 |
+
微波炉
|
70 |
+
烤箱
|
71 |
+
烤面包机
|
72 |
+
洗碗槽
|
73 |
+
冰箱
|
74 |
+
书
|
75 |
+
时钟
|
76 |
+
花瓶
|
77 |
+
剪刀
|
78 |
+
泰迪熊
|
79 |
+
吹风机
|
80 |
+
牙刷
|
cls_name/cls_name.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model_cls_name: ['人', '自行车', '汽车', '摩托车', '飞机', '公交车', '火车', '卡车', '船', '红绿灯', '消防栓', '停止标志',
|
2 |
+
'停车收费表', '长凳', '鸟', '猫', '狗', '马', '羊', '牛', '象', '熊', '斑马', '长颈鹿', '背包', '雨伞', '手提包', '领带',
|
3 |
+
'手提箱', '飞盘', '滑雪板', '单板滑雪', '运动球', '风筝', '棒球棒', '棒球手套', '滑板', '冲浪板', '网球拍', '瓶子', '红酒杯',
|
4 |
+
'杯子', '叉子', '刀', '勺', '碗', '香蕉', '苹果', '三明治', '橙子', '西兰花', '胡萝卜', '热狗', '比萨', '甜甜圈', '蛋糕',
|
5 |
+
'椅子', '长椅', '盆栽', '床', '餐桌', '马桶', '电视', '笔记本电脑', '鼠标', '遥控器', '键盘', '手机', '微波炉', '烤箱',
|
6 |
+
'烤面包机', '洗碗槽', '冰箱', '书', '时钟', '花瓶', '剪刀', '泰迪熊', '吹风机', '牙刷'
|
7 |
+
]
|
icon/logo.ico
ADDED
img_example/Millenial-at-work.jpg
ADDED
img_example/bus.jpg
ADDED
img_example/zidane.jpg
ADDED
model_config/model_name_p5_all.csv
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
yolov5n
|
2 |
+
yolov5s
|
3 |
+
yolov5m
|
4 |
+
yolov5l
|
5 |
+
yolov5x
|
model_config/model_name_p5_all.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
model_names: ["yolov5n", "yolov5s", "yolov5m", "yolov5l", "yolov5x"]
|
model_config/model_name_p5_n.csv
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
yolov5n
|
model_config/model_name_p5_n.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
model_names: ["yolov5n"]
|
model_config/model_name_p6_all.csv
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
yolov5n6
|
2 |
+
yolov5s6
|
3 |
+
yolov5m6
|
4 |
+
yolov5l6
|
5 |
+
yolov5x6
|
model_config/model_name_p6_all.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
model_names: ["yolov5n6", "yolov5s6", "yolov5m6", "yolov5l6", "yolov5x6"]
|
model_download/yolov5_model_p5_all.sh
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cd ./yolov5
|
2 |
+
|
3 |
+
# 下载YOLOv5模型
|
4 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5n.pt
|
5 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s.pt
|
6 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5m.pt
|
7 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5l.pt
|
8 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5x.pt
|
model_download/yolov5_model_p5_n.sh
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cd ./yolov5
|
2 |
+
|
3 |
+
# 下载YOLOv5模型
|
4 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5n.pt
|
model_download/yolov5_model_p6_all.sh
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cd ./yolov5
|
2 |
+
|
3 |
+
# 下载YOLOv5模型
|
4 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5n6.pt
|
5 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5s6.pt
|
6 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5m6.pt
|
7 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5l6.pt
|
8 |
+
wget -c -t 0 https://github.com/ultralytics/yolov5/releases/download/v6.1/yolov5x6.pt
|
requirements.txt
CHANGED
@@ -1,7 +1,35 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
numpy
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Base ----------------------------------------
|
2 |
+
matplotlib>=3.2.2
|
3 |
+
numpy>=1.18.5
|
4 |
+
opencv-python-headless>=4.5.5.64
|
5 |
+
Pillow>=7.1.2
|
6 |
+
PyYAML>=5.3.1
|
7 |
+
requests>=2.23.0
|
8 |
+
scipy>=1.4.1
|
9 |
+
torch>=1.7.0
|
10 |
+
torchvision>=0.8.1
|
11 |
+
tqdm>=4.41.0
|
12 |
+
|
13 |
+
# Logging -------------------------------------
|
14 |
+
tensorboard>=2.4.1
|
15 |
+
# wandb
|
16 |
+
|
17 |
+
# Plotting ------------------------------------
|
18 |
+
pandas>=1.1.4
|
19 |
+
seaborn>=0.11.0
|
20 |
+
|
21 |
+
# Export --------------------------------------
|
22 |
+
# coremltools>=4.1 # CoreML export
|
23 |
+
# onnx>=1.9.0 # ONNX export
|
24 |
+
# onnx-simplifier>=0.3.6 # ONNX simplifier
|
25 |
+
# scikit-learn==0.19.2 # CoreML quantization
|
26 |
+
# tensorflow>=2.4.1 # TFLite export
|
27 |
+
# tensorflowjs>=3.9.0 # TF.js export
|
28 |
+
# openvino-dev # OpenVINO export
|
29 |
+
|
30 |
+
# Extras --------------------------------------
|
31 |
+
# albumentations>=1.0.3
|
32 |
+
# Cython # for pycocotools https://github.com/cocodataset/cocoapi/issues/172
|
33 |
+
# pycocotools>=2.0 # COCO mAP
|
34 |
+
# roboflow
|
35 |
+
thop # FLOPs computation
|