IQA-PyTorch icon indicating copy to clipboard operation
IQA-PyTorch copied to clipboard

关于一些评价指标对同一张图评价时,结果不同。

Open Shecyy opened this issue 1 year ago • 2 comments

作者,您好。我在使用一些评价指标的时候,多次运行时,发现对同一张图的评价结果是不一样的。例如:采用hyperiqa对一张图评价,发现每次运行的结果不一样。请问这是正常情况吗?还有一些其他指标同样存在这种情况。例如:maniqa、tres、tres-flive等。

其代码如下:

image_path= './temp.png'
for i in range(10):
    evaluator = pyiqa.create_metric('hyperiqa')
    value = evaluator(image_path)
    print(value)
    pass

上述代码的运行结果为:

tensor([[0.7532]], device='cuda:0')
tensor([[0.7455]], device='cuda:0')
tensor([[0.7435]], device='cuda:0')
tensor([[0.7538]], device='cuda:0')
tensor([[0.7471]], device='cuda:0')
tensor([[0.7469]], device='cuda:0')
tensor([[0.7512]], device='cuda:0')
tensor([[0.7485]], device='cuda:0')
tensor([[0.7510]], device='cuda:0')
tensor([[0.7460]], device='cuda:0')

Shecyy avatar Jan 14 '24 02:01 Shecyy

您提到的这些方法是通过random sample一些patch来做的,所以每次结果会不太一样。在最新的版本里面,random seed应该是固定的。请更新版本在尝试一下。

chaofengc avatar Jan 14 '24 03:01 chaofengc

好的,非常感谢您的回复。

Shecyy avatar Jan 14 '24 07:01 Shecyy