cv_mobilenet-v2_bad-image-detecting 在昇腾 NPU 上的部署
1. 简介
- 模型来源:damo/cv_mobilenet-v2_bad-image-detecting
- 架构:MobileNetV2(自定义宽度,3 分类器)
- 参数量:399,971
- 任务:不良图片检测(3 类)
- 适配状态:成功
- 适配时间:2026-05-17
2. 验证环境
| 组件 | 版本 |
|---|
| torch | 2.9.0 |
| torch-npu | 2.9.0.post1 |
| CANN | 8.5.1 |
| NPU | Ascend 910B4 |
3. 精度评测
| 指标 | 数值 |
|---|
| 余弦相似度 | 1.000000 |
| 最大绝对误差 | 0.004929 |
| 是否满足要求 | 是(< 1%) |
4. 性能
| 指标 | 数值 |
|---|
| 平均延迟 | 4.63 毫秒 |
| 输出形状 | [1, 3] |
5. 适配说明
采用自定义 MobileNetV2 架构(width_mult=0.5),通过 checkpoint 反推各 InvertedResidual 模块的隐藏通道数。输入为 RGB 图像(batch, 3, 224, 224)。
6. 推理输出证据
Model: damo/cv_mobilenet-v2_bad-image-detecting
Output shape: [1, 3]
Latency: 4.63ms
Cosine Similarity: 1.000000
Max Abs Error: 0.004929
7. CPU 与 NPU 精度对比
| 指标 | CPU | NPU | 差异 |
|---|
| 余弦相似度 | 1.0 | 1.000000 | 0% |
| 最大绝对误差 | - | 0.004929 | - |