Discussion:
Face detection and face recognition
Tobias Leupold
2014-07-09 15:42:15 UTC
Permalink
Hi List!

Now that we can mark areas on an image and associate them with tags, we can go
one nice step ahead. I added face detection and face recognition using
Digikam's libkface.

Please have a look at:

https://github.com/l3u/kphotoalbum/tree/facemanagement

This is quite a big patch. As there were changes and additions throughout the
code, it was not really possible to split the changes in different independent
patches. The current state is based on current git master as of the time of
this writing. I'm pretty sure that all this is far from production quality,
but it's usable. Of course, this is nothing for the upcoming release, as it
has to be tested from end to end.

Please notice that you need the current git master of libkface (
http://quickgit.kde.org/libkface.git -- version 3.2.0) for this to work, as I
also had to add a new function to libkface's API to be able to implement some
database maintenance.

When there's no appropriate version of libkface at build time, KPA should
build as ever, simply leaving out the new functionality. When we have it, a
"Search for faces on the current image" button is added to the annotation
dialog's image preview, along with some additional context menu entries for
the areas and a new settings page.

Regarding face detection, it was no big deal to implement it and the results
are quite okay. Face recognition is a bit more tricky, as we have to keep the
recognition database in sync with KPA's database. The quality of the
recognition was moderate to impressive -- depending on the image sets I used
to test it (but it's the deal of the libkface guys to improve that ;-)

So ... please check out the code :-)

Yours, Tobias
Miika Turkia
2014-07-15 06:32:55 UTC
Permalink
Post by Tobias Leupold
Hi List!
Now that we can mark areas on an image and associate them with tags, we can go
one nice step ahead. I added face detection and face recognition using
Digikam's libkface.
Sounds pretty cool. I just watched a video demonstrating the marking of
areas in KPA, now I could watch a video demonstrating this as well :D
Post by Tobias Leupold
https://github.com/l3u/kphotoalbum/tree/facemanagement
This is quite a big patch. As there were changes and additions throughout the
code, it was not really possible to split the changes in different independent
patches. The current state is based on current git master as of the time of
this writing. I'm pretty sure that all this is far from production quality,
but it's usable. Of course, this is nothing for the upcoming release, as it
has to be tested from end to end.
The 4.5 release is half way out. Sources are already in KDE mirrors, but we
are still lacking the notification and drumming.
Post by Tobias Leupold
Please notice that you need the current git master of libkface (
http://quickgit.kde.org/libkface.git -- version 3.2.0) for this to work, as I
also had to add a new function to libkface's API to be able to implement some
database maintenance.
You should test that libkface version is high enough. Since you require a
minimum version of the API, it is not enough to make sure that the library
exist. Otherwise I didn't spot anything peculiar with my 2 minute browse
through the code.
Post by Tobias Leupold
When there's no appropriate version of libkface at build time, KPA should
build as ever, simply leaving out the new functionality. When we have it, a
"Search for faces on the current image" button is added to the annotation
dialog's image preview, along with some additional context menu entries for
the areas and a new settings page.
Regarding face detection, it was no big deal to implement it and the results
are quite okay. Face recognition is a bit more tricky, as we have to keep the
recognition database in sync with KPA's database. The quality of the
recognition was moderate to impressive -- depending on the image sets I used
to test it (but it's the deal of the libkface guys to improve that ;-)
It is going to be interesting to test the face recognition with fish and
sea slug pictures I mainly shoot. I sure hope it will work well there.
Someone, please donate me 10 more hours per day :D

miika
Tobias Leupold
2014-07-15 17:34:36 UTC
Permalink
Post by Miika Turkia
You should test that libkface version is high enough. Since you require a
minimum version of the API, it is not enough to make sure that the library
exist.
I already added this: pkg_check_modules(KFACE libkface>=3.2.0)

I'm going to patch libkface with a simpler training method, cheaping out
having to implement an own TrainingDataProvider. I'll port my implementation
to this new function and update the version check (after having bumped the
libkface API version, too, of course).

You'll see it on github :-)
Post by Miika Turkia
It is going to be interesting to test the face recognition with fish and
sea slug pictures I mainly shoot. I sure hope it will work well there.
Someone, please donate me 10 more hours per day :D
Well, that's up to the digiKam guys who maintain libkface ... or the OpenCV
guys ;-)

Loading...