torralba-lab / im2recipe

Code supporting the CVPR 2017 paper "Learning Cross-modal Embeddings for Cooking Recipes and Food Images"
MIT License
365 stars 89 forks source link

Incorrect imname to load images in mk_dataset.py #3

Closed Cadene closed 7 years ago

Cadene commented 7 years ago

Hi,

It's me again :)

I encountered a critical problem in mk_dataset.py line 176.

The content of the variable imname is something like: ../data/recipe1M/images/3e233001e2.jpg.

However, our images directory is structured that way:

$ ls ../data/recipe1M/train/
0/ 1/ 2/ 3/ 4/ 5/ 6/ 7/ 8/ 9/ a/ b/ c/ d/ e/ f/

Thus, I can't load any images and didn't figure by myself how to solve this problem. Is there a preprocessing to apply to the images raw directories that I have missed somewhere?

Just to give you an other info (maybe useless), I executed your script with the following arguments:

$ cd $i2r/pyscripts
$ python mk_dataset.py -vocab ../data/text/vocab.txt -dataset ../data/recipe1M -h5_data ../data/im2recipe/data.h5 -stvecs ../data/text

Thanks for your precious help.

amaiasalvador commented 7 years ago

Hi, thanks for letting us now!

For the dataset release images were arranged in a four-level hierarchy corresponding to the first four digits of the image id. For example: val/e/f/3/d/ef3dc0de11.jpg

mk_dataset.py was modified accordingly in 6e96a6a.

Apologies for the inconvenience.

Cadene commented 7 years ago

Thanks :)