XMP face tags written to JPG from Picasa, written to filename possible?

Started by teredactle, June 28, 2024, 02:14:14 AM

Previous topic - Next topic

teredactle

Hi!

I've recently downloaded the last Picasa version in order to face tag a whole bunch of family pictures over the past 40 years. I don't find any current SW to do this, seems this decade old app still works better and faster than what's out there today, and it's free.

The last version before google dumped it, has a feature to write the face tags to the file through XMP metadata. I ran a test on a folder of photos, and it works. Using ExifTool GUI, I see that under the XMP tab, there is a tag called "RegionsRegionListName" and this is where the name of the person is stored. There are 0 or several entries, due to how the areas defined of the faces.

I'd like to rename the files, using all the existing RegionsRegionListName entries the file has into the file name (separated by a space).

Like this: filname.jpg renanmed to filename RegionsRegionListName RegionsRegionListName RegionsRegionListName.jpg

Is this possible to do on the fly? I can't seem to understand or find any info if this is possible or not.

Thank you in advance!

Phil Harvey

I think you can do it like this:

exiftool "-testname<reionsregionlistname.%e" -sep " " DIR

If this shows the desired file names, change "testname" to "filename" to actually do the renaming.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: teredactle on June 28, 2024, 02:14:14 AMI don't find any current SW to do this, seems this decade old app still works better and faster than what's out there today, and it's free.

DigiKam does facial recognition, is much better at it than Picasa, and is free. It also doesn't delete MakerNotes like Picasa does with many camera brands.

Imatch is even better at facial recognition, but it is expensive.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

teredactle

#3
Quote from: Phil Harvey on June 28, 2024, 01:11:06 PMI think you can do it like this:

exiftool "-testname<reionsregionlistname.%e" -sep " " DIR

If this shows the desired file names, change "testname" to "filename" to actually do the renaming.

- Phil


Thanks Phil, I have the JPG file in the same folder I have exiftool and I get this error:

C:\winapps\Exif>exiftool "-testname<reionsregionlistname.%e" -sep " " 4-21-2010_032.JPG
Warning: No writable tags set from 4-21-2010_032.JPG
Warning: Invalid tag name 'reionsregionlistname.%e'. Use '=' not '<' to assign a tag value - 4-21-2010_032.JPG
    0 image files updated
    1 image files unchanged

However, I was running an old version of Exiftool when I initially posted; if I open the file with ExiftoolGui, I see the tagged names, one after the other on the RegionName tag instead. So I changed the command to reflect this, but I get the same error.

C:\winapps\Exif>exiftool "-testname<RegionName.%e" -sep " " 4-21-2010_032.JPG
Warning: No writable tags set from 4-21-2010_032.JPG
Warning: Invalid tag name 'regionname.%e'. Use '=' not '<' to assign a tag value - 4-21-2010_032.JPG
    0 image files updated
    1 image files unchanged


StarGeek

Quote from: teredactle on June 30, 2024, 11:27:18 PMC:\winapps\Exif>exiftool "-testname<reionsregionlistname.%e" -sep " " 4-21-2010_032.JPG
Warning: No writable tags set from 4-21-2010_032.JPG
Warning: Invalid tag name 'reionsregionlistname.%e'. Use '=' not '<' to assign a tag value - 4-21-2010_032.JPG
    0 image files updated
    1 image files unchanged

It was a misspelling (regions not reions) and a missing dollar sign. But it wouldn't have worked anyway because you were using a very old version, as the MWG regions appear to have been added back in version 9.98, June 26, 2015.

As you figured out, the correct name is RegionName.  Now all you need is the dollar sign in the right place

exiftool "-Testname<$RegionName.%e" -sep "" /path/to/files/
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

teredactle

Wow amazing Phil, definitely pulling the face tags to the filename, so happy about this!!
I will need to spend some time as I'd like to:

1)Append these face tag names to the existing filename instead of totally overwriting it
2)Somehow separate the tags with a space between them as they get written to the filename (I assume this is possible with the right syntax)

I think I can figure this out once I can find some time, the 2nd one not really necessary but cleaner.

As Digikam was mentioned here, can that sw also append to the filename as exiftool does using the tags from the XMP metadata; really doing batch renaming (like BRU)? Do you know if that is possible @starkgeek?

TY Both!

StarGeek

Quote from: teredactle on July 01, 2024, 01:09:16 AM1)Append these face tag names to the existing filename instead of totally overwriting it
2)Somehow separate the tags with a space between them as they get written to the filename (I assume this is possible with the right syntax)

You can use %f to use the original base filename, similar to how %e is used for the original extension.  And the -sep option used above would put a space between each person's name

Example:
C:\>exiftool "-Testname<%f $RegionName.%e" -Sep " " y:\!temp\Test4.jpg
'y:/!temp/Test4.jpg' --> 'y:/!temp/Test4 Indian Jones Marion Ravenwood Henry Jones Sr..jpg'
    0 image files updated
    1 image files unchanged

QuoteAs Digikam was mentioned here, can that sw also append to the filename as exiftool does using the tags from the XMP metadata; really doing batch renaming (like BRU)? Do you know if that is possible @starkgeek?

I don't use DigiKam, so I don't know the extent of its renaming ability.  Looking at DigiKam's Digikam/Renaming Photos page, it says
QuoteThe Metadata button gives you access to EXIF and other photo metadata you can use in renaming rules.
So it might.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

teredactle

Wow amazing, thank you for saving me what could have potentially been a lot of time spent to figure this out.

I will check out Digikam when I have a chance, I've tried to search anyone that has done a Picasa vs Disgikam face recognition comparison, but haven't been able to, this is the only post I've found and it's locked (it's old)

https://www.reddit.com/r/DataHoarder/comments/kaqhqc/picasa_vs_digikam_faces_tagging/

I will have to do the same, side by side, Picasa and Digikam - but the post there is correct in saying at some point Picasa will be dead and not usable, so moving on is wise.

In terms of taking the faces tagged with Digikam and using Exiftool in order to do the same (as I'm doing now, renaming the files with the names) - do either of you have any experience in that? It seems they are written to a different field (not RegionName) like with Picasa.

In any case, your help is much appreciated, I'm behind several years on my home photo organization but this has been amazingly helpful!!!

StarGeek

I'm pretty sure that DigiKam writes to the same place (XMP-mwg-rs tags) as Picasa does. I'm guessing that the reason it didn't work in that /r/DataHoarder thread is because Picasa would only read a limited amount of decimals.  Too many decimals in the Region location data would cause Picasa to choke.

Found it in the Picasa_faces.config. Looks like I was able to narrow it down to 9 decimal places. More than that and Picasa didn't read the regions.

Comparison wise, I haven't tested Digikam, but I use IMatch, which I think uses the same open source(?) code, as they both gained the ability at about the same time. Imatch was much more accurate then Picasa and able to recognize more faces, especially if the head was tilted. The only place I recall Picasa doing better was in profiles, but that was more that it recognized a face, often placing the box around the eyes and nose, not down to the chin. And while it recognized there was a face, it usually couldn't identify the faces correctly.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).