[digiKam-users] Face recognition results not cleaning up

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[digiKam-users] Face recognition results not cleaning up

SkyDiver
Hi,

Tech info:
----------
OS:         Ubuntu 18.04
Digikam: 5.6.0
DB type: Sqlite

The problem:
------------
I tried to have another go at the face recognition feature and I find
myself dealing with it for 3 days in a row now.
In an effort to get better results from the engine I tried to "Scan
the collection for faces" several times.
I tries to every option on the menu several times (skip scanned images
/ scan and merge / clean unconfirmed and rescan).
I also hit the "Clear and rebuild all training data" at least twice
(if not more).

A few times the application crashed with a nice message, many other
times the application would just close and disappear without warning.

The current situation is that when I have "Show Face Tags" switched
on, I see a lot of "ghost face-recognition frames" on many photos.
This means that I click the "remove" button and then there are no more
frames on the photo.
If I would then go to a different photo and come back to the first
one, these "ghost frame" would reappear there.

After failing to clean the Unknown + Unconfirmed results via the
various "scan collections for faces" options,
I realized I could just "select all" faces in both categories and
click the remove (red minus) button on one of them to have them all
being removed.

Sadly, even after doing that, I still have these "ghost frames" stuck
on many photos.

The problem with it is that when going into a photo in order to tag
faces, there are many duplicated frames with a slight offset between
them,
so the end result is that for a group photo with several faces on it,
there could be around 2-3 frames surrounding each face.
One frame might be the person's confirmed tag, but it would be covered
by another 1-2 frames with the full "Who is this person?" title along
with the "+"/"-" controls.

Clearly, something is not cleaning up correctly in the DB.
Taking a quick look at some tables I see that:
  UniqueHashes has ~33K rows
  FilePaths has ~35K rows
  CustomIdentifiers has 48K rows
  Thumbnails has ~82K rows

Questions:
----------
1. Can this be fixed by means of switching some option on/off in
digikam? (alternatively, is this addressed in a later version?)
2. In case digikam can't fix it, what would be the proper way to
remove all unknown+unconfirmed face frames via SQL?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Face recognition results not cleaning up

SkyDiver
So... to answer my own question:
First off, it turns out that "Clear unconfirmed results and rescan"
doesn't work as advertised.
Instead of clearing the results, it just rescans.

Having the unconfirmed results not clearing up was only part of the problem.
The other part was that even after fully clearing the Unknown and
Unconfirmed categories, my images still contained a large amount of
unconfirmed and unknown face-frames.
In many cases, there were duplicated face-frames for a detected face,
sometimes with a small offset of a few pixels, sometimes at the exact
same location.
I can't really tell if this was related to the application crashing
several times while detecting faces, or if it was the result of me
changing the "Parameters for face detection and recognition" value
from 80% to 90% and at some point to 100%.
I now tried playing with the percentage value and rescanning, but
didn't see duplicates adding up, so I'll assume it was related to the
application crashes (although I didn't give this a thorough test
cycle, just a few minutes at 1% and then a few more at 100%).

Technically-wise, I was looking at the wrong DBs, namely
recognition.db and thumbnails-digikam.db.
The correct DB to dig into is actually digikam4.db.

In order to clean all the Unconfirmed + Unknown face-frames, I ended
up deleting all non "tagRegion" rows from ImageTagProperties.

(*) Side note:
    I find it rather WILD that the "property" column contains textual
as well as binary values, all seemingly looking like strings when
being simply selected.
    Run the following to understand what I'm talking about:
        select distinct(property),quote(distinct(property)) from TagProperties;
        select distinct(property),quote(distinct(property)) from
ImageTagProperties;

As an afterthought, I'm not sure why I had to go through all this,
because face-frames are turned off by default (maybe I was in a
research state of mind).
Bottom line: My images are now clean of all the "zombie" face-frames.
On Sun, Dec 2, 2018 at 10:03 AM Sky Diver <[hidden email]> wrote:

>
> Hi,
>
> Tech info:
> ----------
> OS:         Ubuntu 18.04
> Digikam: 5.6.0
> DB type: Sqlite
>
> The problem:
> ------------
> I tried to have another go at the face recognition feature and I find
> myself dealing with it for 3 days in a row now.
> In an effort to get better results from the engine I tried to "Scan
> the collection for faces" several times.
> I tries to every option on the menu several times (skip scanned images
> / scan and merge / clean unconfirmed and rescan).
> I also hit the "Clear and rebuild all training data" at least twice
> (if not more).
>
> A few times the application crashed with a nice message, many other
> times the application would just close and disappear without warning.
>
> The current situation is that when I have "Show Face Tags" switched
> on, I see a lot of "ghost face-recognition frames" on many photos.
> This means that I click the "remove" button and then there are no more
> frames on the photo.
> If I would then go to a different photo and come back to the first
> one, these "ghost frame" would reappear there.
>
> After failing to clean the Unknown + Unconfirmed results via the
> various "scan collections for faces" options,
> I realized I could just "select all" faces in both categories and
> click the remove (red minus) button on one of them to have them all
> being removed.
>
> Sadly, even after doing that, I still have these "ghost frames" stuck
> on many photos.
>
> The problem with it is that when going into a photo in order to tag
> faces, there are many duplicated frames with a slight offset between
> them,
> so the end result is that for a group photo with several faces on it,
> there could be around 2-3 frames surrounding each face.
> One frame might be the person's confirmed tag, but it would be covered
> by another 1-2 frames with the full "Who is this person?" title along
> with the "+"/"-" controls.
>
> Clearly, something is not cleaning up correctly in the DB.
> Taking a quick look at some tables I see that:
>   UniqueHashes has ~33K rows
>   FilePaths has ~35K rows
>   CustomIdentifiers has 48K rows
>   Thumbnails has ~82K rows
>
> Questions:
> ----------
> 1. Can this be fixed by means of switching some option on/off in
> digikam? (alternatively, is this addressed in a later version?)
> 2. In case digikam can't fix it, what would be the proper way to
> remove all unknown+unconfirmed face frames via SQL?
>
> Thank you.