图像质量评价(IQA)

1.评价方法

图像质量评价分为:主观和客观两个方面。其中客观又分为全参考、半参考和无参考三种

详情见如下博客内容

https://blog.csdn.net/shinuone/article/details/149176494

2.评价指标和评价算法

GitHub - chaofengc/IQA-PyTorch: 👁️ 🖼️ 🔥PyTorch Toolbox for Image Quality Assessment, including PSNR, SSIM, LPIPS, FID, NIQE, NRQM(Ma), MUSIQ, TOPIQ, NIMA, DBCNN, BRISQUE, PI and more...

IQA-PyTorch/docs/ModelCard.md at main · chaofengc/IQA-PyTorch · GitHubhttps://github.com/chaofengc/IQA-PyTorch/blob/main/docs/ModelCard.md

按照git上的要求搭好环境后使用以下testiqa.py进行测试,图片可以放在绝对路径下

python 复制代码
import pyiqa
# pyiqa是pytorch实现的图像质量评估库,直接pip install
import torch
from PIL import Image
import torchvision.transforms as transforms

# 可以列出左右库里的函数
print(pyiqa.list_models())

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")

# 示例
iqa_metric = pyiqa.create_metric('arniqa', device=device) #随意选择上述存在的模型,注意是否是NR的
to_tensor = transforms.ToTensor()
img_path=r"E:\code\pytorch_test\IQA-PyTorch-main\IQA-PyTorch-main\test.jpg" #图片路径
img = to_tensor(Image.open(img_path)).unsqueeze(0)
score = iqa_metric(img)
print("NIME:", score.item())

测试结果如下图所示

表示使用该模型arniqa,得到的分数为0.45

相关推荐
沪漂阿龙在努力1 天前
面试题:训练-蒸馏详解——知识蒸馏、Teacher-Student、强弱蒸馏、Qwen3 强到弱蒸馏流程全解析
人工智能
Jetev1 天前
如何配置MongoDB驱动以支持快速的主备切换感知_SRV记录与拓扑监控
jvm·数据库·python
m0_631529821 天前
golang如何实现目录大小统计_golang目录大小统计实现方案
jvm·数据库·python
m0_617493941 天前
解决 PyTorch 报错:RuntimeError: CUDA error: an illegal instruction was encountered
人工智能·pytorch·python
米小虾1 天前
AI Agent:从概念到落地的技术演进与实战指南
人工智能·agent
初心未改HD1 天前
深度学习之感知机详解
人工智能·深度学习
Bruce_Liuxiaowei1 天前
2026年5月第3周网络安全形势周报
人工智能·安全·web安全·网络安全·系统安全
运维行者_1 天前
理解应用性能监控
大数据·服务器·网络·数据库·人工智能·网络协议·安全
qcx231 天前
【AI Agent实战】多 Agent 编排架构:五层模型与 RL 优化
网络·人工智能·ai·架构·prompt·agent
2301_769340671 天前
Golang怎么限制请求Body大小_Golang如何防止客户端发送过大的请求体【避坑】
jvm·数据库·python