Commit 8912bd9d authored by acqpriwny1's avatar acqpriwny1
Browse files

Update README.md

parent 601eb81c
# YOLOV5测试
## 1.模型介绍
......@@ -80,7 +79,7 @@ python3 -m torch.distributed.run --nproc_per_node 4 train.py --batch 128 --data
其中--nproc_per_node参数代表卡的个数,--batch参数代表global batchsize的大小
![image](b1f15f6dfece4c81963cfb63c792ee15.png)
## 推理测试
```
python detect.py --source 0 # webcam
......@@ -97,15 +96,31 @@ detect.py 在各种来源上运行 YOLOv5 推论,从最新的 YOLOv5 版本中
python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images/
Image(filename='runs/detect/exp/zidane.jpg', width=600)
```
![image](捕获.PNG)
将训练好的pt文件导入weight参数中即可,推理代码如下:
```
python3 val.py --data data/coco-v5.yaml --weights runs/train/exp12/weights/best.pt --device 0
```
##ONNX模型单张图片推理并导出
在export.py 中的 def parse_opt()函数修改:
```
修改 default=12
parser.add_argument('--simplify', action='store_true', help='ONNX: simplify model')
parser.add_argument('--opset', type=int, default=12, help='ONNX: opset version')
```
在yolov5目录下执行模型导出脚本
```
python export.py --weights yolov5s.pt --include onnx
```
用准备好的模型推理代码进行推理,并将结果输出为res.jpg:
```
#输入图片修改output, or_img = model.inference('Image00003.jpg')
## 准确率数据
python yolov5_detection.py
```
![image](res.jpg)
## 准确率
| 模型 | size(pixels) | map0.5:0.95 | map0.5 |
| :-----: | :------: | :---------: | :----: |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment