{"id":51738,"date":"2025-08-11T06:19:48","date_gmt":"2025-08-10T22:19:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51738.html"},"modified":"2025-08-11T06:19:48","modified_gmt":"2025-08-10T22:19:48","slug":"%e3%80%90%e5%ae%8c%e6%95%b4%e6%ba%90%e7%a0%81%e6%95%b0%e6%8d%ae%e9%9b%86%e9%83%a8%e7%bd%b2%e6%95%99%e7%a8%8b%e3%80%91%e7%9c%bc%e5%ba%95%e5%9b%be%e5%83%8f%e5%b1%82%e6%ac%a1%e5%88%86%e5%89%b2%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51738.html","title":{"rendered":"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3"},"content":{"rendered":"<h2>\u80cc\u666f\u610f\u4e49<\/h2>\n<p>\u7814\u7a76\u80cc\u666f\u4e0e\u610f\u4e49<\/p>\n<p>\u773c\u5e95\u56fe\u50cf\u5206\u6790\u5728\u533b\u5b66\u5f71\u50cf\u5b66\u4e2d\u626e\u6f14\u7740\u81f3\u5173\u91cd\u8981\u7684\u89d2\u8272&#xff0c;\u5c24\u5176\u662f\u5728\u65e9\u671f\u8bca\u65ad\u548c\u76d1\u6d4b\u773c\u79d1\u75be\u75c5\u65b9\u9762\u3002\u968f\u7740\u4eba\u53e3\u8001\u9f84\u5316\u7684\u52a0\u5267&#xff0c;\u773c\u79d1\u75be\u75c5\u7684\u53d1\u75c5\u7387\u9010\u5e74\u4e0a\u5347&#xff0c;\u5c24\u5176\u662f\u7cd6\u5c3f\u75c5\u89c6\u7f51\u819c\u75c5\u53d8\u3001\u9ec4\u6591\u53d8\u6027\u7b49\u75be\u75c5&#xff0c;\u7ed9\u60a3\u8005\u7684\u89c6\u529b\u5065\u5eb7\u5e26\u6765\u4e86\u4e25\u91cd\u5a01\u80c1\u3002\u56e0\u6b64&#xff0c;\u5f00\u53d1\u9ad8\u6548\u3001\u51c6\u786e\u7684\u773c\u5e95\u56fe\u50cf\u5206\u6790\u7cfb\u7edf&#xff0c;\u5c24\u5176\u662f\u5c42\u6b21\u5206\u5272\u6280\u672f&#xff0c;\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\u3002\u5c42\u6b21\u5206\u5272\u80fd\u591f\u5e2e\u52a9\u533b\u751f\u6e05\u6670\u5730\u8bc6\u522b\u548c\u5b9a\u4f4d\u773c\u5e95\u56fe\u50cf\u4e2d\u7684\u5404\u4e2a\u7ed3\u6784&#xff0c;\u8fdb\u800c\u63d0\u9ad8\u8bca\u65ad\u7684\u51c6\u786e\u6027\u548c\u6548\u7387\u3002<\/p>\n<p>\u672c\u7814\u7a76\u65e8\u5728\u57fa\u4e8e\u6539\u8fdb\u7684YOLOv11\u6a21\u578b&#xff0c;\u6784\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u3002\u8be5\u7cfb\u7edf\u5c06\u5229\u7528oct5k_new_new\u6570\u636e\u96c6&#xff0c;\u8be5\u6570\u636e\u96c6\u5305\u542b4600\u5e45\u773c\u5e95\u56fe\u50cf&#xff0c;\u6db5\u76d6\u4e866\u4e2a\u4e0d\u540c\u7684\u7c7b\u522b&#xff0c;\u5305\u62ec\u5185\u754c\u819c&#xff08;ILM&#xff09;\u3001\u89c6\u7f51\u819c\u8272\u7d20\u4e0a\u76ae&#xff08;RPE&#xff09;\u3001\u5916\u5c42&#xff08;OPL&#xff09;\u7b49\u3002\u8fd9\u4e9b\u7c7b\u522b\u7684\u51c6\u786e\u5206\u5272\u5bf9\u4e8e\u75be\u75c5\u7684\u8bca\u65ad\u548c\u6cbb\u7597\u65b9\u6848\u7684\u5236\u5b9a\u81f3\u5173\u91cd\u8981\u3002\u901a\u8fc7\u5bf9\u8fd9\u4e9b\u56fe\u50cf\u8fdb\u884c\u6df1\u5ea6\u5b66\u4e60\u8bad\u7ec3&#xff0c;\u7cfb\u7edf\u5c06\u80fd\u591f\u81ea\u52a8\u8bc6\u522b\u548c\u5206\u5272\u51fa\u773c\u5e95\u56fe\u50cf\u4e2d\u7684\u5173\u952e\u7ed3\u6784&#xff0c;\u51cf\u8f7b\u533b\u751f\u7684\u5de5\u4f5c\u8d1f\u62c5&#xff0c;\u63d0\u9ad8\u8bca\u65ad\u6548\u7387\u3002<\/p>\n<p>\u6b64\u5916&#xff0c;\u6570\u636e\u96c6\u7ecf\u8fc7\u591a\u79cd\u6570\u636e\u589e\u5f3a\u5904\u7406&#xff0c;\u6781\u5927\u5730\u4e30\u5bcc\u4e86\u8bad\u7ec3\u6837\u672c\u7684\u591a\u6837\u6027&#xff0c;\u63d0\u5347\u4e86\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u8868\u73b0&#xff0c;\u8fd8\u80fd\u4e3a\u540e\u7eed\u7684\u7814\u7a76\u63d0\u4f9b\u575a\u5b9e\u7684\u6570\u636e\u57fa\u7840\u3002\u968f\u7740\u6df1\u5ea6\u5b66\u4e60\u6280\u672f\u7684\u4e0d\u65ad\u8fdb\u6b65&#xff0c;\u57fa\u4e8eYOLOv11\u7684\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u5c06\u4e3a\u773c\u79d1\u533b\u5b66\u63d0\u4f9b\u65b0\u7684\u89e3\u51b3\u65b9\u6848&#xff0c;\u63a8\u52a8\u773c\u5e95\u75be\u75c5\u7684\u65e9\u671f\u8bca\u65ad\u548c\u6cbb\u7597\u8fdb\u7a0b&#xff0c;\u5177\u6709\u91cd\u8981\u7684\u4e34\u5e8a\u5e94\u7528\u4ef7\u503c\u548c\u793e\u4f1a\u610f\u4e49\u3002<\/p>\n<h2>\u56fe\u7247\u6548\u679c<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221943-68991aff74e5f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221944-68991b0024181.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221945-68991b0153f81.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u6570\u636e\u96c6\u4fe1\u606f<\/h2>\n<p>\u672c\u9879\u76ee\u6570\u636e\u96c6\u4fe1\u606f\u4ecb\u7ecd<\/p>\n<p>\u672c\u9879\u76ee\u6240\u4f7f\u7528\u7684\u6570\u636e\u96c6\u540d\u4e3a\u201coct5k_new_new\u201d&#xff0c;\u65e8\u5728\u4e3a\u6539\u8fdbYOLOv11\u7684\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u63d0\u4f9b\u9ad8\u8d28\u91cf\u7684\u8bad\u7ec3\u6570\u636e\u3002\u8be5\u6570\u636e\u96c6\u4e13\u6ce8\u4e8e\u773c\u5e95\u56fe\u50cf\u7684\u5206\u5272\u4efb\u52a1&#xff0c;\u5305\u542b\u4e86\u516d\u4e2a\u4e3b\u8981\u7c7b\u522b&#xff0c;\u5206\u522b\u4e3a\u5185\u754c\u819c&#xff08;ILM&#xff09;\u3001\u5149\u611f\u53d7\u5668\u5c42\u4e0e\u89c6\u7f51\u819c\u8272\u7d20\u4e0a\u76ae\u5c42&#xff08;IS-OS&#xff09;\u3001\u4e0b\u5c42&#xff08;Lower&#xff09;\u3001\u5916\u6838\u5c42&#xff08;OPL&#xff09;\u3001\u89c6\u7f51\u819c\u8272\u7d20\u4e0a\u76ae\u5c42&#xff08;RPE&#xff09;\u4ee5\u53ca\u4e0a\u5c42&#xff08;Upper&#xff09;\u3002\u8fd9\u4e9b\u7c7b\u522b\u6db5\u76d6\u4e86\u773c\u5e95\u56fe\u50cf\u4e2d\u91cd\u8981\u7684\u89e3\u5256\u7ed3\u6784&#xff0c;\u5bf9\u4e8e\u773c\u79d1\u75be\u75c5\u7684\u8bca\u65ad\u548c\u6cbb\u7597\u5177\u6709\u91cd\u8981\u610f\u4e49\u3002<\/p>\n<p>\u5728\u6570\u636e\u96c6\u7684\u6784\u5efa\u8fc7\u7a0b\u4e2d&#xff0c;\u6240\u6709\u56fe\u50cf\u5747\u7ecf\u8fc7\u7cbe\u5fc3\u6807\u6ce8&#xff0c;\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5206\u5272\u8fb9\u754c\u6e05\u6670\u4e14\u51c6\u786e\u3002\u8fd9\u79cd\u9ad8\u8d28\u91cf\u7684\u6807\u6ce8\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u6a21\u578b\u8bad\u7ec3\u7684\u6709\u6548\u6027&#xff0c;\u4e5f\u4e3a\u540e\u7eed\u7684\u9a8c\u8bc1\u548c\u6d4b\u8bd5\u63d0\u4f9b\u4e86\u53ef\u9760\u7684\u57fa\u7840\u3002\u6570\u636e\u96c6\u4e2d\u7684\u56fe\u50cf\u6837\u672c\u6765\u81ea\u591a\u79cd\u4e0d\u540c\u7684\u773c\u5e95\u626b\u63cf&#xff0c;\u6db5\u76d6\u4e86\u4e0d\u540c\u5e74\u9f84\u6bb5\u548c\u75c5\u7406\u72b6\u6001\u7684\u60a3\u8005&#xff0c;\u4ece\u800c\u589e\u5f3a\u4e86\u6a21\u578b\u7684\u6cdb\u5316\u80fd\u529b\u548c\u9002\u5e94\u6027\u3002<\/p>\n<p>\u6b64\u5916&#xff0c;\u6570\u636e\u96c6\u7684\u591a\u6837\u6027\u4f7f\u5f97\u6a21\u578b\u80fd\u591f\u5b66\u4e60\u5230\u4e0d\u540c\u89e3\u5256\u7ed3\u6784\u5728\u4e0d\u540c\u6761\u4ef6\u4e0b\u7684\u8868\u73b0&#xff0c;\u8fdb\u4e00\u6b65\u63d0\u5347\u4e86\u5206\u5272\u7cbe\u5ea6\u3002\u901a\u8fc7\u4f7f\u7528\u201coct5k_new_new\u201d\u6570\u636e\u96c6&#xff0c;\u7814\u7a76\u4eba\u5458\u5e0c\u671b\u80fd\u591f\u63a8\u52a8\u773c\u5e95\u56fe\u50cf\u5206\u6790\u6280\u672f\u7684\u53d1\u5c55&#xff0c;\u5c24\u5176\u662f\u5728\u81ea\u52a8\u5316\u5206\u5272\u548c\u75be\u75c5\u68c0\u6d4b\u65b9\u9762\u7684\u5e94\u7528\u3002\u6700\u7ec8\u76ee\u6807\u662f\u5b9e\u73b0\u66f4\u4e3a\u7cbe\u51c6\u7684\u773c\u5e95\u56fe\u50cf\u5206\u6790&#xff0c;\u4ee5\u8f85\u52a9\u4e34\u5e8a\u533b\u751f\u8fdb\u884c\u65e9\u671f\u8bca\u65ad\u548c\u4e2a\u6027\u5316\u6cbb\u7597\u65b9\u6848\u7684\u5236\u5b9a\u3002\u6570\u636e\u96c6\u7684\u8bbe\u8ba1\u548c\u5b9e\u65bd\u4e3a\u672c\u9879\u76ee\u7684\u6210\u529f\u5960\u5b9a\u4e86\u575a\u5b9e\u7684\u57fa\u7840&#xff0c;\u671f\u5f85\u901a\u8fc7\u8fd9\u4e00\u7814\u7a76\u4e3a\u773c\u79d1\u9886\u57df\u5e26\u6765\u65b0\u7684\u7a81\u7834\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221946-68991b0233124.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221946-68991b025b664.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221946-68991b02884d0.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221946-68991b02bd096.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221946-68991b02e9a3d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u6838\u5fc3\u4ee3\u7801<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4ee3\u7801\u4e2d\u6700\u6838\u5fc3\u7684\u90e8\u5206&#xff0c;\u5e76\u9644\u4e0a\u8be6\u7ec6\u7684\u4e2d\u6587\u6ce8\u91ca&#xff1a;<\/p>\n<p>import torch<br \/>\nimport torch.nn as nn<br \/>\nimport torch.nn.functional as F<br \/>\nfrom timm.models.layers import SqueezeExcite<\/p>\n<p>\u5b9a\u4e49\u5377\u79ef\u5c42\u548c\u6279\u5f52\u4e00\u5316\u7684\u7ec4\u5408<br \/>\nclass Conv2d_BN(torch.nn.Sequential):<br \/>\ndef init(self, in_channels, out_channels, kernel_size&#061;1, stride&#061;1, padding&#061;0, dilation&#061;1, groups&#061;1, bn_weight_init&#061;1):<br \/>\nsuper().init()<br \/>\n# \u6dfb\u52a0\u5377\u79ef\u5c42<br \/>\nself.add_module(\u2018c\u2019, torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, bias&#061;False))<br \/>\n# \u6dfb\u52a0\u6279\u5f52\u4e00\u5316\u5c42<br \/>\nself.add_module(\u2018bn\u2019, torch.nn.BatchNorm2d(out_channels))<br \/>\n# \u521d\u59cb\u5316\u6279\u5f52\u4e00\u5316\u7684\u6743\u91cd<br \/>\ntorch.nn.init.constant_(self.bn.weight, bn_weight_init)<br \/>\ntorch.nn.init.constant_(self.bn.bias, 0)<\/p>\n<p>&#064;torch.no_grad()<br \/>\ndef switch_to_deploy(self):<br \/>\n    # \u5c06\u8bad\u7ec3\u6a21\u5f0f\u7684\u5377\u79ef\u548c\u6279\u5f52\u4e00\u5316\u5c42\u878d\u5408\u4e3a\u4e00\u4e2a\u5377\u79ef\u5c42<br \/>\n    c, bn &#061; self._modules.values()<br \/>\n    w &#061; bn.weight \/ (bn.running_var &#043; bn.eps)**0.5  # \u8ba1\u7b97\u65b0\u7684\u6743\u91cd<br \/>\n    w &#061; c.weight * w[:, None, None, None]  # \u878d\u5408\u6743\u91cd<br \/>\n    b &#061; bn.bias &#8211; bn.running_mean * bn.weight \/ (bn.running_var &#043; bn.eps)**0.5  # \u8ba1\u7b97\u65b0\u7684\u504f\u7f6e<br \/>\n    # \u521b\u5efa\u65b0\u7684\u5377\u79ef\u5c42<br \/>\n    m &#061; torch.nn.Conv2d(w.size(1) * self.c.groups, w.size(0), w.shape[2:], stride&#061;self.c.stride, padding&#061;self.c.padding, dilation&#061;self.c.dilation, groups&#061;self.c.groups)<br \/>\n    m.weight.data.copy_(w)  # \u590d\u5236\u6743\u91cd<br \/>\n    m.bias.data.copy_(b)  # \u590d\u5236\u504f\u7f6e<br \/>\n    return m<\/p>\n<p>\u5b9a\u4e49EfficientViT\u7684\u57fa\u672c\u6a21\u5757<br \/>\nclass EfficientViTBlock(torch.nn.Module):<br \/>\ndef init(self, embed_dim, key_dim, num_heads&#061;8, window_resolution&#061;7):<br \/>\nsuper().init()<br \/>\n# \u5b9a\u4e49\u5377\u79ef\u5c42\u548c\u524d\u9988\u7f51\u7edc<br \/>\nself.dw0 &#061; Residual(Conv2d_BN(embed_dim, embed_dim, 3, 1, 1, groups&#061;embed_dim))<br \/>\nself.ffn0 &#061; Residual(FFN(embed_dim, int(embed_dim * 2)))<br \/>\nself.mixer &#061; Residual(LocalWindowAttention(embed_dim, key_dim, num_heads, window_resolution&#061;window_resolution))<br \/>\nself.dw1 &#061; Residual(Conv2d_BN(embed_dim, embed_dim, 3, 1, 1, groups&#061;embed_dim))<br \/>\nself.ffn1 &#061; Residual(FFN(embed_dim, int(embed_dim * 2)))<\/p>\n<p>def forward(self, x):<br \/>\n    # \u524d\u5411\u4f20\u64ad<br \/>\n    return self.ffn1(self.dw1(self.mixer(self.ffn0(self.dw0(x)))))<\/p>\n<p>\u5b9a\u4e49EfficientViT\u6a21\u578b<br \/>\nclass EfficientViT(torch.nn.Module):<br \/>\ndef init(self, img_size&#061;400, patch_size&#061;16, embed_dim&#061;[64, 128, 192], depth&#061;[1, 2, 3], num_heads&#061;[4, 4, 4], window_size&#061;[7, 7, 7]):<br \/>\nsuper().init()<br \/>\n# \u5b9a\u4e49\u56fe\u50cf\u5d4c\u5165\u5c42<br \/>\nself.patch_embed &#061; torch.nn.Sequential(<br \/>\nConv2d_BN(3, embed_dim[0] \/\/ 8, 3, 2, 1),<br \/>\nnn.ReLU(),<br \/>\nConv2d_BN(embed_dim[0] \/\/ 8, embed_dim[0] \/\/ 4, 3, 2, 1),<br \/>\nnn.ReLU(),<br \/>\nConv2d_BN(embed_dim[0] \/\/ 4, embed_dim[0] \/\/ 2, 3, 2, 1),<br \/>\nnn.ReLU(),<br \/>\nConv2d_BN(embed_dim[0] \/\/ 2, embed_dim[0], 3, 1, 1)<br \/>\n)<\/p>\n<p>    # \u5b9a\u4e49\u591a\u4e2aEfficientViTBlock<br \/>\n    self.blocks &#061; []<br \/>\n    for i in range(len(depth)):<br \/>\n        for _ in range(depth[i]):<br \/>\n            self.blocks.append(EfficientViTBlock(embed_dim[i], key_dim&#061;16, num_heads&#061;num_heads[i], window_resolution&#061;window_size[i]))<br \/>\n    self.blocks &#061; torch.nn.Sequential(*self.blocks)<\/p>\n<p>def forward(self, x):<br \/>\n    # \u524d\u5411\u4f20\u64ad<br \/>\n    x &#061; self.patch_embed(x)  # \u56fe\u50cf\u5d4c\u5165<br \/>\n    x &#061; self.blocks(x)  # \u901a\u8fc7\u591a\u4e2aEfficientViTBlock<br \/>\n    return x<\/p>\n<p>\u521b\u5efaEfficientViT\u6a21\u578b\u5b9e\u4f8b<br \/>\nif name &#061;&#061; \u2018main\u2019:<br \/>\nmodel &#061; EfficientViT(img_size&#061;224, patch_size&#061;16)<br \/>\ninputs &#061; torch.randn((1, 3, 640, 640))  # \u968f\u673a\u8f93\u5165<br \/>\nres &#061; model(inputs)  # \u524d\u5411\u4f20\u64ad<br \/>\nprint(res.size())  # \u8f93\u51fa\u7ed3\u679c\u7684\u5c3a\u5bf8<br \/>\n\u4ee3\u7801\u6ce8\u91ca\u8bf4\u660e&#xff1a;<br \/>\nConv2d_BN\u7c7b&#xff1a;\u8be5\u7c7b\u5c01\u88c5\u4e86\u5377\u79ef\u5c42\u548c\u6279\u5f52\u4e00\u5316\u5c42&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e2a\u65b9\u6cd5\u6765\u5c06\u5176\u878d\u5408\u4e3a\u4e00\u4e2a\u5377\u79ef\u5c42&#xff0c;\u4ee5\u63d0\u9ad8\u63a8\u7406\u901f\u5ea6\u3002<br \/>\nEfficientViTBlock\u7c7b&#xff1a;\u8fd9\u662fEfficientViT\u7684\u57fa\u672c\u6784\u5efa\u5757&#xff0c;\u5305\u542b\u4e86\u5377\u79ef\u5c42\u3001\u524d\u9988\u7f51\u7edc\u548c\u5c40\u90e8\u7a97\u53e3\u6ce8\u610f\u529b\u673a\u5236\u3002<br \/>\nEfficientViT\u7c7b&#xff1a;\u5b9a\u4e49\u4e86\u6574\u4e2aEfficientViT\u6a21\u578b&#xff0c;\u5305\u62ec\u56fe\u50cf\u5d4c\u5165\u5c42\u548c\u591a\u4e2aEfficientViTBlock\u7684\u5806\u53e0\u3002<br \/>\n\u524d\u5411\u4f20\u64ad&#xff1a;\u6a21\u578b\u7684\u524d\u5411\u4f20\u64ad\u8fc7\u7a0b&#xff0c;\u9996\u5148\u5c06\u8f93\u5165\u56fe\u50cf\u5d4c\u5165&#xff0c;\u7136\u540e\u901a\u8fc7\u591a\u4e2a\u5757\u8fdb\u884c\u5904\u7406&#xff0c;\u6700\u7ec8\u8f93\u51fa\u7279\u5f81\u3002<br \/>\n\u8fd9\u4e2a\u7a0b\u5e8f\u6587\u4ef6\u5b9e\u73b0\u4e86\u4e00\u4e2a\u9ad8\u6548\u7684\u89c6\u89c9\u53d8\u6362\u5668&#xff08;EfficientViT&#xff09;\u6a21\u578b\u67b6\u6784&#xff0c;\u9002\u7528\u4e8e\u5404\u79cd\u4e0b\u6e38\u4efb\u52a1\u3002\u6587\u4ef6\u4e2d\u5305\u542b\u591a\u4e2a\u7c7b\u548c\u51fd\u6570&#xff0c;\u6784\u6210\u4e86\u6a21\u578b\u7684\u6574\u4f53\u7ed3\u6784\u548c\u529f\u80fd\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u6587\u4ef6\u5f15\u5165\u4e86\u5fc5\u8981\u7684\u5e93&#xff0c;\u5305\u62ecPyTorch\u53ca\u5176\u76f8\u5173\u6a21\u5757\u3002\u63a5\u7740\u5b9a\u4e49\u4e86\u4e00\u4e2a\u540d\u4e3aConv2d_BN\u7684\u7c7b&#xff0c;\u8be5\u7c7b\u662f\u4e00\u4e2a\u5305\u542b\u5377\u79ef\u5c42\u548c\u6279\u5f52\u4e00\u5316\u5c42\u7684\u987a\u5e8f\u5bb9\u5668\u3002\u8fd9\u4e2a\u7c7b\u5728\u521d\u59cb\u5316\u65f6\u8bbe\u7f6e\u4e86\u5377\u79ef\u5c42\u7684\u53c2\u6570&#xff0c;\u5e76\u5bf9\u6279\u5f52\u4e00\u5316\u5c42\u7684\u6743\u91cd\u548c\u504f\u7f6e\u8fdb\u884c\u4e86\u521d\u59cb\u5316\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2aswitch_to_deploy\u65b9\u6cd5&#xff0c;\u7528\u4e8e\u5728\u63a8\u7406\u9636\u6bb5\u5c06\u6279\u5f52\u4e00\u5316\u5c42\u8f6c\u6362\u4e3a\u5377\u79ef\u5c42\u3002<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;replace_batchnorm\u51fd\u6570\u7528\u4e8e\u904d\u5386\u7f51\u7edc\u4e2d\u7684\u6240\u6709\u5b50\u6a21\u5757&#xff0c;\u5c06\u6279\u5f52\u4e00\u5316\u5c42\u66ff\u6362\u4e3a\u6052\u7b49\u6620\u5c04&#xff0c;\u4ee5\u4fbf\u5728\u63a8\u7406\u65f6\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<p>PatchMerging\u7c7b\u5b9e\u73b0\u4e86\u5bf9\u8f93\u5165\u7279\u5f81\u56fe\u7684\u5408\u5e76\u64cd\u4f5c&#xff0c;\u4f7f\u7528\u591a\u4e2a\u5377\u79ef\u5c42\u548c\u6fc0\u6d3b\u51fd\u6570\u6765\u5904\u7406\u8f93\u5165\u6570\u636e\u3002Residual\u7c7b\u5219\u5b9e\u73b0\u4e86\u6b8b\u5dee\u8fde\u63a5\u7684\u529f\u80fd&#xff0c;\u53ef\u4ee5\u5728\u8bad\u7ec3\u65f6\u968f\u673a\u4e22\u5f03\u90e8\u5206\u8f93\u5165&#xff0c;\u4ee5\u589e\u5f3a\u6a21\u578b\u7684\u9c81\u68d2\u6027\u3002<\/p>\n<p>FFN\u7c7b\u5b9e\u73b0\u4e86\u524d\u9988\u795e\u7ecf\u7f51\u7edc&#xff0c;\u5305\u542b\u4e24\u4e2a\u5377\u79ef\u5c42\u548c\u4e00\u4e2aReLU\u6fc0\u6d3b\u51fd\u6570\u3002CascadedGroupAttention\u548cLocalWindowAttention\u7c7b\u5b9e\u73b0\u4e86\u4e0d\u540c\u7c7b\u578b\u7684\u6ce8\u610f\u529b\u673a\u5236&#xff0c;\u7528\u4e8e\u5904\u7406\u8f93\u5165\u7279\u5f81\u56fe\u4e2d\u7684\u4fe1\u606f\u3002\u5b83\u4eec\u901a\u8fc7\u5206\u7ec4\u5377\u79ef\u548c\u6ce8\u610f\u529b\u673a\u5236\u6765\u63d0\u53d6\u7279\u5f81\u3002<\/p>\n<p>EfficientViTBlock\u7c7b\u662f\u9ad8\u6548\u89c6\u89c9\u53d8\u6362\u5668\u7684\u57fa\u672c\u6784\u5efa\u5757&#xff0c;\u7ed3\u5408\u4e86\u5377\u79ef\u5c42\u3001\u524d\u9988\u7f51\u7edc\u548c\u6ce8\u610f\u529b\u673a\u5236\u3002EfficientViT\u7c7b\u5219\u662f\u6574\u4e2a\u6a21\u578b\u7684\u4e3b\u7c7b&#xff0c;\u8d1f\u8d23\u6784\u5efa\u6a21\u578b\u7684\u4e0d\u540c\u9636\u6bb5&#xff0c;\u5305\u62ec\u56fe\u50cf\u5d4c\u5165\u3001\u591a\u4e2aEfficientViT\u5757\u7684\u5806\u53e0\u7b49\u3002<\/p>\n<p>\u5728\u6a21\u578b\u7684\u521d\u59cb\u5316\u8fc7\u7a0b\u4e2d&#xff0c;\u7528\u6237\u53ef\u4ee5\u8bbe\u7f6e\u56fe\u50cf\u5927\u5c0f\u3001\u8865\u4e01\u5927\u5c0f\u3001\u5d4c\u5165\u7ef4\u5ea6\u3001\u6df1\u5ea6\u3001\u6ce8\u610f\u529b\u5934\u6570\u7b49\u53c2\u6570\u3002\u6a21\u578b\u7684\u524d\u5411\u4f20\u64ad\u65b9\u6cd5\u8fd4\u56de\u4e86\u591a\u4e2a\u9636\u6bb5\u7684\u8f93\u51fa&#xff0c;\u4fbf\u4e8e\u4e0b\u6e38\u4efb\u52a1\u7684\u4f7f\u7528\u3002<\/p>\n<p>\u6700\u540e&#xff0c;\u6587\u4ef6\u5b9a\u4e49\u4e86\u4e00\u4e9b\u4e0d\u540c\u914d\u7f6e\u7684EfficientViT\u6a21\u578b&#xff08;\u5982EfficientViT_m0\u5230EfficientViT_m5&#xff09;&#xff0c;\u5e76\u63d0\u4f9b\u4e86\u76f8\u5e94\u7684\u6784\u5efa\u51fd\u6570\u3002\u8fd9\u4e9b\u51fd\u6570\u5141\u8bb8\u7528\u6237\u52a0\u8f7d\u9884\u8bad\u7ec3\u6743\u91cd&#xff0c;\u5e76\u9009\u62e9\u662f\u5426\u878d\u5408\u6279\u5f52\u4e00\u5316\u5c42\u3002<\/p>\n<p>\u5728__main__\u90e8\u5206&#xff0c;\u793a\u4f8b\u4ee3\u7801\u5c55\u793a\u4e86\u5982\u4f55\u5b9e\u4f8b\u5316\u4e00\u4e2aEfficientViT\u6a21\u578b&#xff0c;\u5e76\u5bf9\u968f\u673a\u8f93\u5165\u8fdb\u884c\u524d\u5411\u4f20\u64ad&#xff0c;\u8f93\u51fa\u5404\u4e2a\u9636\u6bb5\u7684\u7279\u5f81\u56fe\u5927\u5c0f\u3002\u6574\u4f53\u4e0a&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7075\u6d3b\u4e14\u9ad8\u6548\u7684\u89c6\u89c9\u53d8\u6362\u5668\u67b6\u6784&#xff0c;\u9002\u7528\u4e8e\u591a\u79cd\u8ba1\u7b97\u673a\u89c6\u89c9\u4efb\u52a1\u3002<\/p>\n<p>10.4 cfpt.py<br \/>\n\u4ee5\u4e0b\u662f\u4fdd\u7559\u7684\u6838\u5fc3\u4ee3\u7801\u90e8\u5206&#xff0c;\u5e76\u6dfb\u52a0\u4e86\u8be6\u7ec6\u7684\u4e2d\u6587\u6ce8\u91ca&#xff1a;<\/p>\n<p>import torch<br \/>\nimport torch.nn as nn<br \/>\nimport torch.nn.functional as F<br \/>\nfrom timm.layers import to_2tuple, trunc_normal_<\/p>\n<p>class CrossLayerPosEmbedding3D(nn.Module):<br \/>\ndef init(self, num_heads&#061;4, window_size&#061;(5, 3, 1), spatial&#061;True):<br \/>\nsuper(CrossLayerPosEmbedding3D, self).init()<br \/>\nself.spatial &#061; spatial  # \u662f\u5426\u4f7f\u7528\u7a7a\u95f4\u4f4d\u7f6e\u5d4c\u5165<br \/>\nself.num_heads &#061; num_heads  # \u6ce8\u610f\u529b\u5934\u7684\u6570\u91cf<br \/>\nself.layer_num &#061; len(window_size)  # \u5c42\u6570<br \/>\n# \u521d\u59cb\u5316\u76f8\u5bf9\u4f4d\u7f6e\u504f\u7f6e\u8868<br \/>\nself.relative_position_bias_table &#061; nn.Parameter(<br \/>\ntorch.zeros((2 * window_size[0] &#8211; 1) * (2 * window_size[0] &#8211; 1), num_heads))<br \/>\n)<br \/>\n# \u8ba1\u7b97\u76f8\u5bf9\u4f4d\u7f6e\u7d22\u5f15<br \/>\nself.register_buffer(\u201crelative_position_index\u201d, self.calculate_relative_position_index(window_size))<br \/>\ntrunc_normal_(self.relative_position_bias_table, std&#061;.02)  # \u521d\u59cb\u5316\u76f8\u5bf9\u4f4d\u7f6e\u504f\u7f6e<\/p>\n<p>    # \u521d\u59cb\u5316\u7edd\u5bf9\u4f4d\u7f6e\u504f\u7f6e<br \/>\n    self.absolute_position_bias &#061; nn.Parameter(torch.zeros(len(window_size), num_heads, 1, 1, 1))<br \/>\n    trunc_normal_(self.absolute_position_bias, std&#061;.02)<\/p>\n<p>def calculate_relative_position_index(self, window_size):<br \/>\n    # \u8ba1\u7b97\u76f8\u5bf9\u4f4d\u7f6e\u7d22\u5f15<br \/>\n    coords_h &#061; [torch.arange(ws) &#8211; ws \/\/ 2 for ws in window_size]<br \/>\n    coords_w &#061; [torch.arange(ws) &#8211; ws \/\/ 2 for ws in window_size]<br \/>\n    coords &#061; [torch.stack(torch.meshgrid([coord_h, coord_w])) for coord_h, coord_w in zip(coords_h, coords_w)]<br \/>\n    coords_flatten &#061; torch.cat([torch.flatten(coord, 1) for coord in coords], dim&#061;-1)<br \/>\n    relative_coords &#061; coords_flatten[:, :, None] &#8211; coords_flatten[:, None, :]<br \/>\n    relative_coords &#061; relative_coords.permute(1, 2, 0).contiguous()<br \/>\n    relative_coords[:, :, 0] &#043;&#061; window_size[0] &#8211; 1<br \/>\n    relative_coords[:, :, 1] &#043;&#061; window_size[0] &#8211; 1<br \/>\n    relative_coords[:, :, 0] *&#061; 2 * window_size[0] &#8211; 1<br \/>\n    return relative_coords.sum(-1)<\/p>\n<p>def forward(self):<br \/>\n    # \u8ba1\u7b97\u4f4d\u7f6e\u5d4c\u5165<br \/>\n    pos_indicies &#061; self.relative_position_index.view(-1)<br \/>\n    pos_indicies_floor &#061; torch.floor(pos_indicies).long()<br \/>\n    pos_indicies_ceil &#061; torch.ceil(pos_indicies).long()<br \/>\n    value_floor &#061; self.relative_position_bias_table[pos_indicies_floor]<br \/>\n    value_ceil &#061; self.relative_position_bias_table[pos_indicies_ceil]<br \/>\n    weights_ceil &#061; pos_indicies &#8211; pos_indicies_floor.float()<br \/>\n    weights_floor &#061; 1.0 &#8211; weights_ceil<\/p>\n<p>    pos_embed &#061; weights_floor.unsqueeze(-1) * value_floor &#043; weights_ceil.unsqueeze(-1) * value_ceil<br \/>\n    pos_embed &#061; pos_embed.reshape(1, 1, self.num_token, -1, self.num_heads).permute(0, 4, 1, 2, 3)<\/p>\n<p>    return pos_embed &#043; self.absolute_position_bias<\/p>\n<p>class CrossLayerSpatialAttention(nn.Module):<br \/>\ndef init(self, in_dim, layer_num&#061;3, num_heads&#061;4):<br \/>\nsuper(CrossLayerSpatialAttention, self).init()<br \/>\nself.num_heads &#061; num_heads  # \u6ce8\u610f\u529b\u5934\u7684\u6570\u91cf<br \/>\nself.hidden_dim &#061; in_dim \/\/ 4  # \u9690\u85cf\u7ef4\u5ea6<br \/>\nself.qkv &#061; nn.Conv2d(in_dim, self.hidden_dim * 3, kernel_size&#061;1)  # \u7ebf\u6027\u53d8\u6362<br \/>\nself.softmax &#061; nn.Softmax(dim&#061;-1)  # softmax\u5c42<br \/>\nself.pos_embed &#061; CrossLayerPosEmbedding3D(num_heads&#061;num_heads)  # \u4f4d\u7f6e\u5d4c\u5165<\/p>\n<p>def forward(self, x_list):<br \/>\n    q_list, k_list, v_list &#061; [], [], []<\/p>\n<p>    for x in x_list:<br \/>\n        qkv &#061; self.qkv(x)  # \u8ba1\u7b97Q, K, V<br \/>\n        q, k, v &#061; qkv.chunk(3, dim&#061;1)  # \u5206\u5272Q, K, V<br \/>\n        q_list.append(q)<br \/>\n        k_list.append(k)<br \/>\n        v_list.append(v)<\/p>\n<p>    # \u5c06Q, K, V\u5806\u53e0\u5728\u4e00\u8d77<br \/>\n    q_stack &#061; torch.cat(q_list, dim&#061;1)<br \/>\n    k_stack &#061; torch.cat(k_list, dim&#061;1)<br \/>\n    v_stack &#061; torch.cat(v_list, dim&#061;1)<\/p>\n<p>    # \u8ba1\u7b97\u6ce8\u610f\u529b<br \/>\n    attn &#061; F.normalize(q_stack, dim&#061;-1) &#064; F.normalize(k_stack, dim&#061;-1).transpose(-1, -2)<br \/>\n    attn &#061; attn &#043; self.pos_embed()  # \u52a0\u5165\u4f4d\u7f6e\u5d4c\u5165<br \/>\n    attn &#061; self.softmax(attn)  # \u5f52\u4e00\u5316<\/p>\n<p>    out &#061; attn &#064; v_stack  # \u8ba1\u7b97\u8f93\u51fa<br \/>\n    return out  # \u8fd4\u56de\u8f93\u51fa<\/p>\n<p>\u4ee3\u7801\u6838\u5fc3\u90e8\u5206\u8bf4\u660e&#xff1a;<br \/>\nCrossLayerPosEmbedding3D: \u8be5\u7c7b\u7528\u4e8e\u8ba1\u7b97\u8de8\u5c42\u76843D\u4f4d\u7f6e\u5d4c\u5165&#xff0c;\u5305\u62ec\u76f8\u5bf9\u4f4d\u7f6e\u504f\u7f6e\u548c\u7edd\u5bf9\u4f4d\u7f6e\u504f\u7f6e\u7684\u521d\u59cb\u5316\u548c\u8ba1\u7b97\u3002<br \/>\nCrossLayerSpatialAttention: \u8be5\u7c7b\u5b9e\u73b0\u4e86\u8de8\u5c42\u7a7a\u95f4\u6ce8\u610f\u529b\u673a\u5236&#xff0c;\u5305\u542bQ\u3001K\u3001V\u7684\u8ba1\u7b97\u548c\u6ce8\u610f\u529b\u7684\u8ba1\u7b97\u903b\u8f91\u3002<br \/>\nforward\u65b9\u6cd5: \u5728\u8fd9\u4e24\u4e2a\u7c7b\u4e2d&#xff0c;forward\u65b9\u6cd5\u5b9a\u4e49\u4e86\u5982\u4f55\u5904\u7406\u8f93\u5165\u6570\u636e\u5e76\u8ba1\u7b97\u8f93\u51fa\u3002\u5bf9\u4e8eCrossLayerSpatialAttention&#xff0c;\u5b83\u5c06\u8f93\u5165\u5206\u4e3aQ\u3001K\u3001V&#xff0c;\u5e76\u8ba1\u7b97\u6ce8\u610f\u529b\u8f93\u51fa\u3002<br \/>\n\u4ee5\u4e0a\u4ee3\u7801\u5c55\u793a\u4e86\u8de8\u5c42\u6ce8\u610f\u529b\u673a\u5236\u7684\u6838\u5fc3\u903b\u8f91&#xff0c;\u6ce8\u91ca\u8be6\u7ec6\u89e3\u91ca\u4e86\u6bcf\u4e2a\u90e8\u5206\u7684\u529f\u80fd\u548c\u4f5c\u7528\u3002<\/p>\n<p>\u8fd9\u4e2a\u7a0b\u5e8f\u6587\u4ef6 cfpt.py \u5b9e\u73b0\u4e86\u4e24\u4e2a\u4e3b\u8981\u7684\u795e\u7ecf\u7f51\u7edc\u6a21\u5757&#xff1a;CrossLayerChannelAttention \u548c CrossLayerSpatialAttention&#xff0c;\u5b83\u4eec\u90fd\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6 PyTorch\u3002\u6587\u4ef6\u4e2d\u8fd8\u5b9a\u4e49\u4e86\u4e00\u4e9b\u8f85\u52a9\u7c7b\u548c\u51fd\u6570&#xff0c;\u7528\u4e8e\u5b9e\u73b0\u7279\u5b9a\u7684\u529f\u80fd&#xff0c;\u5982\u4f4d\u7f6e\u7f16\u7801\u3001\u5377\u79ef\u64cd\u4f5c\u548c\u7a97\u53e3\u5212\u5206\u7b49\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u6587\u4ef6\u5bfc\u5165\u4e86\u5fc5\u8981\u7684\u5e93&#xff0c;\u5305\u62ec PyTorch\u3001\u6570\u5b66\u5e93\u3001einops&#xff08;\u7528\u4e8e\u5f20\u91cf\u91cd\u6392&#xff09;\u3001\u4ee5\u53ca\u4e00\u4e9b PyTorch \u7684\u6a21\u5757\u548c\u529f\u80fd\u3002\u63a5\u7740&#xff0c;\u5b9a\u4e49\u4e86\u4e00\u4e2a LayerNormProxy \u7c7b&#xff0c;\u8be5\u7c7b\u5c01\u88c5\u4e86 PyTorch \u7684\u5c42\u5f52\u4e00\u5316\u529f\u80fd&#xff0c;\u5e76\u5728\u524d\u5411\u4f20\u64ad\u4e2d\u8c03\u6574\u8f93\u5165\u5f20\u91cf\u7684\u7ef4\u5ea6\u3002<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;CrossLayerPosEmbedding3D \u7c7b\u7528\u4e8e\u751f\u6210\u8de8\u5c42\u4f4d\u7f6e\u5d4c\u5165\u3002\u5b83\u6839\u636e\u7ed9\u5b9a\u7684\u7a97\u53e3\u5927\u5c0f\u548c\u5934\u6570\u521d\u59cb\u5316\u76f8\u5bf9\u4f4d\u7f6e\u504f\u7f6e\u8868&#xff0c;\u5e76\u8ba1\u7b97\u76f8\u5bf9\u4f4d\u7f6e\u7d22\u5f15\u3002\u8be5\u7c7b\u7684\u524d\u5411\u65b9\u6cd5\u751f\u6210\u4f4d\u7f6e\u5d4c\u5165&#xff0c;\u7528\u4e8e\u540e\u7eed\u7684\u6ce8\u610f\u529b\u8ba1\u7b97\u3002<\/p>\n<p>ConvPosEnc \u7c7b\u5b9e\u73b0\u4e86\u5377\u79ef\u4f4d\u7f6e\u7f16\u7801&#xff0c;\u4f7f\u7528\u6df1\u5ea6\u53ef\u5206\u79bb\u5377\u79ef\u6765\u589e\u5f3a\u7279\u5f81\u56fe&#xff0c;\u5e76\u53ef\u9009\u62e9\u6027\u5730\u6dfb\u52a0\u6fc0\u6d3b\u51fd\u6570\u3002DWConv \u7c7b\u5219\u5b9e\u73b0\u4e86\u6df1\u5ea6\u5377\u79ef\u64cd\u4f5c&#xff0c;\u7528\u4e8e\u5904\u7406\u8f93\u5165\u7279\u5f81\u56fe\u3002<\/p>\n<p>Mlp \u7c7b\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u591a\u5c42\u611f\u77e5\u673a&#xff08;MLP&#xff09;&#xff0c;\u5305\u542b\u4e24\u4e2a\u7ebf\u6027\u5c42\u548c\u4e00\u4e2a\u6fc0\u6d3b\u51fd\u6570\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u7684\u51e0\u4e2a\u51fd\u6570\u5b9e\u73b0\u4e86\u7a97\u53e3\u5212\u5206\u548c\u9006\u64cd\u4f5c&#xff0c;\u4e3b\u8981\u7528\u4e8e\u5904\u7406\u8f93\u5165\u7279\u5f81\u56fe\u7684\u91cd\u7ec4\u548c\u6062\u590d&#xff0c;\u652f\u6301\u91cd\u53e0\u7a97\u53e3\u7684\u5904\u7406\u3002<\/p>\n<p>CrossLayerSpatialAttention \u7c7b\u5b9e\u73b0\u4e86\u7a7a\u95f4\u6ce8\u610f\u529b\u673a\u5236\u3002\u5b83\u901a\u8fc7\u591a\u5c42\u5377\u79ef\u3001\u5f52\u4e00\u5316\u548c\u6ce8\u610f\u529b\u8ba1\u7b97\u6765\u5904\u7406\u8f93\u5165\u7279\u5f81\u56fe\u3002\u8be5\u7c7b\u7684\u524d\u5411\u65b9\u6cd5\u63a5\u6536\u591a\u4e2a\u8f93\u5165\u7279\u5f81\u56fe&#xff0c;\u8ba1\u7b97\u67e5\u8be2\u3001\u952e\u3001\u503c&#xff0c;\u5e76\u901a\u8fc7\u6ce8\u610f\u529b\u673a\u5236\u751f\u6210\u8f93\u51fa\u7279\u5f81\u56fe\u3002\u5b83\u8fd8\u4f7f\u7528\u4e86\u4e4b\u524d\u5b9a\u4e49\u7684\u5377\u79ef\u4f4d\u7f6e\u7f16\u7801\u548c\u4f4d\u7f6e\u5d4c\u5165\u3002<\/p>\n<p>CrossLayerChannelAttention \u7c7b\u5b9e\u73b0\u4e86\u901a\u9053\u6ce8\u610f\u529b\u673a\u5236&#xff0c;\u7ed3\u6784\u4e0e\u7a7a\u95f4\u6ce8\u610f\u529b\u7c7b\u4f3c&#xff0c;\u4f46\u5904\u7406\u65b9\u5f0f\u4e0d\u540c\u3002\u5b83\u4f7f\u7528\u901a\u9053\u5212\u5206\u548c\u9006\u64cd\u4f5c\u6765\u5b9e\u73b0\u5bf9\u8f93\u5165\u7279\u5f81\u56fe\u7684\u5904\u7406\u3002\u8be5\u7c7b\u540c\u6837\u5728\u524d\u5411\u65b9\u6cd5\u4e2d\u63a5\u6536\u591a\u4e2a\u8f93\u5165\u7279\u5f81\u56fe&#xff0c;\u8ba1\u7b97\u6ce8\u610f\u529b\u5e76\u751f\u6210\u8f93\u51fa\u3002<\/p>\n<p>\u6574\u4f53\u6765\u770b&#xff0c;\u8fd9\u4e2a\u6587\u4ef6\u5b9e\u73b0\u4e86\u4e00\u4e2a\u590d\u6742\u7684\u6ce8\u610f\u529b\u673a\u5236&#xff0c;\u65e8\u5728\u63d0\u9ad8\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5728\u5904\u7406\u56fe\u50cf\u6216\u5176\u4ed6\u9ad8\u7ef4\u6570\u636e\u65f6\u7684\u6027\u80fd\u3002\u901a\u8fc7\u8de8\u5c42\u7684\u901a\u9053\u548c\u7a7a\u95f4\u6ce8\u610f\u529b&#xff0c;\u6a21\u578b\u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u7279\u5f81\u4e4b\u95f4\u7684\u5173\u7cfb&#xff0c;\u4ece\u800c\u63d0\u5347\u7279\u5f81\u8868\u793a\u7684\u80fd\u529b\u3002<\/p>\n<h2>\u6e90\u7801\u6587\u4ef6<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221947-68991b0318394.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h2>\u6e90\u7801\u83b7\u53d6<\/h2>\n<p>\u6b22\u8fce\u5927\u5bb6\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u5173\u6ce8\u3001\u8bc4\u8bba\u5566 \u3001\u67e5\u770b&#x1f447;&#x1f3fb;\u83b7\u53d6\u8054\u7cfb\u65b9\u5f0f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb176\u6b21\u3002\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3<\/p>\n","protected":false},"author":2,"featured_media":51729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,156,2842,5134,1908,5133,523,5132],"topic":[],"class_list":["post-51738","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-python","tag-yolo","tag-yolo11","tag-5134","tag-1908","tag-5133","tag-523","tag-5132"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/51738.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb176\u6b21\u3002\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51738.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T22:19:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221943-68991aff74e5f.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51738.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51738.html\",\"name\":\"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T22:19:48+00:00\",\"dateModified\":\"2025-08-10T22:19:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51738.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51738.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51738.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/51738.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb176\u6b21\u3002\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3","og_url":"https:\/\/www.wsisp.com\/helps\/51738.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T22:19:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810221943-68991aff74e5f.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51738.html","url":"https:\/\/www.wsisp.com\/helps\/51738.html","name":"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T22:19:48+00:00","dateModified":"2025-08-10T22:19:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51738.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51738.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51738.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u5b8c\u6574\u6e90\u7801+\u6570\u636e\u96c6+\u90e8\u7f72\u6559\u7a0b\u3011\u773c\u5e95\u56fe\u50cf\u5c42\u6b21\u5206\u5272\u7cfb\u7edf\u6e90\u7801\u548c\u6570\u636e\u96c6\uff1a\u6539\u8fdbyolo11-DCNV3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=51738"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51738\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/51729"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51738"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}