Regarding Implementation for Ignored Faces

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

Regarding Implementation for Ignored Faces

kartikx
Hello all,

I wanted to discuss how I may implement feature for Ignored faces. The main idea is to allow the user to "ignore" certain faces detected by the algo. which the user doesn't wish to recognize.
I think that the option to ignore faces should be provided only on Unknown faces. Since it doesn't make sense to ignore a face that has been confirmed by the user, already.
One approach is to treat Ignored faces as just another People tag, and when the user decides to ignore a particular unknown face, we can just call a confirm operation with the ignored person tagId, on that face.
Another approach could be to treat Ignored similar to Unknown/Unconfirmed, that is, to create an Ignored Tag Property, Ignored FaceTagsIface::Type and other changes at the low level.

Please let me know which of these seems more sensible.

Thanks
Kartik.
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

woenx
Hello Kartik,

Just my two cents. Yes, I agree that the "Ignore" feature should only appear
in the "Unknown" faces category. I believe that, when given the option to
accept or reject a face/suggestion in digikam, if the face is in
"Unconfirmed" because it already has a suggestion, rejecting it should send
it back to "Unknown", and doing the same a face in "Unknown" should send
them to "Ignored" (or "Hidden", or whatever word you think it fits better).

Regarding the second issue, I can't really say. I believe the "Ignored"
should be a category in itself (like Unknown and Unconfirmed) and not just a
tag (wouldn't that interfere with the face recognition algorithm?), but the
developers will probably give better advice on this.



--
Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

Maik Qualmann
In reply to this post by kartikx
Hmm, assigning a region to be deleted to a tag is probably not so good. I
don't think users want this region anymore. Use a database browser to look at
the "ImageTagProperties" how regions are saved. we need a "dummy" here. This
"dummy" is not written in metadata and is not displayed as a region on images,
but is used as an existing face in face detection. When deleting all regions
on the images, the "dummy" is also deleted so that a new assignment is
possible. Just an idea...

Maik

Am Montag, 11. Mai 2020, 13:51:46 CEST schrieb Kartik Ramesh:

> Hello all,
>
> I wanted to discuss how I may implement feature for Ignored faces. The main
> idea is to allow the user to "ignore" certain faces detected by the algo.
> which the user doesn't wish to recognize.
> I think that the option to ignore faces should be provided only on Unknown
> faces. Since it doesn't make sense to ignore a face that has been confirmed
> by the user, already.
> One approach is to treat Ignored faces as just another People tag, and when
> the user decides to ignore a particular unknown face, we can just call a
> confirm operation with the ignored person tagId, on that face.
> Another approach could be to treat Ignored similar to Unknown/Unconfirmed,
> that is, to create an Ignored Tag Property, Ignored FaceTagsIface::Type and
> other changes at the low level.
>
> Please let me know which of these seems more sensible.
>
> Thanks
> Kartik.




Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

Gilles Caulier-4
hi,

yes, exactly. As introduced by Maik, all the faces are detected in the
workflow and the user decide which one must be registered or not in
the workflow.

So the face IGNORED must be set as an hidden property in database. But
i'm not agree with Maik, about file metadata. We need to store these
properties at least in digiKam XMP namespace for database properties
backup.
Only digiKam handle this namespace which host already some important
database information as backup.

Like this, if the database is corrupted, and if user set digiKam to
store face information in file metadata, the database can be restored
as well at next start up using a fresh database, including this
important properties, to prevent to replay the face selection in a new
workflow.

Note : i'm not sure if standard XMP namespace store image regions to
ignore. Kartik, please take a look in XMP standard tags, using Exiv2
or Exiftool doc, just to double check...

best

Gilles

Le lun. 11 mai 2020 à 22:57, Maik Qualmann <[hidden email]> a écrit :

>
> Hmm, assigning a region to be deleted to a tag is probably not so good. I
> don't think users want this region anymore. Use a database browser to look at
> the "ImageTagProperties" how regions are saved. we need a "dummy" here. This
> "dummy" is not written in metadata and is not displayed as a region on images,
> but is used as an existing face in face detection. When deleting all regions
> on the images, the "dummy" is also deleted so that a new assignment is
> possible. Just an idea...
>
> Maik
>
> Am Montag, 11. Mai 2020, 13:51:46 CEST schrieb Kartik Ramesh:
> > Hello all,
> >
> > I wanted to discuss how I may implement feature for Ignored faces. The main
> > idea is to allow the user to "ignore" certain faces detected by the algo.
> > which the user doesn't wish to recognize.
> > I think that the option to ignore faces should be provided only on Unknown
> > faces. Since it doesn't make sense to ignore a face that has been confirmed
> > by the user, already.
> > One approach is to treat Ignored faces as just another People tag, and when
> > the user decides to ignore a particular unknown face, we can just call a
> > confirm operation with the ignored person tagId, on that face.
> > Another approach could be to treat Ignored similar to Unknown/Unconfirmed,
> > that is, to create an Ignored Tag Property, Ignored FaceTagsIface::Type and
> > other changes at the low level.
> >
> > Please let me know which of these seems more sensible.
> >
> > Thanks
> > Kartik.
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

kartikx
Thanks for the advice. I've been able to add the Ignored Property, so that it is not associated with a Tag Region. This way if I mark a face as ignored, the associated image (of which the face is a part) will not show the ignored tag region.
About the metadata, and Exiv tags, I'll have to read up more as I'm not very familiar with the topic. I'll confirm about the XMP tags soon.
I needed some help with another issue. Since I'm modifying the database properties for the faces, any face set as ignored is not showing up in the DigikamItemView. I'm assuming this is because I haven't made changes to the underlying model, to account for this new Face type. Can I get some advice on where to start understanding how the Models get constructed from the database, and how I can solve my issue? I took a look at libs/database/models but got a little overwhelmed by all the lines of code.

Thanks
Kartik

On Tue, May 12, 2020 at 1:10 PM Gilles Caulier <[hidden email]> wrote:
hi,

yes, exactly. As introduced by Maik, all the faces are detected in the
workflow and the user decide which one must be registered or not in
the workflow.

So the face IGNORED must be set as an hidden property in database. But
i'm not agree with Maik, about file metadata. We need to store these
properties at least in digiKam XMP namespace for database properties
backup.
Only digiKam handle this namespace which host already some important
database information as backup.

Like this, if the database is corrupted, and if user set digiKam to
store face information in file metadata, the database can be restored
as well at next start up using a fresh database, including this
important properties, to prevent to replay the face selection in a new
workflow.

Note : i'm not sure if standard XMP namespace store image regions to
ignore. Kartik, please take a look in XMP standard tags, using Exiv2
or Exiftool doc, just to double check...

best

Gilles

Le lun. 11 mai 2020 à 22:57, Maik Qualmann <[hidden email]> a écrit :
>
> Hmm, assigning a region to be deleted to a tag is probably not so good. I
> don't think users want this region anymore. Use a database browser to look at
> the "ImageTagProperties" how regions are saved. we need a "dummy" here. This
> "dummy" is not written in metadata and is not displayed as a region on images,
> but is used as an existing face in face detection. When deleting all regions
> on the images, the "dummy" is also deleted so that a new assignment is
> possible. Just an idea...
>
> Maik
>
> Am Montag, 11. Mai 2020, 13:51:46 CEST schrieb Kartik Ramesh:
> > Hello all,
> >
> > I wanted to discuss how I may implement feature for Ignored faces. The main
> > idea is to allow the user to "ignore" certain faces detected by the algo.
> > which the user doesn't wish to recognize.
> > I think that the option to ignore faces should be provided only on Unknown
> > faces. Since it doesn't make sense to ignore a face that has been confirmed
> > by the user, already.
> > One approach is to treat Ignored faces as just another People tag, and when
> > the user decides to ignore a particular unknown face, we can just call a
> > confirm operation with the ignored person tagId, on that face.
> > Another approach could be to treat Ignored similar to Unknown/Unconfirmed,
> > that is, to create an Ignored Tag Property, Ignored FaceTagsIface::Type and
> > other changes at the low level.
> >
> > Please let me know which of these seems more sensible.
> >
> > Thanks
> > Kartik.
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

Gilles Caulier-4
Le mar. 12 mai 2020 à 13:05, Kartik Ramesh <[hidden email]> a écrit :
>
> Thanks for the advice. I've been able to add the Ignored Property, so that it is not associated with a Tag Region. This way if I mark a face as ignored, the associated image (of which the face is a part) will not show the ignored tag region.
> About the metadata, and Exiv tags, I'll have to read up more as I'm not very familiar with the topic. I'll confirm about the XMP tags soon.

"Exiv" => Exif.

Here it's not Exif metadata set but XMP. If fact, image can include 3
type of metadat stored in separte container and using different format
:

Exif : Binary format based on JFIF/TIFF tags structure. Only to store
camera settings.
Iptc : binary format, deprecated, very limited (char encoding, string
size, etc...). To store post process properties.
Xmp: XML based container : to replace Iptc without any limitation

All metadata are managed by Exiv2 library in background. The metadata
engine is here :

https://invent.kde.org/kde/digikam/-/tree/master/core/libs/metadataengine

All code using Exiv2 API are only hosted here. Do not use Exiv2 API
outside to preserve binary compatibilty in other DK parts. Exiv2 API
is currently migrarting to use more modern C++ standard and
compilation will become the hell is we export Exiv2 API outside.
Typically all is already in place in metadata engine to host something
new to XMP without to call new Exiv2 API... Just patch the current
implementation and that all.

Best

Gilles Caulier
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

kartikx
Thanks for the info Gilles.
Could you please also answer the issue I raised at the end of my last email? My main issue is this :
Whenever we select a particular person name, in the People Sidebar, only faces recognized as that person are shown in the Icon View. Where should I look for to understand this feature? I would like to modify it, to account for the new Ignored property.

Thanks in advance,
Kartik.

On Tue, May 12, 2020 at 4:57 PM Gilles Caulier <[hidden email]> wrote:
Le mar. 12 mai 2020 à 13:05, Kartik Ramesh <[hidden email]> a écrit :
>
> Thanks for the advice. I've been able to add the Ignored Property, so that it is not associated with a Tag Region. This way if I mark a face as ignored, the associated image (of which the face is a part) will not show the ignored tag region.
> About the metadata, and Exiv tags, I'll have to read up more as I'm not very familiar with the topic. I'll confirm about the XMP tags soon.

"Exiv" => Exif.

Here it's not Exif metadata set but XMP. If fact, image can include 3
type of metadat stored in separte container and using different format
:

Exif : Binary format based on JFIF/TIFF tags structure. Only to store
camera settings.
Iptc : binary format, deprecated, very limited (char encoding, string
size, etc...). To store post process properties.
Xmp: XML based container : to replace Iptc without any limitation

All metadata are managed by Exiv2 library in background. The metadata
engine is here :

https://invent.kde.org/kde/digikam/-/tree/master/core/libs/metadataengine

All code using Exiv2 API are only hosted here. Do not use Exiv2 API
outside to preserve binary compatibilty in other DK parts. Exiv2 API
is currently migrarting to use more modern C++ standard and
compilation will become the hell is we export Exiv2 API outside.
Typically all is already in place in metadata engine to host something
new to XMP without to call new Exiv2 API... Just patch the current
implementation and that all.

Best

Gilles Caulier
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Implementation for Ignored Faces

kartikx
In reply to this post by woenx
Yes, I believe Ignored should be a separate property as well. So I implemented it, so that ignored faces are stored with the property "ignoredFace" instead of "tagRegion" (as in the case of Confirmed Faces).
However, even though the Tags are being correctly marked as Ignored (I checked the .db files), the View isn't showing any faces in the Ignored category. I believe this is because the model doesn't understand how to interpret this new "ignored" property. I would really appreciate some help regarding this issue.

On Wed, May 13, 2020 at 12:45 PM woenx <[hidden email]> wrote:
Hello Kartik,

Just my two cents. Yes, I agree that the "Ignore" feature should only appear
in the "Unknown" faces category. I believe that, when given the option to
accept or reject a face/suggestion in digikam, if the face is in
"Unconfirmed" because it already has a suggestion, rejecting it should send
it back to "Unknown", and doing the same a face in "Unknown" should send
them to "Ignored" (or "Hidden", or whatever word you think it fits better).

Regarding the second issue, I can't really say. I believe the "Ignored"
should be a category in itself (like Unknown and Unconfirmed) and not just a
tag (wouldn't that interfere with the face recognition algorithm?), but the
developers will probably give better advice on this.



--
Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html