How to turn "automatically assign this person to faces" off for several Persons

Started by axel.hennig, February 09, 2025, 04:29:48 PM

Previous topic - Next topic

axel.hennig

Note: See this post below for a new feature in the next IMatch release that makes this pointless.




Problem
I have more than 500 Persons in the People-view. Most of them - I'm pretty sure - I will never see again in my life (sports club during my university time). Although, the IMatch Face-AI is really very good, I would like to turn off "automatically assign this person to faces" in the Person Editor for most of the Persons.

But, I don't want to go through all of these Persons via Person Editor and klick the corresponding button. This functionality is not available via IMWS (I've asked here:  https://www.photools.com/community/index.php/topic,14739.msg103587.html#msg103587), therefore it's not possible to write an app to do that.

My solution is (or will be, I've currently just tested it with a IMatch-test-DB):

  • In People-view, use the three dots to "Export People..." (in *.json-format).
  • Use jq (https://jqlang.org/) to manipulate the "IMatch_People.json" file. jq is a lightweight and flexible command-line JSON processor and it's free.
  • Import the manipulated / changed "IMatch_People.json" file back into IMatch (People view -> three dots -> "Import People...").

What exactly needs to be done in step 2: I've used a "*.bat" file with the following code (be careful with the quotation marks '"'):

jq-win64.exe ".data.people.[].values += {"dontAssign": [""true""]}" IMatch_People.json>IMatch_People_reimport.json

This adds

"dontAssign": [
            "true"
          ]

to each Person.

Now one can use the file "IMatch_People_reimport.json" to (re-)import it to IMatch.

All Persons now should have "automatically assign this person to faces" off and one can turn on the - hopefully much less - ones needed.

If you want to test it, use a test-IMatch-database. Afterwards make a backup of your "real" IMatch-database and try it there.

Hint: More advanced turn on / turn off possible via jq-filtering...

Damit

Unfortunately I have not had much success with IMatch matching faces. I pay for LR mostly for face recognition because, in my experience, it is light years ahead of IMatch in this regard (granted I have not upgraded to 25 yet). If IMatch would allow you do define the subset of faces to use for face recognition it would eliminate this need.

It is great that you created this work around. As someone who requested the same feature previously only to have it archived (Filtered face detection. I really don't know why requests are archived, it only stops people from liking it in the future so nothing ever gets traction. It is probably by design. But it is frustrating to see another person post the same exact feature request you made only to see it rejected because it only get 2 likes, without any consideration that the previous similar request got 2 as well. 4 likes is pretty monumental because most people do not read the feature requests and I think most are unaware that the have to hit the like button to support the feature request. But I do find it telling that this feature has been requested, in some form or another, at least 3 times in the last 4-5 years.

Anyhow, while it is great you have figured this out, it would be better if this functionality was added to IMatch. I am watching this thread to check on your progress and try your method to see if using IMatch for face recognition is something I can consider.

Mario

QuoteI really don't know why requests are archived,
I archive feature requests which don't get traction from time to time (one like from you and one from another user is not enough), to keep the feature request board manageable.

If Lr is so much better at face recognition for you than IMatch's face recognition, by all means, use it.
Whatever works for you is good.
IMatch imports the face regions Lr has created and you can use them in the same way you can use faces IMatch has created. Disable automatic face recognition in IMatch and you are all set.
No need for extra features in IMatch, I believe.


QuoteI have more than 500 Persons in the People-view. Most of them - I'm pretty sure - I will never see again i
I just delete persons I don't want. No need to keep them around.

axel.hennig

Quote from: Mario on March 11, 2025, 05:23:25 PM
QuoteI have more than 500 Persons in the People-view. Most of them - I'm pretty sure - I will never see again
I just delete persons I don't want. No need to keep them around.

Persons I don't want, I also delete. But what about Persons I would like to keep and I'm still sure that I will never see them again (e.g. grandparents who have already died).

What does Telemetry tell you? How many Persons on average do IMatch users have, given the condition, that they use this functionality. And what is the maximum number of Persons managed?

Damit

Quote from: axel.hennig on March 11, 2025, 08:39:35 PMPersons I don't want, I also delete. But what about Persons I would like to keep and I'm still sure that I will never see them again (e.g. grandparents who have already died).
My thoughts exactly. There may be people I will never see again, but do I know that I won't come across a series of photos with that person that I want to include in my database? Or what if I want to gather a bunch of photos with that person in it?  I guess keywords will help me in finding the photos, but not in doing face recognition.  I, for one, hate to delete information I took the time to generate, but I guess I can just turn them off until that eventuality. I don't know.  I have not used this feature yet as I have not upgraded yet (Not really working with tagging now, just scanning. As soon as I do, I will upgrade). Hmmm.

Mario

QuoteBut what about Persons I would like to keep and I'm still sure that I will never see them again (e.g. grandparents who have already died).
For these you set the new option. At, say, 10 persons per minute, even for 500 persons this takes an hour.
The average number of persons managed is 133 as per telemetry from today. Max is 12,293.

hluxem

QuoteProblem
I have more than 500 Persons ...
Same here.
    Files with faces: 114220
    Persons: 1065
    Faces: 201750

This may sound excessive, but these are just 50 years of family pictures. Nothing special. 

QuoteFor these you set the new option. At, say, 10 persons per minute, even for 500 persons this takes an hour.
That's going to be a lot of mouse clicks :>). It would help if you could select a number of persons and move from one person to the next without closing the window. 

QuoteMy solution 
Thanks for posting this. I will try it out when I have some time. I did import a json file for my initial person set up. Do you know if importing the json file marks the files with persons as pending metadata writeback?

Thanks,
Heiner

axel.hennig

Quote from: hluxem on March 12, 2025, 12:03:32 AMDo you know if importing the json file marks the files with persons as pending metadata writeback?

I don't think so as far as I can remember, but worth checking via a test-database.

sinus

Quote from: axel.hennig on February 09, 2025, 04:29:48 PMProblem
I have more than 500 Persons in the People-view. Most of them - I'm pretty sure - I will never see again in my life (sports club during my university time).

Hm, until now I have never used the "people-detect-recognition" from IMatch, because I have created my own people-system (names-birthdays) years before IMatch had this possibility. But mostly for family and friends.

Then I thought in the same direction like you wrote above. I want see names and age from my family, and that's it.
I write the names of athletes or bakers, farmers, etc. in the headline or description (because that's what journalists need), but I won't need that name again, even if I photograph them a second or third time.

And that is the reason for me not to use the sureley cool people-system in IMatch.
Therefore I have read the help only roughly.

But I has thougth, is there not the possibilty to use only some people for this, NOT the whole DB?
Would mean in my case with 400'000 files, that I use only the people-view for family and friends and let all others out?
And then I would not end with over 500 people like you.
I do not know this, I thought, it would be possible, because I can of course understand your point.
Best wishes from Switzerland! :-)
Markus

Mario

I had an idea how to solve this without too much effort.
The People View displays an icon to indicate when the Don't assign option is set for a person:

Image1.jpg

I have upgraded this icon to work as a switch.
It now always shows (active / greyed out) and when you click it, you toggle the Don't assign option for all selected persons.

This should bring down the time required to set this for 500 persons considerably.

But, I wonder, where do these persons come from. Usually you create persons manually, which means you create only the persons needed. Or did you import tons of persons via XMP face regions from other software?


axel.hennig

Quote from: Mario on March 12, 2025, 10:09:48 AMBut, I wonder, where do these persons come from. Usually you create persons manually, which means you create only the persons needed. Or did you import tons of persons via XMP face regions from other software?

All of these Persons were created manually and I want to keep all of them. I know all of them (at least in the past).

Before using the People-features (face detection/ face recognition /...) I've used (and still using) Persons-categories.

An example: There might be an image with two persons I know, Adam and Ben. The assigned categories tell me that on this image there is Adam and Ben, but it does not tell me which one of the two is Adam and which one is Ben. Now I know this, but in 10 years...?

That's why the People-features are so great an that's why I want to keep all manually created Persons. To exactly know who is who in an image.




Mario

Quote from: axel.hennig on March 12, 2025, 11:23:13 AMThanks a lot.
You're welcome.
Don't forget to tell others about IMatch, to subscribe to my YouTube channel and my Facebook and Bluesky profiles ;)

PandDLong

Quote from: Mario on March 11, 2025, 05:23:25 PM
QuoteI have more than 500 Persons in the People-view. Most of them - I'm pretty sure - I will never see again i
I just delete persons I don't want. No need to keep them around.

I hadn't even thought of this - I just assumed it would create an issue.  So many questions...

1. Can I reuse the tag?

2. Does deleting the person, delete any information from the files to which they are associated?

3. What if I go back to a file with a deleted person and want to make some updates?


I guess I should just test out this concept.


Is the point of adding a person, that you will delete afterwards, just a way to get their name into the 'PersonInImage' tag or is there more benefit to this temporary Person?

I have taken a totally different approach to this challenge but perhaps I over-complicated it.


Michael

hluxem

QuoteI have upgraded this icon to work as a switch.
It now always shows (active / greyed out) and when you click it, you toggle the Don't assign option for all selected persons.
Thanks a lot for this upgrade!


axel.hennig

Quote from: PandDLong on March 13, 2025, 12:34:12 AM1. Can I reuse the tag?
Not completely sure what exactly you mean with that.


Quote from: PandDLong on March 13, 2025, 12:34:12 AM2. Does deleting the person, delete any information from the files to which they are associated?
YES! Be careful with that!

Example 1: The Person will be removed from the 'PersonInImage' tag.

Example 2: If you set e.g. for the Person you would like to delte within the Person Editor a Category which is automatically assigned for all files belonging to that Person, then, when you delete that Person all Category assignments will be also deleted (i.e. the images will be removed from that Category, but the Category itself - of course - will not be deleted).


Quote from: PandDLong on March 13, 2025, 12:34:12 AM3. What if I go back to a file with a deleted person and want to make some updates?
Don't understand what you mean with that. What kind of 'updates'?


Quote from: PandDLong on March 13, 2025, 12:34:12 AMI guess I should just test out this concept.
Definitely yes. Don't do this with you real database, use a test database first.


Quote from: PandDLong on March 13, 2025, 12:34:12 AMIs the point of adding a person, that you will delete afterwards, just a way to get their name into the 'PersonInImage' tag or is there more benefit to this temporary Person?
NO! If you delete the Person, the 'PersonInImage' tag will be updated, i.e. the Person you've deleted will be removed from 'PersonInImage' tag.

axel.hennig

@Mario: Is there a way that I can edit my first post? I would like to add a note that this workaround is no longer needed since in IMatch 2025.1.16 this feature is directly implemented.

Mario

Quote from: axel.hennig on March 13, 2025, 09:00:09 AM@Mario: Is there a way that I can edit my first post? I would like to add a note that this workaround is no longer needed since in IMatch 2025.1.16 this feature is directly implemented.
I have added a not to your post.

PandDLong

Quote from: axel.hennig on March 13, 2025, 08:58:01 AM
Quote from: PandDLong on March 13, 2025, 12:34:12 AM2. Does deleting the person, delete any information from the files to which they are associated?
YES! Be careful with that!

Example 1: The Person will be removed from the 'PersonInImage' tag.

Example 2: If you set e.g. for the Person you would like to delte within the Person Editor a Category which is automatically assigned for all files belonging to that Person, then, when you delete that Person all Category assignments will be also deleted (i.e. the images will be removed from that Category, but the Category itself - of course - will not be deleted).


Quote from: PandDLong on March 13, 2025, 12:34:12 AMIs the point of adding a person, that you will delete afterwards, just a way to get their name into the 'PersonInImage' tag or is there more benefit to this temporary Person?
NO! If you delete the Person, the 'PersonInImage' tag will be updated, i.e. the Person you've deleted will be removed from 'PersonInImage' tag.

Thanks for the info - that is what I thought would happen.  I just got a bit confused when a couple people mentioned about deleting persons they don't need - I guess they meant the annotations not the entry in the People database.

Michael