How many persons are on a picture?

Started by axel.hennig, November 19, 2017, 09:06:43 PM

Previous topic - Next topic

axel.hennig

Hi,

this post is just to inform on my new Data-driven category. Perhaps other users may think that this is helpful.

In old IMatch 3 times I had a script with what I could search for pictures only containing one, two, three,... specific persons. This post https://www.photools.com/community/index.php?topic=7269.0 describes a simplier but similar problem. I didn't want to implement this script to the new progamming language used in IMatch 2017 (and it is not necessary). In the mentioned post above Mario suggests to add additional info (additional categories for example) to the pictures containing the number of people on the pictures.

This is not really practicable for me since I would have to do this for all my pictures in my db (not done so far, just persons are tagged). And this isn't necessary (sometimes even Mario doesn't know how powerful his software is).

Inspired by this post https://www.photools.com/community/index.php?topic=7373.0 IMatch counts the assigned categories under "@All|Persons" in a Data-driven category. This looks like (see also attachment for configuration):

|-- NumberOfPersons
  |-- 00
  |-- 01
  |-- 02
  |-- 03
and so on

Now I can make something like

Persons|John AND Persons|Lisa AND NumberOfPersons|02

and I get only pictures with John and Lisa without any other persons... really great.

Axel

PS: See also this post https://www.photools.com/community/index.php?topic=2671.0

Mario

Thanks for sharing. I will move this into more appropriate board.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Another way is to use this variable expression:

{File.Categories|filter:^@Keywords\|Persons;count:true}

Assuming you use keywords like Persons|Paul or Persons|Mary to tag the people in your files, this returns the number of Persons categories (keywords) used on a file.

For a file with these keywords:

Color|Blue
Motive|Sky
Persons|Jim
Persons|Jill
Location|Germany|Munich


this variable returns 2.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

plastikman

Does this still work? I am trying to get counts for the number of people in my photos but with the formulas in the posts above the application freezes and crashes instantly for me.

Jingo

IF you have done Face Recognition - the following will provide a count of faces in the photos.. I use this for the custom thumbnail display: {File.MD.XMP::iptcExt\PersonInImage\PersonInImage\0|count:true}

Mario

Quote from: Jingo on March 29, 2020, 02:14:02 PM
IF you have done Face Recognition - the following will provide a count of faces in the photos.. I use this for the custom thumbnail display: {File.MD.XMP::iptcExt\PersonInImage\PersonInImage\0|count:true}

Why don't you use the proper Persons. Variables?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

#6
Quote from: Mario on March 29, 2020, 02:50:04 PM
Quote from: Jingo on March 29, 2020, 02:14:02 PM
IF you have done Face Recognition - the following will provide a count of faces in the photos.. I use this for the custom thumbnail display: {File.MD.XMP::iptcExt\PersonInImage\PersonInImage\0|count:true}

Why don't you use the proper Persons. Variables?

Good question.. I don't have a good answer!  Just changed my layout to use: {File.Persons.Tag|count:true} instead... works like a charm...

plastikman

Quote from: Jingo on March 29, 2020, 02:55:46 PM
Quote from: Mario on March 29, 2020, 02:50:04 PM
Quote from: Jingo on March 29, 2020, 02:14:02 PM
IF you have done Face Recognition - the following will provide a count of faces in the photos.. I use this for the custom thumbnail display: {File.MD.XMP::iptcExt\PersonInImage\PersonInImage\0|count:true}

Why don't you use the proper Persons. Variables?

Good question.. I don't have a good answer!  Just changed my layout to use: {File.Persons.Tag|count:true} instead... works like a charm...

Exactly what I was looking for, thanks!

mastodon

I have just began to use data driven categories, and did not find, how to let sort the result like numbers. Now I have persons:
0
1
10
11
but want:
1
2
3

Mario

0
1
10
11

is the correct numerical order?
If you get a different order, check the sort settings Configuring Categories
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

mastodon