iirc, the yale db comes as 'gif' images, which arent readable by imread(),
so you'd have to batch-convert them to png first
also, the yale db does not come with one folder per person,
so either make folders for each, then run "create_csv.py folder_with_yale_images"
or try this:
import os,sys
id = -1
pn = ""
for dirname, dirnames, filenames in os.walk(sys.argv[1]):
for filename in filenames:
p = filename.split(".")
if p[0] != pn:
id += 1
pn = p[0]
src = os.path.join(dirname, filename)
print "%s;%d" % (src, id)
# run : yale.py /absolute/path/to/folder/with/yale/images > yale.csv
whatever you choose, the outcome should look like this:
...
E:\MEDIA\faces\yalefaces\png\subject10.surprised.png;9
E:\MEDIA\faces\yalefaces\png\subject10.wink.png;9
E:\MEDIA\faces\yalefaces\png\subject11.centerlight.png;10
E:\MEDIA\faces\yalefaces\png\subject11.glasses.png;10
E:\MEDIA\faces\yalefaces\png\subject11.happy.png;10
...
(per line: absolute_path semicolon id)
It's weird that we call these files "CSV" files. They are not comma-separated and can not be interpreted by typical csv-reading software. Nothing wrong with this format, of course, it's just wrong to call it csv.
yea, you're right about this.
again, let's keep it straight: