Xu Ma commited on
Commit
29a4916
1 Parent(s): 2488a15
README.md CHANGED
@@ -1,13 +1,15 @@
1
  ---
2
- title: LIVE
3
- emoji: 🐨
4
- colorFrom: green
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 2.9.4
8
  app_file: app.py
9
  pinned: false
10
- license: apache-2.0
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 numpy as np
5
  from PIL import Image
6
- import open3d as o3d
7
- from pathlib import Path
8
- import os
9
-
10
- feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
11
- model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
12
-
13
-
14
- def process_image(image_path):
15
- image_path = Path(image_path)
16
- image_raw = Image.open(image_path)
17
- image = image_raw.resize(
18
- (800, int(800 * image_raw.size[1] / image_raw.size[0])),
19
- Image.Resampling.LANCZOS)
20
-
21
- # prepare image for the model
22
- encoding = feature_extractor(image, return_tensors="pt")
23
-
24
- # forward pass
25
- with torch.no_grad():
26
- outputs = model(**encoding)
27
- predicted_depth = outputs.predicted_depth
28
-
29
- # interpolate to original size
30
- prediction = torch.nn.functional.interpolate(
31
- predicted_depth.unsqueeze(1),
32
- size=image.size[::-1],
33
- mode="bicubic",
34
- align_corners=False,
35
- ).squeeze()
36
- output = prediction.cpu().numpy()
37
- depth_image = (output * 255 / np.max(output)).astype('uint8')
38
- try:
39
- gltf_path = create_3d_obj(np.array(image), depth_image, image_path)
40
- img = Image.fromarray(depth_image)
41
- return [img, gltf_path, gltf_path]
42
- except Exception as e:
43
- gltf_path = create_3d_obj(
44
- np.array(image), depth_image, image_path, depth=8)
45
- img = Image.fromarray(depth_image)
46
- return [img, gltf_path, gltf_path]
47
- except:
48
- print("Error reconstructing 3D model")
49
- raise Exception("Error reconstructing 3D model")
50
-
51
-
52
- def create_3d_obj(rgb_image, depth_image, image_path, depth=10):
53
- depth_o3d = o3d.geometry.Image(depth_image)
54
- image_o3d = o3d.geometry.Image(rgb_image)
55
- rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
56
- image_o3d, depth_o3d, convert_rgb_to_intensity=False)
57
- w = int(depth_image.shape[1])
58
- h = int(depth_image.shape[0])
59
-
60
- camera_intrinsic = o3d.camera.PinholeCameraIntrinsic()
61
- camera_intrinsic.set_intrinsics(w, h, 500, 500, w/2, h/2)
62
-
63
- pcd = o3d.geometry.PointCloud.create_from_rgbd_image(
64
- rgbd_image, camera_intrinsic)
65
-
66
- print('normals')
67
- pcd.normals = o3d.utility.Vector3dVector(
68
- np.zeros((1, 3))) # invalidate existing normals
69
- pcd.estimate_normals(
70
- search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.01, max_nn=30))
71
- pcd.orient_normals_towards_camera_location(
72
- camera_location=np.array([0., 0., 1000.]))
73
- pcd.transform([[1, 0, 0, 0],
74
- [0, -1, 0, 0],
75
- [0, 0, -1, 0],
76
- [0, 0, 0, 1]])
77
- pcd.transform([[-1, 0, 0, 0],
78
- [0, 1, 0, 0],
79
- [0, 0, 1, 0],
80
- [0, 0, 0, 1]])
81
-
82
- print('run Poisson surface reconstruction')
83
- with o3d.utility.VerbosityContextManager(o3d.utility.VerbosityLevel.Debug) as cm:
84
- mesh_raw, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(
85
- pcd, depth=depth, width=0, scale=1.1, linear_fit=True)
86
-
87
- voxel_size = max(mesh_raw.get_max_bound() - mesh_raw.get_min_bound()) / 256
88
- print(f'voxel_size = {voxel_size:e}')
89
- mesh = mesh_raw.simplify_vertex_clustering(
90
- voxel_size=voxel_size,
91
- contraction=o3d.geometry.SimplificationContraction.Average)
92
-
93
- # vertices_to_remove = densities < np.quantile(densities, 0.001)
94
- # mesh.remove_vertices_by_mask(vertices_to_remove)
95
- bbox = pcd.get_axis_aligned_bounding_box()
96
- mesh_crop = mesh.crop(bbox)
97
- gltf_path = f'./{image_path.stem}.gltf'
98
- o3d.io.write_triangle_mesh(
99
- gltf_path, mesh_crop, write_triangle_uvs=True)
100
- return gltf_path
101
-
102
-
103
- title = "LIVE: Towards Layer-wise Image Vectorization (CVPR 2022 Oral)"
104
- description = "This demo shows the effectiveness of LIVE <a href='' target='_blank'>Paper</a>. Given the input image, LIVE is able to progressively build the SVG output with a layer-wise representation." \
105
- "<br>NOTE: for efficiency, we resize input images to 240x240 for Huggingface Space. "
106
- examples = [["examples/" + img] for img in os.listdir("examples/")]
107
-
108
- iface = gr.Interface(fn=process_image,
109
- inputs=[gr.inputs.Image(type="filepath", label="Input Image")
110
- ],
111
- outputs=[gr.outputs.Image(label="predicted depth", type="pil"),
112
- gr.outputs.Image3D(label="3d mesh reconstruction", clear_color=[
113
- 1.0, 1.0, 1.0, 1.0]),
114
- gr.outputs.File(label="3d gLTF")],
115
- title=title,
116
- description=description,
117
- examples=examples,
118
- allow_flagging="never")
119
- iface.launch(debug=True, enable_queue=False, cache_examples=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- torch
2
- git+https://github.com/nielsrogge/transformers.git@add_dpt_redesign#egg=transformers
3
- numpy
4
- Pillow
5
- gradio>=2.9.3
6
- jinja2
7
- open3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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