Eigenfaces is a facial recognition technique that involves reducing the dimensionality of a dataset of facial images. For example, given a dataset of 400 images, each 64 pixels by 64 pixels, the dimensionality of the image space can be reduced from 4096 by 4096 to 400 by 4096 by only considering the eigenspace created by the eigenfaces.
TODO
Download and install arrayfire on your computer. Make sure to have make, cmake installed. Currently only fedora linux 39 has been tested.
The following line in CMakeLists.txt
target_link_libraries(eigenfaces.out ArrayFire::afcuda)
Can be modified with ArrayFire::afcpu
, ArrayFire::afoneapi
and ArrayFire::afopencl
. For further details read here.
In /eigenfaces
run the following commands
mkdir build && cd build
then we can build the provided code by running
cmake .. && make
To run it simply use
./eigenfaces.out
Command line args are not supported, so if you want to test out stuff just change the code and recompile.
As a first introduction into SVD this article is highly suggested
Another great way to visualize PCA can be seen here
Dataset of images used is olivetti faces, taken from here.
Other usefull links for any advetureurs:
https://sandipanweb.wordpress.com/2018/01/06/eigenfaces-and-a-simple-face-detector-with-pca-svd-in-python/
https://github.com/jakeoeding/eigenfaces
https://genomicsclass.github.io/book/pages/svd.html