Skip to content

Commit

Permalink
add-biformer-and-add-fasternet-backbone-to-yolov5
Browse files Browse the repository at this point in the history
  • Loading branch information
z1069614715 committed Apr 3, 2023
1 parent 7570d3f commit 43c4a39
Show file tree
Hide file tree
Showing 12 changed files with 818 additions and 6 deletions.
378 changes: 378 additions & 0 deletions cv-attention/Biformer.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions cv-attention/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
| Polarized Self-Attention | True | https://arxiv.org/abs/2107.00782 |
| Sequential Self-Attention | True | https://arxiv.org/abs/2107.00782 |
| GAM | True | https://arxiv.org/pdf/2112.05561v1.pdf |
| Biformer | True | https://arxiv.org/abs/2303.08810 |


# Install
部分注意力需要安装timm. 如运行提示缺少timm安装即可. 安装命令:pip install timm
安装命令:pip install timm einops -i https://pypi.tuna.tsinghua.edu.cn/simple

# Course
1. [yolov5添加注意力哔哩哔哩视频教学链接](https://www.bilibili.com/video/BV1s84y1775U) [yolov5添加注意力-补充事项-哔哩哔哩视频教学链接](https://www.bilibili.com/video/BV1hG4y1M71X)
Expand All @@ -40,4 +41,5 @@

# Reference
https://github.com/xmu-xiaoma666/External-Attention-pytorch
https://github.com/rwightman/pytorch-image-models
https://github.com/rwightman/pytorch-image-models
https://github.com/rayleizhu/BiFormer
2 changes: 1 addition & 1 deletion objectdetection-tricks/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
视频教学地址:[哔哩哔哩](https://www.bilibili.com/video/BV1LV4y1R7w6/).
- **tricks_4**
用于yolov5和v7中的yolo格式转换coco格式的脚本.(如何在v5和v7中输出ap_small,ap_middle,ap_large coco指标)
视频教学地址:[哔哩哔哩](https://www.bilibili.com/video/BV1LV4y1R7w6/).
视频教学地址:[哔哩哔哩](https://www.bilibili.com/video/BV14T411s7Ts/).
6 changes: 5 additions & 1 deletion yolo-improve/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@
添加Task-Specific Context Decoupling到yolov5中.
需要安装einops库. 命令: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple einops
视频教学地址:[哔哩哔哩](https://www.bilibili.com/video/BV1mk4y1h7us/).
paper: [yolov6链接](https://arxiv.org/pdf/2303.01047v1.pdf)
paper: [yolov6链接](https://arxiv.org/pdf/2303.01047v1.pdf)
- **yolov5-backbone/fasternet**
添加FasterNet主干到yolov5中.
视频教学地址:[哔哩哔哩](https://www.bilibili.com/video/BV1Mx4y1A7jy/).
reference: [链接](https://github.com/JierunChen/FasterNet)
13 changes: 13 additions & 0 deletions yolo-improve/yolov5-backbone/fasternet/faster_cfg/fasternet_l.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 192
depths: [3, 4, 18, 3]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.3
norm_layer: BN
act_layer: RELU
n_div: 4
13 changes: 13 additions & 0 deletions yolo-improve/yolov5-backbone/fasternet/faster_cfg/fasternet_m.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 144
depths: [3, 4, 18, 3]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.2
norm_layer: BN
act_layer: RELU
n_div: 4
13 changes: 13 additions & 0 deletions yolo-improve/yolov5-backbone/fasternet/faster_cfg/fasternet_s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 128
depths: [1, 2, 13, 2]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.1
norm_layer: BN
act_layer: RELU
n_div: 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 40
depths: [1, 2, 8, 2]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.
norm_layer: BN
act_layer: GELU
n_div: 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 64
depths: [1, 2, 8, 2]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.02
norm_layer: BN
act_layer: GELU
n_div: 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mlp_ratio: 2
embed_dim: 96
depths: [1, 2, 8, 2]
feature_dim: 1280
patch_size: 4
patch_stride: 4
patch_size2: 2
patch_stride2: 2
layer_scale_init_value: 0 # no layer scale
drop_path_rate: 0.05
norm_layer: BN
act_layer: RELU
n_div: 4
Loading

0 comments on commit 43c4a39

Please sign in to comment.