Hello friends,
Today i actually wasted around 2 hours of time in the morning for a small bug in some of the images of yale data set. And I don't want any other person to waste time on the same thing so i taught of writing this post.
Before actually going into the details of that, let me tell about my journey with face recognition.
As early as in my 4th semester, I approached one of the professor in my college to help me do any project. He was actually pursuing his phd in the field of image processing. His interests were on face recognition. Every meeting i had with him, he actually tried to create some interest on that field in me. That was finally indeed very helpful to me in doing my final sem project. Thanks to our Prof.GTS
Face recognition is actually very interesting field of study and its one of the most interesting topic in the field of computer science research and development.If you want to know more on this topic, please visit the renowned
official website of face recognition community.
Usually many people in this field use
java or
matlab for coding purposes and some others use shell scripting such as
Image Magiks and some others use c or c++ or cv (computer vision modules).
Like every other person even i started off with matlab as said by experts in the domain, I actually have no issues with matlab it's cool and user friendly, its actually the most easiest tool which any one can find on this planet for doing coding of face recognition algorithms.
But one of my good friend told me use
python language for coding. During the initial stages i actually totally ignored him saying matlab is very good and i have done all the hard work learning matlab. But he was not convinced with me, he actually said that learning python just for sake of atleast doing project for final semester is worth then being a expert in matlab, we even had heated discussions many times regarding matlab or python.
But at last i taught alright, let me see whats there in python and i started using python for face recognition, its one of the easiest programming language any one can learn on the planet, It's actually one of the best programming language i have ever seen. After seeing python i actually felt why did i wasted all my time learning matlab and i literally felt that i should have listened to my friend long time back, it was not very late "Better late then never". Thanks a lot to my dear friend KG.
In brief, in face recognition what happens is some set of images is trained and mapped into what ever the way algorithms wants to. When it comes to training a test image image is mapped onto the mapped trained image space and euclidian distance between the test images and all the trained images are taken, the image corresponding to the minimum euclidian distance is the recognized image.
I would just like to tell one advantage using python over matlab, there are many advantages tough.
(1) Python is open source and it actually takes around 10 MB of your disk space. It doesn't demand for high end machines, on the other side matlab itself is some 2 GB of size and it actually demands for very high end machine.
(2) Using python writing generic code, writing one small piece of code for all the databases is very easy and in matlab we actually have to write separate matlab-files for individual databases.
Python has a very good support for image processing. Please check out python packages - scipy,numpy,PIL,Image for details of the support of python in image processing.
Let me come back to why actually did i waste the time today even tough it wasnt my mistake.
Yesterday i downloaded yale dataset ( one of the standard dataset for experimental purposes ) in the .pgm format from
here .
When i started to test this dataset i was actually getting some strange error, look at the following screen shot, some knowledge in python will actually makes you understand what that it say.
It actually says, i cannot load some image blah blah etc.., Thats was indeed a very strange thing i encountered because i had loaded other images from the same database successfully. After doing some experimentation i was able to find that some images in yale database which i downloaded from
here were the faulty images. Yes i realized that this was the reason why two similar databases were stored in that same server. You can actually find the proper database
here with the folder named
yalefaces(copy) , I actually dint wanted any other person to waste time on the same issue so i taught of sharing this experience.
If in case you are stuck up with the same problem, i think this should be of some help to you. I actually got the above error when i tried to load the following images of yale database.
1. subject11.normal.pgm
2. subject09.rightlight.pgm
3. subject06.sad.pgm
4. subject13.rightlight.pgm
5. subject10.noglasses.pgm
6. subject15.rightlight.pgm
7. subject06.happy.pgm
8. subject13.leftlight.pgm
9. subject08.rightlight.pgm
10.subject03.rightlight.pgm
11.subject10.sad.pgm
12.subject04.rightlight.pgm
13.subject10.wink.pgm
14.subject14.leftlight.pgm
But the same images works well when i downloaded from the
yalefaces(copy)
In case if you want any help regarding implementation of face recognition algorithms in python please feel free to contact me, i will give my best shot in helping you out.
Finally one thing i wanted to say is Python rocks \m/
Thanks a lot dear reader :)