File size: 14,366 Bytes
12b1aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
  "name": "CodeFormer",
  "id": "ib6scq68vs00",
  "description": "CodeFormer 是一种基于码本查找 Transformer 的鲁棒盲人脸修复模型。相比传统方法,它通过生成对抗网络与量化编码技术,能有效处理模糊、噪声等多种退化问题,兼顾人脸修复质量与身份保真度,适用于盲人脸恢复场景。",
  "category": "计算机视觉",
  "framework": [
    "PyTorch"
  ],
  "supportOs": [
    "OpenHarmony",
    "Linux"
  ],
  "computingPower": [
    "Hi3403V100 SVP_NNN",
    "Hi3403V100 NNN"
  ],
  "tags": [
    "图像增强"
  ],
  "repositoryUrl": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/super_resolution/CodeFormer/",
  "licenseUrl": "https://github.com/sczhou/CodeFormer/blob/master/LICENSE",
  "downloads": [
    {
      "fileName": "空文件,因为该模型仅用于非商用.onnx",
      "variants": [
        "源模型 / 源模型下载",
        "源模型 / 源模型元数据",
        "编译模型 / OM 元数据 / a16w8"
      ]
    },
    {
      "fileName": "SVP_NNN_PC_V1.0.6.0.tgz",
      "variants": [
        "附加资源 / 附加资源"
      ]
    }
  ],
  "apiDetail": {
    "createdBy": 139318985286440,
    "creationDate": "2025-12-30 17:56:29",
    "creationUserCN": "sloanqin",
    "lastUpdatedBy": null,
    "lastUpdateDate": "2025-12-30 20:02:18",
    "lastUpdateUserCN": "sloanqin",
    "rowIdx": -1,
    "id": "ib6scq68vs00",
    "name": "CodeFormer",
    "isBeta": 0,
    "betaVersionDesc": "",
    "description": "CodeFormer 是一种基于码本查找 Transformer 的鲁棒盲人脸修复模型。相比传统方法,它通过生成对抗网络与量化编码技术,能有效处理模糊、噪声等多种退化问题,兼顾人脸修复质量与身份保真度,适用于盲人脸恢复场景。",
    "parentId": "ib6scq68vs00",
    "coverImageId": 1720510897520642,
    "coverImageUrl": "https://openxinhuo-board-image.obs.cn-east-3.myhuaweicloud.com/1720510897520642%2Fcodeformer.jpg",
    "modelEffectId": null,
    "modelEffectUrl": "",
    "computerVersion": [
      "图像增强"
    ],
    "naturalLanguageProcess": [],
    "multimodal": [],
    "video": [],
    "framework": [
      "PyTorch"
    ],
    "modelRepository": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/super_resolution/CodeFormer/",
    "originModel": [
      {
        "id": "1720510975115266",
        "name": "空文件,因为该模型仅用于非商用.onnx",
        "url": null,
        "size": "3"
      }
    ],
    "originModelLink": null,
    "dataSet": "https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html",
    "modelLicense": "https://github.com/sczhou/CodeFormer/blob/master/LICENSE",
    "detailParams": [
      {
        "name": "输入",
        "value": "512x512"
      },
      {
        "name": "参数量",
        "value": "94.375M"
      },
      {
        "name": "计算量",
        "value": "835.584GFLOPs"
      }
    ],
    "quickStart": {
      "url": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/super_resolution/CodeFormer/",
      "markDownUrl": null,
      "developLanguage": [
        {
          "language": "C++",
          "context": "{\"ops\":[{\"attributes\":{\"line-height\":\"1.6\",\"color\":\"#40485b\",\"size\":\"16px\",\"background\":\"#ffffff\"},\"insert\":\"CodeFormer模型可以通过以下代码完成快速推理\"},{\"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\\\"; // CodeFormer模型文件路径 \"},{\"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::CodeFormer) != 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\":{\"code-block\":\"plain\"},\"insert\":\"\\n\"},{\"attributes\":{\"line-height\":\"1.6\",\"color\":\"#40485b\",\"size\":\"16px\",\"background\":\"#ffffff\"},\"insert\":\"备注:头文件和动态库位于\"},{\"attributes\":{\"line-height\":\"1.6\",\"color\":\"#095eab\",\"size\":\"16px\",\"background\":\"transparent\",\"link\":\"https://gitee.com/HiSpark/modelzoo/tree/master/samples/common\"},\"insert\":\"/samples/common\"},{\"attributes\":{\"line-height\":\"1.6\",\"color\":\"#40485b\",\"size\":\"16px\",\"background\":\"#ffffff\"},\"insert\":\"目录下,编译配置参考\"},{\"attributes\":{\"line-height\":\"1.6\",\"color\":\"#095eab\",\"size\":\"16px\",\"background\":\"transparent\",\"link\":\"https://gitee.com/HiSpark/modelzoo/blob/master/samples/built-in/super_resolution/CodeFormer/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/super_resolution/CodeFormer/codeformer.json",
    "modelAdaptor": [
      {
        "createdBy": null,
        "creationDate": null,
        "creationUserCN": null,
        "lastUpdatedBy": null,
        "lastUpdateDate": null,
        "lastUpdateUserCN": null,
        "rowIdx": -1,
        "id": "i8ttm5k1tc00",
        "name": "Hi3403V100 SVP_NNN",
        "modelId": "ib6scq68vs00",
        "modelName": "CodeFormer",
        "supportNames": [
          "a16w8"
        ],
        "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",
            "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": 132241120926760,
            "creationDate": "2026-03-26 19:52:20",
            "creationUserCN": "liaoshibin",
            "lastUpdatedBy": 132241120926760,
            "lastUpdateDate": "2026-03-26 19:52:20",
            "lastUpdateUserCN": "liaoshibin",
            "rowIdx": -1,
            "id": "j6tfki80i000",
            "name": "a16w8",
            "computingId": "i8ttm5k1tc00",
            "computingName": "Hi3403V100 SVP_NNN",
            "omOfflineModelUrl": null,
            "omOfflineModelId": 1720511059001345,
            "omOfflineModelSize": "3",
            "omOfflineModelName": "空文件,因为该模型仅用于非商用.om",
            "omOfflineModel": [
              {
                "id": "1720511059001345",
                "name": "空文件,因为该模型仅用于非商用.om",
                "url": null,
                "size": "3"
              }
            ],
            "omOfflineModelLink": null,
            "releaseTime": "2025-12-30",
            "boardOs": null,
            "modelLicense": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/super_resolution/CodeFormer/LICENSE",
            "modelPerformance": [
              {
                "performanceValue": "468.72",
                "unit": "耗时(ms)",
                "desc": ""
              },
              {
                "performanceValue": "2.13",
                "unit": "性能(fps)",
                "desc": ""
              },
              {
                "performanceValue": "2356.851",
                "unit": "单帧内存带宽(MB)",
                "desc": ""
              },
              {
                "performanceValue": "264.789",
                "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": "ib6scq68vs00",
        "modelName": "CodeFormer",
        "supportNames": [
          "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": 132241120926760,
            "creationDate": "2026-03-26 19:52:20",
            "creationUserCN": "liaoshibin",
            "lastUpdatedBy": 132241120926760,
            "lastUpdateDate": "2026-03-26 19:52:20",
            "lastUpdateUserCN": "liaoshibin",
            "rowIdx": -1,
            "id": "j6tfki9ki000",
            "name": "fp16",
            "computingId": "i8ttm5k1tc01",
            "computingName": "Hi3403V100 NNN",
            "omOfflineModelUrl": null,
            "omOfflineModelId": 1720511038029825,
            "omOfflineModelSize": "3",
            "omOfflineModelName": "空文件,因为该模型仅用于非商用.om",
            "omOfflineModel": [
              {
                "id": "1720511038029825",
                "name": "空文件,因为该模型仅用于非商用.om",
                "url": null,
                "size": "3"
              }
            ],
            "omOfflineModelLink": null,
            "releaseTime": "2025-12-30",
            "boardOs": null,
            "modelLicense": "https://gitee.com/HiSpark/modelzoo/tree/master/samples/built-in/super_resolution/CodeFormer/LICENSE",
            "modelPerformance": [
              {
                "performanceValue": "1724.14",
                "unit": "耗时(ms)",
                "desc": ""
              },
              {
                "performanceValue": "0.58",
                "unit": "性能(fps)",
                "desc": ""
              },
              {
                "performanceValue": "19676.725",
                "unit": "单帧内存带宽(MB)",
                "desc": ""
              },
              {
                "performanceValue": "877.707",
                "unit": "内存(MB)",
                "desc": ""
              }
            ],
            "deleted": 0
          }
        ],
        "deleted": 0
      }
    ],
    "saveType": null,
    "deleteType": null,
    "latest": "Y",
    "deleted": 0,
    "modelPhase": "released",
    "remark": null,
    "fileInfo": null,
    "reviewType": null,
    "owner": "sloanqin",
    "ownerBy": 139318985286440,
    "optional": null,
    "optionalList": [
      "0e900d99dee8461b8",
      "whalenowings"
    ],
    "optionalBy": null,
    "downloadNum": 63,
    "collectNum": null,
    "isCollect": null
  }
}