Author Topic: How many persons are on a picture?  (Read 3544 times)

axel.hennig

  • Full Member
  • **
  • Posts: 219
How many persons are on a picture?
« on: November 19, 2017, 09:06:43 PM »
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

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31552
Re: How many persons are on a picture?
« Reply #1 on: November 19, 2017, 10:49:39 PM »
Thanks for sharing. I will move this into more appropriate board.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31552
Re: How many persons are on a picture?
« Reply #2 on: November 25, 2017, 02:35:21 PM »
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.

plastikman

  • Full Member
  • **
  • Posts: 157
  • New user for IMatch 2020
Re: How many persons are on a picture?
« Reply #3 on: March 29, 2020, 02:05:07 PM »
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

  • Super Hero
  • ****
  • Posts: 1972
Re: How many persons are on a picture?
« Reply #4 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}

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31552
Re: How many persons are on a picture?
« Reply #5 on: March 29, 2020, 02:50:04 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?

Jingo

  • Super Hero
  • ****
  • Posts: 1972
Re: How many persons are on a picture?
« Reply #6 on: March 29, 2020, 02:55:46 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...
« Last Edit: March 29, 2020, 03:01:40 PM by Jingo »

plastikman

  • Full Member
  • **
  • Posts: 157
  • New user for IMatch 2020
Re: How many persons are on a picture?
« Reply #7 on: March 29, 2020, 05:26:07 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

  • Sr. Member
  • **
  • Posts: 390
Re: How many persons are on a picture?
« Reply #8 on: March 29, 2020, 07:55:08 PM »
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

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31552
Re: How many persons are on a picture?
« Reply #9 on: March 29, 2020, 09:07:41 PM »
0
1
10
11

is the correct numerical order?
If you get a different order, check the sort settings Configuring Categories

mastodon

  • Sr. Member
  • **
  • Posts: 390
Re: How many persons are on a picture?
« Reply #10 on: March 29, 2020, 09:38:22 PM »
Thanks, The GEAR!