Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Exception: Unsupported source type" #23

Open
charpng opened this issue Oct 14, 2024 · 3 comments
Open

"Exception: Unsupported source type" #23

charpng opened this issue Oct 14, 2024 · 3 comments

Comments

@charpng
Copy link

charpng commented Oct 14, 2024

import pyiqa
model = pyiqa.create_metric('unique', as_loss=False)
score = model(img)
#img = ..\image\10_1_C_1000_far_env1000.png

An error was encountered while running the above code

  File "D:\Tianma\UNIQUE\unique_.py", line 26, in <module>
    score = model(img)
            ^^^^^^^^^^
Exception: Unsupported source type

This is a png image with a resolution of 5218*2160. What do I need to change to solve this error?

@zwx8981
Copy link
Owner

zwx8981 commented Oct 14, 2024

Try: 1, If your image is a gray-scale one, convert it to RGB by duplicating it into three channels. 2, Resize your image such that the longest edge is lower than 1024.

@charpng
Copy link
Author

charpng commented Oct 23, 2024

Try: 1, If your image is a gray-scale one, convert it to RGB by duplicating it into three channels. 2, Resize your image such that the longest edge is lower than 1024.

Thank you very much, I successfully solved this problem. However, I'm facing a new problem now:
I have a set of images and corresponding MOS scores. How do I convert the data into a format for UNIQUE training? How would I get 'y', 'std1', 'std2', and 'yb' from the code mentioned in ImageDataset.py? I thought 'std' meant the standard deviation of the MOS score, but it seems not to be the case? Thank you.

sample = {'I1': I1, 'I2': I2, 'y': y[0], 'std1':y[1], 'std2':y[2], 'yb': y[3]}

@zwx8981
Copy link
Owner

zwx8981 commented Oct 24, 2024

std is the standard deviation of the MOS. You may refer to one of the scripts in IQA_Database (e.g., data_koniq10k.m) to generate these data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants