Shotwell Faces Tool: Weekly Report 07 & 08
17/07/12 09:21
::[ NOTE: Spanish translation in http://sanva.net/blog/113/ ]
This last two weeks I've continued the work on the test suite, adding face recognition using Philipp Wagner's FaceRecognizer class and some scripts to help doing the testing. I've also wrote the instructions to use all those tiny programs at [1] —it could be incomplete, please ask whatever you need ;)
This face recognition thing seems to be more about collect people faces to make a decent and realistic database to train the face recognition model and then try to recognize this same people in other photos. There is really few code to show: Since I discover, read and understand the new OpenCV FaceRecognizer class [2], the written code is really simple [a] —in fact, the main task of this last two weeks has been mainly to do tests, trying to make a decent faces-database of my friends to improve the results I'm getting from my tests: About 30% of accuracy recognizing people —in the articles I've read there are people talking about more accuracy, but such accuracy seems to be not so real, because they use face-databases like the one at [3], and we can't expect Shotwell users making that kind of photos.
So, those are real tests: I mean, there was no preselection of which photos I used. I've simply chosen 4 events —the same concept as in Shotwell, i.e. photos from the same date—, and I trained a model with the detected faces —discarding some really bad face-photos, but keeping some medium ones that I knew they would make a less good model. I've done it this way because I think that a normal Shotwell user would tag faces of this characteristics.
Then, I've chosen some other events, I've taken the face-photos from each of them using facedetect, and discard false positives and the people who aren't in the trained model. With this approach I'm getting about 30% of accuracy in face recognition —but I could increase it to about 50-70% if I discard all the face-photos from people with less than 40 face-samples in the training face-photos database. So, the point is that only increasing the size of the training face-photos database we could expect better results —but I tried to do it in a way that emulates a normal use of the program...
But I think that this could be not so annoying to Shotwell users... Even having 70% of errors, we can minimize the annoyance of having such error. Let me explain: When pressing detect faces, we can expect that the program will try to recognize the person in the photo and ask you Is this Valentín Barros?... If the person isn't me, that's an error, and the user has to press No, and then write the correct name —but we can make it differently: We wouldn't ask the user if the face belongs to someone, we can simply write his/her name in the text input, where the user would write it, but all selected. If it is an error, the user can simply write the correct name —since all text is selected he doesn't even need to select it and press backspace. If it is correct, the user press Enter key or OK button and the focus goes to the next autodetected face —and, if it isn't a face, the user can press Esc/Cancel to discard it.
What do you think about this?
By the way, I'll be attending GUADEC ;)
[a] My written code is really simple, but that's because all the hard work has been done by other people and collected in OpenCV ;)
[1] https://github.com/Sanva/facedetect#simple-face-detection--recognition-test-suite-using-opencv
[2] http://docs.opencv.org/trunk/modules/contrib/doc/facerec/index.html
[3] http://www.cl.cam.ac.uk/research/dtg/attarchive/pub/data/att_faces.zip
Tags: [en], Planet GNOME, Google Summer of Code, Shotwell