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

Error converting raw image to PKL format data #27

Open
rainbowbird07 opened this issue Nov 20, 2017 · 1 comment
Open

Error converting raw image to PKL format data #27

rainbowbird07 opened this issue Nov 20, 2017 · 1 comment

Comments

@rainbowbird07
Copy link

Dear author:
When I run the code 'python 01-data_preprocessing.py', I always meet this mistake:

File "****/saliency-salgan-2017-master/scripts/eliaLib/dataRepresentation.py", line 49, in load

self.data = (scipy.io.loadmat(self.filePath)['I']).astype(np.uint8)

KeyError: 'I'

 I was miserable. Eager for your help!
 Thank you very much anyway!
 Best!
@mocordel
Copy link

mocordel commented Dec 5, 2017

I solved this issue knowing that i converted the saliency maps from jpg to mat file just to suit the requirement of the data preprocessing code that the saliency map must be in mat file. When i changed the jpg to mat file, the variable that i used for the image was im i.e. im = imread('saliencymap.jpg'); . So when I saved it as xxxx.mat file and load it again, it becomes struct that contains the variable im.

In short, change 'I' to the container that you used when you saved the image as mat file. In my case, I changed 'I' to 'im'.

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