xujiashuai/timm-cv_resnet50_image-quality-assessment_degradation
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

cv_resnet50_image-quality-assessment_degradation - Ascend NPU 适配

1. 模型简介

图像画质损伤分析模型,基于 ResNet50 架构,可评估图像的清晰度、点状噪声、压缩噪声、亮度、色彩等多个维度的画质损伤评分。

  • 原始模型: iic/cv_resnet50_image-quality-assessment_degradation
  • 框架: PyTorch
  • 任务: Image Quality Assessment Degradation

2. 昇腾 NPU 适配结果

指标值
Cosine Similarity1.000000
平均延迟5.79 ms
峰值显存0.57 GB
参数量151,806,278
推理精度float16
设备Ascend 910B4

3. 环境要求

组件版本
CANN8.5.1
torch_npu2.9.0.post1
PyTorch2.9.0
Python3.11

4. 快速使用

# 设置环境
export ASCEND_HOME_PATH=/usr/local/Ascend/cann
export LD_LIBRARY_PATH=/usr/local/Ascend/cann/lib64:$LD_LIBRARY_PATH

# 安装依赖
pip install torch torch_npu torchvision

# 运行推理
python inference.py --device npu:0 --dtype float16

# 运行精度验证
python evaluate.py --device npu:0 --output report.json

5. 推理输出证据

NPU 推理输出(float16, 224x224):

模型: iic/cv_resnet50_image-quality-assessment_degradation
设备: npu:0
精度: float16
------------------------------------------------------------
  blur: shape=[1, 1], value=-9.7109
  noise: shape=[1, 1], value=0.3369
  compression: shape=[1, 1], value=-3.3770
  bright: shape=[1, 1], value=0.0000
  color: shape=[1, 1], value=0.0000
  classifier: shape=[1, 1], value=0.0000

✓ 推理完成

6. CPU vs NPU 精度对比

指标CPU (float32)NPU (float16)误差
Cosine Similarity基准0.9999996< 0.0001%
输出维度66一致
NaNFalseFalse一致

7. 模型结构

  • Backbone: ResNet50 (features)
  • Head: 6 个独立回归头 (blur, noise, compression, bright, color, classifier)
  • 输入: 224x224 RGB 图像
  • 输出: 6 维画质评分向量

8. 验证报告

详见 report.json 和 logs/02_evaluate.log。

9. Agent Skill

本适配由 vision-encoder-npu-adapt Agent Skill 自动完成。