README.md 1.78 KB
Newer Older
Your Name's avatar
Your Name committed
1
# YoloV7
shizhm's avatar
shizhm committed
2

Your Name's avatar
Your Name committed
3
4
5
6
7
8
## 模型介绍

YOLOV7是2022年最新出现的一种YOLO系列目标检测模型,在论文 [YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors](https://arxiv.org/abs/2207.02696)中提出。

## 模型结构

Your Name's avatar
Your Name committed
9
YoloV7模型的网络结构包括三个部分:input、backbone和head。与yolov5不同的是,将neck层与head层合称为head层,实际上的功能是一样的。各个部分的功能和yolov5相同,如backbone用于提取特征,head用于预测。yolov7依旧基于anchor based的方法,同时在网络架构上增加E-ELAN层,并将REP层也加入进来,方便后续部署,同时在训练时,在head时,新增Aux_detect用于辅助检测。
Your Name's avatar
Your Name committed
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

## 推理

### 环境配置

[光源](https://www.sourcefind.cn/#/image/dcu/custom)可拉取用于推理的docker镜像,YoloV7模型推理推荐的镜像如下:

```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:ort_dcu_1.14.0_migraphx2.5.2_dtk22.10.1
```

[光合开发者社区](https://cancon.hpccube.com:65024/4/main/)可下载MIGraphX安装包,python依赖安装:

```
pip install -r requirements.txt
```

### 运行示例

YoloV7模型的推理示例程序是YoloV7_infer_migraphx.py,使用如下命令运行该推理示例:

```
python YoloV7_infer_migraphx.py \
	--imgpath 测试图像路径 \ 
	--modelpath onnx模型路径 \
	--objectThreshold 判断是否有物体阈值,默认0.5 \
	--confThreshold 置信度阈值,默认0.25 \
	--nmsThreshold nms阈值,默认0.5 \
```

Your Name's avatar
Your Name committed
40
程序运行结束会在当前目录生成YoloV7检测结果图像。
Your Name's avatar
Your Name committed
41
42
43
44
45

<img src="./images/Result.jpg" alt="Result" style="zoom: 50%;" />

## 历史版本

Your Name's avatar
Your Name committed
46
​		https://developer.hpccube.com/codes/modelzoo/yolov7_migraphx
Your Name's avatar
Your Name committed
47
48
49

## 参考

Your Name's avatar
Your Name committed
50
​		https://github.com/WongKinYiu/yolov7