• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.

search for multiple same keywords in same photo

Status
Not open for further replies.

Reddwarf4ever

Active Member
Joined
Aug 2, 2022
Messages
250
Lightroom Version Number
11.4.1
Operating System
  1. Windows 10
i have a number of photos with family pictures on the wall, therefore end up with more than one of the same keyword (face tag) in the same photo. wonder if theres a way to search for this

thanks
 
i have a number of photos with family pictures on the wall, therefore end up with more than one of the same keyword (face tag) in the same photo. wonder if theres a way to search for this

thanks

I believer that a keyword can only be assigned once to an individual photo. In a hierarchial Keyword structure, you can have multiple instance of the keyword, each with a different parent.

Can you describe better what your issue is?


Sent from my iPad using Tapatalk
 
I believer that a keyword can only be assigned once to an individual photo. In a hierarchial Keyword structure, you can have multiple instance of the keyword, each with a different parent.

Can you describe better what your issue is?


Sent from my iPad using Tapatalk
Sometimes, I get two people tagged with the same keyword, usually has a tick for confirmation. Sometimes this happens with people and sometimes with pictures on the wall of the person in the photo. So thought it would be nice as a double check, without opening every photo, to search for multiple instances of the same keyword in the same photo, but fully expect that not to be possible….thank you

P.S. The keyword in question is in the same parent.
 
I've not tested this but I suspect that your keyword field will contain only one keyword. However there will be multiple face detection regions in the image and more than one of these will be associated with the same person keyword. I can think of no quick means to identify face detecting regions in images that contain the same keyword.
Remember there are three tables in the Lightroom catalog database that make the unique connections. The master table is the image table where all imported images are managed, the Keyword table where all of the keywords are managed including the "people" keywords. And finally, the Face Region Table where all of the face regions are stored. The Face region table contains references to both the image table and the keyword table. I don't think it is possible to filter on the person table other than the Person View.
 
I've not tested this but I suspect that your keyword field will contain only one keyword. However there will be multiple face detection regions in the image and more than one of these will be associated with the same person keyword. I can think of no quick means to identify face detecting regions in images that contain the same keyword.
Remember there are three tables in the Lightroom catalog database that make the unique connections. The master table is the image table where all imported images are managed, the Keyword table where all of the keywords are managed including the "people" keywords. And finally, the Face Region Table where all of the face regions are stored. The Face region table contains references to both the image table and the keyword table. I don't think it is possible to filter on the person table other than the Person View.
Thanks
 
You can use the Any Filter plugin to search for photos that have two or more face rectangles assigned the same name.

Define the following search query:
1660925105960.png


where you've copy/pasted the following into the "code" field:

Code:
(function ()
    local names = {}
    for _, face in ipairs (Faces) do
        names [face.Name] = (names [face.Name] or 0) + 1
        if names [face.Name] > 1 then return true end
        end
    Debug.lognpp (Faces, names)
    return false
    end)()

Be sure to select all the photos you're searching and do Metadata > Save Metadata To File first -- otherwise Any Filter won't be able to read the face data.
 
You can use the Any Filter plugin to search for photos that have two or more face rectangles assigned the same name.

Define the following search query:
View attachment 19152

where you've copy/pasted the following into the "code" field:

Code:
(function ()
    local names = {}
    for _, face in ipairs (Faces) do
        names [face.Name] = (names [face.Name] or 0) + 1
        if names [face.Name] > 1 then return true end
        end
    Debug.lognpp (Faces, names)
    return false
    end)()

Be sure to select all the photos you're searching and do Metadata > Save Metadata To File first -- otherwise Any Filter won't be able to read the face data.
Thank you, sounds interesting, so i still need the code you gave, its part of the plugin ?
 
In Any Filter's Search command, click New to define a new search query (similar to a smart collection). Then fill out the fields as shown in the screenshot above, copying/pasting the code I provided into the "code" field of the query.

(Any Filter lets you do a huge number of things without any special code at all, but when the occasional specialized request appears, the Code query lets me provide quick solutions with a minimum of programming.)
 
I did leave a space before the final two brackets, but after I took the screenshot,
(function ))
I guess I’m doing something wrong, just can’t see what ‍:humble:
 
Hi
so you actually paste the code into the box showing CODE, as the code was in the main window, I assumed it should be pasted there, my mistake, will try again later, thanks.
 
I followed the Video,I must still be doing something wrong, when i paste the code into the code box the only text that pastes is the (function ()
 

Attachments

  • help.jpg
    help.jpg
    32.7 KB · Views: 47
Assuming you pasted all 9 lines, then that's expected, as shown at 0:53 in the screen recording. If you click OK and then re-Edit the saved filter, you should see all nine lines, as shown at 0:56.
 
Hello
I am so sorry, must be an age thing, I watched the video several times, and still didn’t twig that. just saving all the catalog metadata to the files, when that’s finished I will give it a whirl. It’s most likely straight forward for you to write these routines, bit I can’t see how I would work it out myself, I’ve done some programming in the past, but this is confusing, he great to find all the duplicate keywords in the same photo, strangely enough, when I re check some of the photos, for icture editing, I have noticed some keywords in photos, that shouldn’t be there, it’s possible I did it in a moment of madness, but there’s been a few, hope it’s not a bug that randomly moves keywords around, that would really defeat me.

thanks again
 
Still cant get this to work, if I look at johns images and mine, the panels are different, wonder if we are using different variations of LR, have emailed John, hopefully can sort this asap
 
This turned out to be bug introduced in recent LR versions on Windows -- LR discards multiple lines pasted into a one-line-high text box:
https://community.adobe.com/t5/ligh...uncates-multi-line-pasted-text/idc-p/13251751

The workaround is to copy/paste the code with all line breaks removed (ugh):
(function () local names = {} for _, face in ipairs (Faces) do if face.Name ~= "" and names [face.Name] then return true end names [face.Name] = true end Debug.lognpp (Faces, names) return false end)()
 
In Any Filter's Search command, click New to define a new search query (similar to a smart collection). Then fill out the fields as shown in the screenshot above, copying/pasting the code I provided into the "code" field of the query.
 
An update on the Any Filter plugin solution posted above: I released a new version of Any Filter that reads the face information directly from the catalog (rather than using the Exiftool utility), and queries about faces now run much, much faster, and you don't need to do Metadata > Save Metadata To File beforehand.
 
Status
Not open for further replies.
Back
Top