[Digikam-devel] libkface database maintenance

Tobias Leupold tobias.leupold at web.de
Thu Jul 3 11:46:37 BST 2014


Hi :-)

> The patch sound fine for me.
Nice :-)

> You forget to add API doc in header using Doxygen syntax.
I just added comments to the header file, also some more comments to clarify 
what the clearTraining and clearAllTraining functions do.

> I suppose that you have already an acount to git as developer and you
> are able to commit this patch to libkface repository. Right ?
No, I don't have a developer account. I'm quite new to all this ;-)

I just created a libkface clone on github and pushed my changes to a branch, 
see
https://github.com/l3u/libkface/tree/delete_identity

Perhaps, you want to commit it.

Another question:

What about a convenience function for training the recognition database to 
make using libkface simpler? What I was looking for at my very start was a 
function I give some user ID and a picture to learn.

What has to be done at the moment is:

* Query the database for an existing identity and creating one if none is 
found.

* Instantiate a SimpleTrainingDataProvider with the identity I want to train 
and the respective image, which apparently holds nothing but the identity and 
the image I want to add

* Pass the identity and the SimpleTrainingDataProvider instance to the train 
function (although the Identity I want to train has already been passed to the 
SimpleTrainingDataProvider!)

What about the following: We could integrate the SimpleTrainingDataProvider 
code in the lib (you wrote it anyways and provide it in the test dir ;-) and 
create a function like

void train(const Identity& identityToBeTrained,
           const QImage& face,
           const QString& trainingContext);

which creates a SimpleTrainingDataProvider with the given identity and the 
given image and then passes the data the "real" train function.

Querying the database for a probably already existing identity is okay I 
think, as we don't know in which way the user wants to search for the 
identity.

But for me as an "end-user" developer outside of digikam, it was not really 
clear why I have to mess with that SimpleTrainingDataProvider (or a custom 
class providing the same data) when I want to train the database with one 
image for one identity in a procedural way ... probably, this is fine if one 
wants to do something "special" or train a lot of images or such. But I think 
it makes the use of libkface a bit more complicated as necessary.

It would not be much work to implement this convenience function, I think, and 
I also think I can do this. If you also think that would be nice, of course.

What do you think?

Yours, Tobias



More information about the Digikam-devel mailing list