A simple script for performing eigenface analysis. Head over to this blog post for more details.
Use
$ python eigenfaces.py Data/Yale\ faces/Original 100
to perform a reconstruction using 100 randomly-selected faces with
eigensystem reductions of 95% explained variance. If you want to modify
the explained variance, use the optional --variance
switch:
$ python eigenfaces.py Data/Yale\ faces/Original 100 --variance 0.99
This results in an eigensystem that explains at least 99% of the
variance. The script will display the reconstruction (i.e. the
projection onto “face space”) on the left-hand side and the
original image on the right-hand side. Better results are generally
obtained using the Cropped
subdirectory:
$ python eigenfaces.py Data/Yale\ faces/Cropped 100
If you want even more data sets, here are some interesting ones: