我的配置
torch 1.12.1
python 3.9.18
编辑器:pycharm
gitpython>=3.1.30
matplotlib>=3.3
numpy>=1.23.5
opencv-python>=4.1.1
pillow==9.5.0
psutil
PyYAML>=5.3.1
requests>=2.23.0
scipy>=1.4.1
thop>=0.1.1
torch>=1.8.0
torchvision>=0.9.0
tqdm>=4.64.0
ultralytics>=8.0.232
pandas>=1.1.4
seaborn>=0.11.0
setuptools>=65.5.1
wheel>=0.38.0
timm
torchsummary
本篇博客主要分享各大企业和高校推出的源代码,并且集成在YOLOv5框架中。
源代码主要包括,主干网络、损失函数、检测头、注意力机制等模块。
当前仓库的代码还不够完整,后期会逐个添加相关代码。
我使用的数据是自行在B站上截屏获取的。经过数据增强,得到300张左右的训练集。
更新日志:
2024年5月21日
添加损失函数,注意力机制函数
GIoU (bool, optional): If True, calculate Generalized IoU. Defaults to False.
DIoU (bool, optional): If True, calculate Distance IoU. Defaults to False.
CIoU (bool, optional): If True, calculate Complete IoU. Defaults to False.
EIoU (bool, optional): If True, calculate Efficient IoU. Defaults to False.
SIoU (bool, optional): If True, calculate Scylla IoU. Defaults to False.
WIoU (bool, optional):
ShapeIoU (bool, optional):
mpdiou (bool, optional):
from .CA import *
from .CBAM import *
from .ECA import *
from .GAM import *
from .DAT import *
2024年5月20日
添加基准模型,YOLOv3,YOLOv5,YOLOv6,YOLOv8,YOLOv9
2024年5月16日
添加 Ghostnetv1,Ghostnetv2,Ghostnetv3模块,以及ShuffleNetV1,ShuffleNetV2等15个模块。
15个主干网络,每个测试成功,可以跑通。
yaml 文件
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/9adc9f10363541a48cec136d974ce0a4.png)
from .FasterBlock import *
from .MobileNetV1 import *
from .MobileNetV2 import *
from .MobileNetV3 import *
from .MobileNetV4 import *
from .MobileViTv1 import *
from .MobileViTv2 import *
from .ShuffleNetV1 import *
from .ShuffleNetV2 import *
from .EfficientNetV1 import *
from .EfficientNetV2 import *
from .EfficientViT2 import *
from .GhostNetV1 import *
from .GhostNetV2 import *
from .GhostNetV3 import *
5个模块均可运行。
2024年5月15日
替换C3为 C2f_FasterBlock模块。yaml文件跑通,train文件跑通,detect文件可用。只展示yaml文件,其他核心代码自行去GitHub下载。
yaml文件
nc: 80
depth_multiple: 0.33
width_multiple: 0.50
anchors:
- [10, 13, 16, 30, 33, 23]
- [30, 61, 62, 45, 59, 119]
- [116, 90, 156, 198, 373, 326]
backbone:
[
[-1, 1, Conv, [64, 6, 2, 2]],
[-1, 1, Conv, [128, 3, 2]],
[-1, 3, C2f_FasterBlock, [128]],
[-1, 1, Conv, [256, 3, 2]],
[-1, 6, C2f_FasterBlock, [256]],
[-1, 1, Conv, [512, 3, 2]],
[-1, 9, C2f_FasterBlock, [512]],
[-1, 1, Conv, [1024, 3, 2]],
[-1, 3, C2f_FasterBlock, [1024]],
[-1, 1, SPPF, [1024, 5]],
]
head: [
[-1, 1, Conv, [512, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, "nearest"]],
[[-1, 6], 1, Concat, [1]],
[-1, 3, C2f_FasterBlock, [512, False]],
[-1, 1, Conv, [256, 1, 1]],
[-1, 1, nn.Upsample, [None, 2, "nearest"]],
[[-1, 4], 1, Concat, [1]],
[-1, 3, C2f_FasterBlock, [256, False]],
[-1, 1, Conv, [256, 3, 2]],
[[-1, 14], 1, Concat, [1]],
[-1, 3, C2f_FasterBlock, [512, False]],
[-1, 1, Conv, [512, 3, 2]],
[[-1, 10], 1, Concat, [1]],
[-1, 3, C2f_FasterBlock, [1024, False]],
[[17, 20, 23], 1, Detect, [nc, anchors]],
]