Skip to content

Commit 78cca21

Browse files
committed
update readme and bn
1 parent fe79318 commit 78cca21

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## YOLOV7:You Only Look Once目标检测模型在pytorch当中的实现
1+
## YOLOV8:You Only Look Once目标检测模型在pytorch当中的实现
22
---
33

44
## 目录
@@ -13,7 +13,7 @@
1313
9. [参考资料 Reference](#Reference)
1414

1515
## Top News
16-
**`2022-07`**:**仓库创建,支持step、cos学习率下降法、支持adam、sgd优化器选择、支持学习率根据batch_size自适应调整、新增图片裁剪、支持多GPU训练、支持各个种类目标数量计算、支持heatmap、支持EMA。**
16+
**`2023-03`**:**仓库创建,支持step、cos学习率下降法、支持adam、sgd优化器选择、支持学习率根据batch_size自适应调整、新增图片裁剪、支持多GPU训练、支持各个种类目标数量计算、支持heatmap、支持EMA。**
1717

1818
## 相关仓库
1919
| 模型 | 路径 |
@@ -32,17 +32,20 @@ YoloV7-tiny | https://github.com/bubbliiiing/yolov7-tiny-pytorch
3232
## 性能情况
3333
| 训练数据集 | 权值文件名称 | 测试数据集 | 输入图片大小 | mAP 0.5:0.95 | mAP 0.5 |
3434
| :-----: | :-----: | :------: | :------: | :------: | :-----: |
35-
| COCO-Train2017 | [yolov7_weights.pth](https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/yolov7_weights.pth) | COCO-Val2017 | 640x640 | 50.7 | 69.2
36-
| COCO-Train2017 | [yolov7_x_weights.pth](https://github.com/bubbliiiing/yolov7-pytorch/releases/download/v1.0/yolov7_x_weights.pth) | COCO-Val2017 | 640x640 | 52.4 | 70.5
35+
| COCO-Train2017 | [yolov8_n.pth](https://github.com/bubbliiiing/yolov8-pytorch/releases/download/v1.0/yolov8_n.pth) | COCO-Val2017 | 640x640 | 36.7 | 52.1
36+
| COCO-Train2017 | [yolov8_s.pth](https://github.com/bubbliiiing/yolov8-pytorch/releases/download/v1.0/yolov8_s.pth) | COCO-Val2017 | 640x640 | 44.1 | 61.0
37+
| COCO-Train2017 | [yolov8_m.pth](https://github.com/bubbliiiing/yolov8-pytorch/releases/download/v1.0/yolov8_m.pth) | COCO-Val2017 | 640x640 | 49.3 | 66.3
38+
| COCO-Train2017 | [yolov8_l.pth](https://github.com/bubbliiiing/yolov8-pytorch/releases/download/v1.0/yolov8_l.pth) | COCO-Val2017 | 640x640 | 52.0 | 68.9
39+
| COCO-Train2017 | [yolov8_x.pth](https://github.com/bubbliiiing/yolov8-pytorch/releases/download/v1.0/yolov8_x.pth) | COCO-Val2017 | 640x640 | 52.9 | 69.9
3740

3841
## 所需环境
3942
torch==1.2.0
4043
为了使用amp混合精度,推荐使用torch1.7.1以上的版本。
4144

4245
## 文件下载
4346
训练所需的权值可在百度网盘中下载。
44-
链接: https://pan.baidu.com/s/1uYpjWC1uOo3Q-klpUEy9LQ
45-
提取码: pmua
47+
链接: https://pan.baidu.com/s/1-khkEUiH-J3YJHVaYuuVbw
48+
提取码: ss9t
4649

4750
VOC数据集下载地址如下,里面已经包括了训练集、测试集、验证集(与测试集一样),无需再次划分:
4851
链接: https://pan.baidu.com/s/19Mw2u_df_nBzsC2lg20fQA
@@ -114,7 +117,7 @@ _defaults = {
114117
# 验证集损失较低不代表mAP较高,仅代表该权值在验证集上泛化性能较好。
115118
# 如果出现shape不匹配,同时要注意训练时的model_path和classes_path参数的修改
116119
#--------------------------------------------------------------------------#
117-
"model_path" : 'model_data/yolov7_weights.pth',
120+
"model_path" : 'model_data/yolov8_s.pth',
118121
"classes_path" : 'model_data/coco_classes.txt',
119122
#---------------------------------------------------------------------#
120123
# anchors_path代表先验框对应的txt文件,一般不修改。
@@ -127,11 +130,14 @@ _defaults = {
127130
#---------------------------------------------------------------------#
128131
"input_shape" : [640, 640],
129132
#------------------------------------------------------#
130-
# 所使用到的yolov7的版本,本仓库一共提供两个:
131-
# l : 对应yolov7
132-
# x : 对应yolov7_x
133+
# 所使用到的yolov8的版本:
134+
# n : 对应yolov8_n
135+
# s : 对应yolov8_s
136+
# m : 对应yolov8_m
137+
# l : 对应yolov8_l
138+
# x : 对应yolov8_x
133139
#------------------------------------------------------#
134-
"phi" : 'l',
140+
"phi" : 's',
135141
#---------------------------------------------------------------------#
136142
# 只有得分大于置信度的预测框会被保留下来
137143
#---------------------------------------------------------------------#
@@ -172,4 +178,4 @@ img/street.jpg
172178
5. 运行get_map.py即可获得评估结果,评估结果会保存在map_out文件夹中。
173179

174180
## Reference
175-
https://github.com/WongKinYiu/yolov7
181+
https://github.com/ultralytics/ultralytics

nets/backbone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Conv(nn.Module):
2525
def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True):
2626
super().__init__()
2727
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p, d), groups=g, dilation=d, bias=False)
28-
self.bn = nn.BatchNorm2d(c2)
28+
self.bn = nn.BatchNorm2d(c2, eps=0.001, momentum=0.03, affine=True, track_running_stats=True)
2929
self.act = self.default_act if act is True else act if isinstance(act, nn.Module) else nn.Identity()
3030

3131
def forward(self, x):
@@ -107,7 +107,7 @@ def __init__(self, base_channels, base_depth, deep_mul, phi, pretrained=False):
107107
self.dark5 = nn.Sequential(
108108
Conv(base_channels * 8, int(base_channels * 16 * deep_mul), 3, 2),
109109
C2f(int(base_channels * 16 * deep_mul), int(base_channels * 16 * deep_mul), base_depth, True),
110-
SPPF(int(base_channels * 16 * deep_mul), int(base_channels * 16 * deep_mul))
110+
SPPF(int(base_channels * 16 * deep_mul), int(base_channels * 16 * deep_mul), k=5)
111111
)
112112

113113
if pretrained:

0 commit comments

Comments
 (0)