File size: 15,481 Bytes
3209708
 
3134de2
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
abc2516
 
 
 
 
 
 
 
 
 
 
 
3209708
 
 
abc2516
 
 
 
 
 
 
3209708
 
 
 
 
3134de2
3209708
 
3134de2
3209708
 
3134de2
3209708
3134de2
 
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3134de2
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3134de2
3209708
 
3134de2
3209708
 
3134de2
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3134de2
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3134de2
3209708
 
3134de2
3209708
 
3134de2
3209708
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
abc2516
3209708
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
{
  "name": "Swin-Transformer",
  "id": "ko3ugg54j400",
  "description": "Swin-Transformer是针对于图片处理设计的基于Transformer架构的神经网络。该网络针对原始Transformer迁移到图片端后计算量过大,复用困难的问题,提出了新的swin-block以代替原有的attention架构。模型以窗口的attention方式极大地减少了图像不同区域间的互相响应,同时也避免了部分冗余信息的产生。最终,模型在减少了大量计算量的同时,在不同的视觉传统任务上也有了效果的提升。",
  "category": "计算机视觉",
  "framework": [
    "PyTorch"
  ],
  "supportOs": [
    "OpenHarmony",
    "Linux"
  ],
  "computingPower": [
    "Hi3403V100 SVP_NNN",
    "Hi3403V100 NNN"
  ],
  "tags": [
    "分类"
  ],
  "repositoryUrl": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/classification/Swin-Transformer",
  "licenseUrl": "https://github.com/microsoft/Swin-Transformer/blob/main/LICENSE",
  "downloads": [
    {
      "fileName": "swin.onnx",
      "variants": [
        "源模型 / 源模型元数据"
      ]
    },
    {
      "fileName": "swin_tiny_patch4_window7_224.pth",
      "variants": [
        "源模型 / 源模型元数据"
      ]
    },
    {
      "fileName": "swin_sim.onnx",
      "variants": [
        "源模型 / 源模型元数据"
      ]
    },
    {
      "fileName": "swin.om",
      "variants": [
        "编译模型 / OM 元数据 / A8W8"
      ]
    },
    {
      "fileName": "swin_dlite.om",
      "variants": [
        "编译模型 / OM 元数据 / FP16"
      ]
    },
    {
      "fileName": "SVP_NNN_PC_V1.0.6.0.tgz",
      "variants": [
        "附加资源 / 附加资源"
      ]
    },
    {
      "fileName": "swin_om-A8W8.om",
      "variants": [
        "编译模型 / 镜像补充 / A8W8"
      ]
    }
  ],
  "apiDetail": {
    "createdBy": 139036723332644,
    "creationDate": "2026-08-26 16:38:28",
    "creationUserCN": "y-0089",
    "lastUpdatedBy": null,
    "lastUpdateDate": "2026-09-01 16:13:06",
    "lastUpdateUserCN": "y-0089",
    "rowIdx": -1,
    "id": "ko3ugg54j400",
    "name": "Swin-Transformer",
    "isBeta": 0,
    "betaVersionDesc": "",
    "description": "Swin-Transformer是针对于图片处理设计的基于Transformer架构的神经网络。该网络针对原始Transformer迁移到图片端后计算量过大,复用困难的问题,提出了新的swin-block以代替原有的attention架构。模型以窗口的attention方式极大地减少了图像不同区域间的互相响应,同时也避免了部分冗余信息的产生。最终,模型在减少了大量计算量的同时,在不同的视觉传统任务上也有了效果的提升。",
    "parentId": "h6s4m1ogto00",
    "coverImageId": 1701485580845059,
    "coverImageUrl": "https://openxinhuo-board-image.obs.cn-east-3.myhuaweicloud.com/1701485580845059%2Fswint.png",
    "modelEffectId": null,
    "modelEffectUrl": "",
    "computerVersion": [
      "分类"
    ],
    "naturalLanguageProcess": [],
    "multimodal": [],
    "video": [],
    "framework": [
      "PyTorch"
    ],
    "modelRepository": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/classification/Swin-Transformer",
    "originModel": [
      {
        "id": "1706935124623362",
        "name": "swin.onnx",
        "url": null,
        "size": "115360652"
      },
      {
        "id": "1706935036477443",
        "name": "swin_tiny_patch4_window7_224.pth",
        "url": null,
        "size": "114342173"
      },
      {
        "id": "1706935070031874",
        "name": "swin_sim.onnx",
        "url": null,
        "size": "115268484"
      }
    ],
    "originModelLink": "",
    "dataSet": "https://image-net.org/",
    "modelLicense": "https://github.com/microsoft/Swin-Transformer/blob/main/LICENSE",
    "detailParams": [
      {
        "name": "输入",
        "value": "224x224"
      },
      {
        "name": "参数量",
        "value": "28.798M"
      },
      {
        "name": "计算量",
        "value": "9.567GFLOPs"
      }
    ],
    "quickStart": {
      "url": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/classification/Swin-Transformer",
      "markDownUrl": "",
      "developLanguage": [
        {
          "language": "C++",
          "context": "{\"ops\":[{\"attributes\":{\"size\":\"16px\",\"color\":\"#333333\",\"line-height\":\"inherit\"},\"insert\":\"Swin-Transformer可以通过以下代码完成快速推理, 该代码仅展示主要流程,完整实现参考src/main.cpp文件和readme\"},{\"attributes\":{\"text-indent\":\"0px\"},\"insert\":\"\\n\"},{\"insert\":\"#include \\\"model.h\\\"\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"#include \\\"log.h\\\"\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\\n\"},{\"insert\":\"using namespace Infer;\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\\n\"},{\"insert\":\"int main()\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"{\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    EnvInit();\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    std::string omModelPath = \\\"/path/to/model.om\\\"; // Swin-Transformer 模型文件路径 \"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    std::string imagePath = \\\"/path/to/image.jpg\\\"; // 输入图片路径\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    std::unique_ptr<Model> model = std::make_unique<Model>();\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    if (model->Load(omModelPath, ModelType::SwinT) != 0) {\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        LOG(ERROR) << \\\"fail to load model\\\";\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        return -1;\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    }\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    auto ret = model->Infer(imagePath, FileType::SingelImageFile);\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    if (ret.size() == 0) {\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        LOG(ERROR) << \\\"fail to infer model\\\";\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        model->Unload();\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        return -1;\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    }\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    if (model->Unload() != 0) {\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        LOG(ERROR) << \\\"fail to unload model\\\";\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"        return -1;\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    }\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    EnvDeinit();\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"    return 0;\"},{\"attributes\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"insert\":\"}\"},{\"attributes\":{\"text-indent\":\"0px\",\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"attributes\":{\"size\":\"16px\",\"color\":\"#333333\",\"line-height\":\"inherit\"},\"insert\":\"备注:头文件和动态库位于\"},{\"attributes\":{\"size\":\"16px\",\"color\":\"#4183c4\",\"line-height\":\"inherit\",\"link\":\"https://gitee.com/HiSpark/modelzoo/tree/master/samples/common\"},\"insert\":\"/samples/common\"},{\"attributes\":{\"size\":\"16px\",\"color\":\"#333333\",\"line-height\":\"inherit\"},\"insert\":\"目录下,编译配置参考\"},{\"attributes\":{\"size\":\"16px\",\"color\":\"#4183c4\",\"line-height\":\"inherit\",\"link\":\"https://gitee.com/HiSpark/modelzoo/blob/master/samples/built-in/classification/Swin-Transformer/src/CMakeLists.txt\"},\"insert\":\"文件\"},{\"attributes\":{\"text-indent\":\"0px\"},\"insert\":\"\\n\"}]}"
        }
      ]
    },
    "status": "released",
    "currentHandler": "",
    "currentHandlerName": "",
    "jsonPath": "https://gitee.com/HiSpark/modelzoo-dev/blob/master/samples/built-in/classification/Swin-Transformer/Swin-Transformer.json",
    "modelAdaptor": [
      {
        "createdBy": null,
        "creationDate": null,
        "creationUserCN": null,
        "lastUpdatedBy": null,
        "lastUpdateDate": null,
        "lastUpdateUserCN": null,
        "rowIdx": -1,
        "id": "i8ttm5k1tc00",
        "name": "Hi3403V100 SVP_NNN",
        "modelId": "ko3ugg54j400",
        "modelName": "Swin-Transformer",
        "supportNames": [
          "A8W8"
        ],
        "toolkit": [
          {
            "name": "CANN工具",
            "url": "https://hispark-obs.obs.cn-east-3.myhuaweicloud.com/SVP_NNN_PC_V1.0.6.0.tgz",
            "desc": "Al异构计算架构;提升计算效率的关键平台",
            "imgId": "cann"
          },
          {
            "name": "编译工具链",
            "url": "https://gitee.com/HiSpark/pegasus/blob/Beta-v0.9.1/docs/Hi3403V100%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E6%8C%87%E5%8D%97/Hi3403V100%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E6%8C%87%E5%8D%97.md#241%E5%AE%89%E8%A3%85clang%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91%E5%99%A8",
            "desc": "高效编译,精准适配;AI性能优化,应用流畅运行",
            "imgId": "tool"
          },
          {
            "name": "SDK",
            "url": "https://gitee.com/HiSpark/ss928v100_clang/tree/Beta-v0.9.1/",
            "desc": "稳定、易用的设计;支撑客户快速产品量产",
            "imgId": "sdk"
          }
        ],
        "supportOs": [
          "OpenHarmony",
          "Linux"
        ],
        "supportQuantify": [
          {
            "createdBy": 139036723332644,
            "creationDate": "2026-08-26 16:38:28",
            "creationUserCN": "y-0089",
            "lastUpdatedBy": 139036723332644,
            "lastUpdateDate": "2026-08-26 16:38:28",
            "lastUpdateUserCN": "y-0089",
            "rowIdx": -1,
            "id": "ko3uggecj400",
            "name": "A8W8",
            "computingId": "i8ttm5k1tc00",
            "computingName": "Hi3403V100 SVP_NNN",
            "omOfflineModelUrl": null,
            "omOfflineModelId": 1712880949002241,
            "omOfflineModelSize": "30888496",
            "omOfflineModelName": "swin.om",
            "omOfflineModel": [
              {
                "id": "1734292545798147",
                "name": "swin.om",
                "url": null,
                "size": "30870482"
              }
            ],
            "omOfflineModelLink": null,
            "releaseTime": "2025-11-18",
            "boardOs": "OpenHarmony",
            "modelLicense": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/classification/Swin-Transformer/LICENSE",
            "modelPerformance": [
              {
                "performanceValue": "25.675",
                "unit": "耗时(ms)",
                "desc": ""
              },
              {
                "performanceValue": "38.949",
                "unit": "性能(fps)",
                "desc": ""
              },
              {
                "performanceValue": "295.711",
                "unit": "单帧内存带宽(MB)",
                "desc": ""
              },
              {
                "performanceValue": "38.176",
                "unit": "内存(MB)",
                "desc": ""
              }
            ],
            "deleted": 0
          }
        ],
        "deleted": 0
      },
      {
        "createdBy": null,
        "creationDate": null,
        "creationUserCN": null,
        "lastUpdatedBy": null,
        "lastUpdateDate": null,
        "lastUpdateUserCN": null,
        "rowIdx": -1,
        "id": "i8ttm5k1tc01",
        "name": "Hi3403V100 NNN",
        "modelId": "ko3ugg54j400",
        "modelName": "Swin-Transformer",
        "supportNames": [
          "A8W8",
          "FP16"
        ],
        "toolkit": [
          {
            "name": "CANN工具",
            "url": "",
            "desc": "5.30.t11.7.b110; (请联系FAE获取)",
            "imgId": "cann"
          },
          {
            "name": "编译工具链",
            "url": "",
            "desc": "aarch64-mix210-linux-gcc;(请联系FAE获取)",
            "imgId": "tool"
          },
          {
            "name": "SDK",
            "url": "",
            "desc": "SS928 V100R001C02SPC022; (请联系FAE获取)",
            "imgId": "sdk"
          }
        ],
        "supportOs": [
          "Linux"
        ],
        "supportQuantify": [
          {
            "createdBy": 139036723332644,
            "creationDate": "2026-08-26 16:38:28",
            "creationUserCN": "y-0089",
            "lastUpdatedBy": 139036723332644,
            "lastUpdateDate": "2026-08-26 16:38:28",
            "lastUpdateUserCN": "y-0089",
            "rowIdx": -1,
            "id": "ko3uggfsj400",
            "name": "FP16",
            "computingId": "i8ttm5k1tc01",
            "computingName": "Hi3403V100 NNN",
            "omOfflineModelUrl": null,
            "omOfflineModelId": 1712880995074050,
            "omOfflineModelSize": "62380441",
            "omOfflineModelName": "swin_dlite.om",
            "omOfflineModel": [
              {
                "id": "1712880995074050",
                "name": "swin_dlite.om",
                "url": null,
                "size": "62380441"
              }
            ],
            "omOfflineModelLink": null,
            "releaseTime": "2025-11-18",
            "boardOs": "Linux",
            "modelLicense": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/classification/Swin-Transformer/LICENSE",
            "modelPerformance": [
              {
                "performanceValue": "101.97",
                "unit": "耗时(ms)",
                "desc": "性能工具。"
              },
              {
                "performanceValue": "9.81",
                "unit": "性能(fps)",
                "desc": "性能工具。"
              },
              {
                "performanceValue": "494.766",
                "unit": "单帧内存带宽(MB)",
                "desc": ""
              },
              {
                "performanceValue": "215.668",
                "unit": "内存(MB)",
                "desc": ""
              }
            ],
            "deleted": 0
          }
        ],
        "deleted": 0
      }
    ],
    "saveType": null,
    "deleteType": null,
    "latest": "Y",
    "deleted": 0,
    "modelPhase": "released",
    "remark": null,
    "fileInfo": null,
    "reviewType": null,
    "owner": "y-0089",
    "ownerBy": 139036723332644,
    "optional": null,
    "optionalList": [
      "0e900d99dee8461b8"
    ],
    "optionalBy": null,
    "downloadNum": 53,
    "collectNum": null,
    "isCollect": null
  }
}