|
| 1 | +# Metadata |
| 2 | +author: Y-T-G |
| 3 | +task: detect |
| 4 | +keywords: [transformer, swin, fpn] |
| 5 | +description: Swin-T pretrained backbone with YOLO11 FPN neck and Detect head. |
| 6 | +flops: 73.7 |
| 7 | +parameters: 40200397 |
| 8 | +min_version: 8.3.64 |
| 9 | +discussion: https://github.com/Y-T-G/community/discussions/41 |
| 10 | + |
| 11 | +# Model |
| 12 | +nc: 1 |
| 13 | +strides: [8, 16, 32] |
| 14 | +scales: |
| 15 | + # [depth, width, max_channels] |
| 16 | + default: [1.00, 1.00, 1024] |
| 17 | +backbone: |
| 18 | + # [from, repeats, module, args] |
| 19 | + - [-1, 1, TorchVision, [768, swin_t, DEFAULT, True, 5, True]] # 0 |
| 20 | + - [0, 1, Index, [192, 4]] # (1, 80, 80, 192) - 1 |
| 21 | + - [-1, 1, torchvision.ops.Permute, [[0, 3, 1, 2]]] # (1, 192, 80, 80) - 2 |
| 22 | + - [0, 1, Index, [384, 6]] # (1, 40, 40, 384) - 3 |
| 23 | + - [-1, 1, torchvision.ops.Permute, [[0, 3, 1, 2]]] # (1, 384, 40, 40) - 4 |
| 24 | + - [0, 1, Index, [768, 8]] # (1, 20, 20, 768) - 5 |
| 25 | + - [-1, 1, torchvision.ops.Permute, [[0, 3, 1, 2]]] # (1, 768, 20, 20) - 6 |
| 26 | + - [-1, 1, SPPF, [768, 5]] # (1, 768, 20, 20) - 7 |
| 27 | +head: |
| 28 | + - [-1, 1, nn.Upsample, [None, 2, nearest]] # (1, 768, 40, 40) - 8 |
| 29 | + - [[-1, 4], 1, Concat, [1]] # (1, 1152, 40, 40) - 9 |
| 30 | + - [-1, 2, C3k2, [384, False]] # (1, 384, 40, 40) - 10 |
| 31 | + - [-1, 1, nn.Upsample, [None, 2, nearest]] # (1, 384, 80, 80) - 11 |
| 32 | + - [[-1, 2], 1, Concat, [1]] # (1, 576, 80, 80) - 12 |
| 33 | + - [-1, 2, C3k2, [192, False]] # (1, 192, 80, 80) - 13 |
| 34 | + - [-1, 1, Conv, [192, 3, 2]] # (1, 192, 40, 40) - 14 |
| 35 | + - [[-1, -5], 1, Concat, [1]] # (1, 576, 40, 40) - 15 |
| 36 | + - [-1, 2, C3k2, [384, False]] # (1, 384, 40, 40) - 16 |
| 37 | + - [-1, 1, Conv, [384, 3, 2]] # (1, 384, 20, 20) - 17 |
| 38 | + - [[-1, -11], 1, Concat, [1]] # (1, 1152, 20, 20) - 18 |
| 39 | + - [-1, 2, C3k2, [768, True]] # (1, 768, 20, 20) - 19 |
| 40 | + - [[-7, -4, -1], 1, Detect, [nc]] # 20 |
0 commit comments