IceClear / CLIP-IQA

[AAAI 2023] Exploring CLIP for Assessing the Look and Feel of Images
Other
283 stars 17 forks source link

Result nan #15

Closed arvisioncode closed 10 months ago

arvisioncode commented 10 months ago

Hello,

I have been doing tests with the clipiqa_single_image_demo.py and the "test degradation attributes" and sometimes the result is nan. It is true that for some images it returns scores, but usually not.

python demo/clipiqa_single_image_demo.py --config configs/clipiqa/clipiqa_attribute_test.py --checkpoint checkpoint/iter_80000.pth --file_path dataset/img.jpg

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
['Quality', 'Brightness', 'Sharpness', 'Noisiness', 'Colorfulness', 'Contrast', 'Quality']
[0.9892578  0.98876953 0.99853516 0.06488037 0.7416992  0.66796875]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
['Quality', 'Brightness', 'Sharpness', 'Noisiness', 'Colorfulness', 'Contrast', 'Quality']
[nan nan nan nan nan nan]

Do you know why this can be and how to fix it?

IceClear commented 10 months ago

Hi. I did not meet such a problem before. You may check the input if there is nan. Thanks.

arvisioncode commented 10 months ago

The image is similar to the one that gives good scores. In the code, I just modify the clipiqa_single_image_demo.py as mentioned before and the attribute_list to ['Quality', 'Brightness', 'Sharpness', 'Noisiness', 'Colorfulness', 'Contrast'] in the clipiqa_single_image_demo.py

Does the entry have to have some special characteristic, such as a minimum size?

arvisioncode commented 10 months ago

Resize from (674, 1069, 3) to (1289, 2048, 3) solves the problem