Main Menu

avpicfacexmptagger

Started by ficanas, November 01, 2018, 10:31:30 AM

Previous topic - Next topic

ficanas

Hi, Olivier from France..

Could someone send me a copy of avpicfacexmptagger 1.7, can't download it from the author's web site.

Thanks

StarGeek

If all you want is the ability to embed face tags from Picasa, then you can use the picasa_faces.config file included in the main exiftool archive (or download it from SourceForge).

It does appear that the file links (and forum) on Andreas Vogel's wiki are down, returning 500 Internal Server Error.

I'm sorry, I no longer have a copy of this program.
* 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).

ficanas

Thanks, Stargeek, I'll try that

elhiero

#3
I have got this software, answer by MP to Olivier.

I'm going to try the config file that StarGeek is talking about.
I tried to shorten it to use only xmp:subject and iptc:keywords  (my config file = picasaface03.txt)
I used "ffffff" tag in Picasa for unidentified faces. No matter

I think I'll use this command line :  (shortcut for Win7)
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" -xmp:subject+<PicasaRegionNames -iptc:keywords+<PicasaRegionNames -k

Do you think I can add also  xmp:lr:hierachicalsubject ?
First , I wish define a 1st hierarchical keyword : family
Then, I would like to obtain hierarchical keywords like : family, family|john, family|jack

Edit  : Andreas Vogel website (AvPicFaceXmpTagger)  is back !

Edit2: StarGeek is right, see next post, I had to read : download and forum do not work in this website

Edit3: I have downloaded this zip file last month .  (3.8 Mo) If anyone wants it, my email is in my website, homepage, "contact"  button.

Edit3 : It's better to use xmp-dc:subject instead of xmp:subject, otherwise I get an error "Warning: Shift value for XMP-pdf:Subject is not a number"

StarGeek

Quote from: elhiero on November 12, 2018, 08:19:55 AM
Do you think I can add also  xmp:lr:hierachicalsubject ?
First , I wish define a 1st hierarchical keyword : family
Then, I would like to obtain hierarchical keywords like : family, family|john, family|jack

As long as all the faces go in the Family hierarchy, then it would be as simple as
exiftool.exe -config "C:\Tool\conf\picasaface03.txt" "-hierachicalsubject<Family|$PicasaRegionNames FileOrDir

If the hierarchy would depend upon the name, that would be more complex, probably require the writing of a new user defined tag if the list of names and separate hierarchies got too long.

QuoteEdit  : Andreas Vogel website (AvPicFaceXmpTagger)  is back !

The Wiki part of the website was never down.  The problem is that the program cannot be downloaded (see Downloads, returns HTTP ERROR 500, which is an Internal Server Error).  Also, as I mentioned, the forum doesn't work.
* 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).

elhiero

Thank you StarGeek for your quick answer

For IPTC and XMP keywords, it works perfectly with this line
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" "-xmp-dc:subject+<PicasaRegionNames" "-iptc:keywords+<PicasaRegionNames" -k

I tried StarGeek suggestion :
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" "-xmp-lr:hierarchicalsubject+<family|$PicasaRegionNames" -k

- I got a warning [minor] Tag 'PicasaRegionName'  not defined , no matter
- But the result is family|john, jack instead of family, family|john, family|jack

... perhaps because I shortened the  downloaded config file ?

In my "Picasa Faces Config"  file, I  had to replace string for Picasa contacts.xml file
I need using backslashes for the path (for windows 7) , and my own Picasa contacts.xml file  is located here :
my $contactXML = 'C:\Users\M\AppData\Local\Google\Picasa2\contacts\contacts.xml';


StarGeek

Quote from: elhiero on November 12, 2018, 02:04:41 PM
- I got a warning [minor] Tag 'PicasaRegionName'  not defined , no matter

Make sure you use PicasaRegionNames, not PicasaRegionName (missing the trailing s).

Quote- But the result is family|john, jack instead of family, family|john, family|jack

Sorry, very dumb mistake on my part.  I didn't think it through to add Family| to every name on the list.

For just Family, you'll have to add that separately.  For the rest, you could use
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames"
or
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" -sep "##" "-xmp-lr:hierarchicalsubject+<${PicasaRegionNames@;s/^/Family|/}"


QuoteI need using backslashes for the path (for windows 7) , and my own Picasa contacts.xml file  is located here :
my $contactXML = 'C:\Users\M\AppData\Local\Google\Picasa2\contacts\contacts.xml';

Nothing wrong there.  The code won't differentiate between back and forward slashes when it comes to file paths and internally, it will be treated as forward slashes.
* 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).

elhiero

#7
Great !
No more warnings.
I tested the full version of Picasa Faces Config file  following the download link you gave, it works fine. It's not useful to shorten the file.

For hierachical keywords, this line
QuoteC:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt" -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames" 
is the good one. It works fine. Thank you very much
The second one gives a one-string keywords list with commas as separators, it's not the right syntax.

Then I'm  trying to add the first  keyword,
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt"  -api "Filter=s/^/family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames" "-xmp-lr:hierarchicalsubject+=family" -k
but  the keyword "family"  will be added in all photos, even if there is no one


StarGeek

Quote from: elhiero on November 12, 2018, 04:48:46 PM
I tested the full version of Picasa Faces Config file  following the download link you gave, it works fine. It's not useful to shorten the file.

If you want a shorter command line, place it in the same directory as exiftool and you don't need to use the whole path (as long as your exiftool version is up to date).  For example, this should work:
C:\Tool\exiftool.exe -config picasaface03.txt

QuoteIt works fine. Thank you very much

The downside is that the -api Filter will affect all tags, so you don't want to copy any other tags in this command.

QuoteThe second one gives a one-string keywords list with commas as separators, it's not the right syntax.

Interesting, so it does.  It works correctly, passing a list when used without the @ operation.  If I have time, I'll have to look into this.

QuoteThen I'm  trying to add the first  keyword,
C:\Tool\exiftool.exe -config "C:\Tool\conf\picasaface03.txt"  -api "Filter=s/^/family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames" "-xmp-lr:hierarchicalsubject+=family" -k
but  the keyword "family"  will be added in all photos, even if there is no one

Add a check to see if PicasaRegionNames exists.
exiftool -config "C:\Tool\conf\picasaface03.txt" -api "Filter=s/^/family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames" "-xmp-lr:hierarchicalsubject+=family" -k -if "$PicasaRegionNames"


* 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).

elhiero

Simplified abstract

The configuration file picasa_faces.config proposed by StarGeek is placed in C:\ and ExifTool too
To put Picasa tags in IPTC keywords, the command is :
exiftool -config picasa_faces.config "iptc:keywords+<PicasaRegionNames"

If face keywords already existed, to avoid duplicates I tried:
exiftool -config picasa_faces.config "iptc:keywords-<PicasaRegionNames" "iptc:keywords+<PicasaRegionNames"
but it doesn't work.
Question 1: Should I run two separate commands?
exiftool -config picasa_faces.config "iptc:keywords-<PicasaRegionNames"
then
exiftool -config picasa_faces.config "iptc:keywords+<PicasaRegionNames"

- There are people in only 20% of the thousands of photos.
Question 2: Is the process faster by adding -if "$PicasaRegionNames" to each line?



For hierarchical keywords, it's the same, two commands as well

exiftool -config picasa_faces.config -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject-<PicasaRegionNames"
and
exiftool -config picasa_faces.config -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames"

Then I add the root keyword "family"
exiftool -config "-xmp-lr:hierarchicalsubject-=family" "-xmp-lr:hierarchicalsubject+=family" -if "$PicasaRegionNames"
:o this time it works with -= and += in the same command line, why ?)

In total that makes 5 command lines. There is probably something simpler?

Translated with www.DeepL.com/Translator

StarGeek

Quote from: elhiero on November 14, 2018, 04:36:28 PM
- There are people in only 20% of the thousands of photos.
Question 2: Is the process faster by adding -if "$PicasaRegionNames" to each line?

I'm not sure, but I don't think so, because it will still have to run the code to detect if there's a PicasaRegionNames defined on every file.  That's probably the biggest performance hit.

QuoteThe configuration file picasa_faces.config proposed by StarGeek is placed in C:\ and ExifTool too
To put Picasa tags in IPTC keywords, the command is :
exiftool -config picasa_faces.config "iptc:keywords+<PicasaRegionNames"

If face keywords already existed, to avoid duplicates I tried:
exiftool -config picasa_faces.config "iptc:keywords-<PicasaRegionNames" "iptc:keywords+<PicasaRegionNames"
but it doesn't work.

Adding to my list of thing to check.  Though I won't be able to get to it for quite a while.

QuoteQuestion 1: Should I run two separate commands?
exiftool -config picasa_faces.config "iptc:keywords-<PicasaRegionNames"
then
exiftool -config picasa_faces.config "iptc:keywords+<PicasaRegionNames"

For hierarchical keywords, it's the same, two commands as well

exiftool -config picasa_faces.config -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject-<PicasaRegionNames"
and
exiftool -config picasa_faces.config -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames"

Then I add the root keyword "family"
exiftool -config "-xmp-lr:hierarchicalsubject-=family" "-xmp-lr:hierarchicalsubject+=family" -if "$PicasaRegionNames"

In total that makes 5 command lines. There is probably something simpler?

I would instead suggestion combining the commands that add metadata, then running a second command to remove duplicate Keywords and HierarchicalSubject.  Something like this:
exiftool -config picasa_faces.config -if "$PicasaRegionNames" -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames" "-iptc:keywords+<PicasaRegionNames#" "-xmp-lr:hierarchicalsubject+=family"
then
exiftool -sep "##" "-xmp-lr:hierarchicalsubject+<${xmp-lr:hierarchicalsubject;NoDups}" "-iptc:keywords+<${iptc:keywords;NoDups}"

In the first command, the hashtag # is used to get the original value of PicasaRegionNames unaffected by the -api Filter option (see -n (printConv) option for details).  The second command uses the NoDups helper function
* 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).

elhiero

I'm  slowing down ...

Quotethen
exiftool -sep "##" "-xmp-lr:hierarchicalsubject+<${xmp-lr:hierarchicalsubject;NoDups}" "-iptc:keywords+<${iptc:keywords;NoDups}"
There is a copy / paste mistake : we must use < instead of +<  (I followed the link for "NoDups"  function, no problem)

Now I can do all the process in 3 times because I think there is a maximum of 256 characters in a shortcut ... I'm still studying


I tried also the -@ argfile ; the documentation says "no -config option", so I used default .ExifTool_config  .  It's working but tricky ...
I tried to use the NoDups function with -@ argfile : results are strange for some pictures
When I use both (-@ argfile and   .ExifTool_config ) some hierachical keywords are added even if I don't touch any of them.

StarGeek

Quote from: elhiero on November 19, 2018, 05:58:56 PM
I tried also the -@ argfile ; the documentation says "no -config option",

Remember, while you can't use the -Config option in a arg file, you can still use it on the command line.  For example:
exiftool -config picasa_faces.config -@ MyArgFile.args
* 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).

Phil Harvey

If you're running into a line-length limitation in a shortcut then you could go to a .bat file instead.

- 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 ($).

elhiero

#14
YEAH !
Solved.
To come back to the beginning, if someone is looking for  Avpicfacexmptagger software,  I have put it in my iptc-softwares page :
http://orchisere.pagesperso-orange.fr/logiciels/html/IPTClogiciel.htm#apfxt
direct link : http://orchisere.pagesperso-orange.fr/ztele/avpicfacexmptagger_1.7.zip
This software does the job, even if faces are in different groups (family, friends, celebrities ...) but doesn't write root hierarchical keyword alone (the reason why I'm using ExifTool)

I followed Stargeek's advice. 
QuoteI would instead suggestion combining the commands that add metadata, then running a second command to remove duplicate Keywords and HierarchicalSubject.  Something like this:
exiftool -config picasa_faces.config -if "$PicasaRegionNames" -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames"
For this first step,  I added #  in expression -if "$PicasaRegionNames#" I dont know if it's necessary, but I got best results in some other tests.
Then I moved  -iptc:keywords+<PicasaRegionNames#  and -xmp-lr:hierarchicalsubject+=family" to an -@argfile

Result, my first shortcut (named Full Keywords) contains : 
exiftool -config C:\Tool\conf\picasa_faces.config -if "$PicasaRegionNames#" -@ "C:\Tool\conf\args.txt" -api "Filter=s/^/Family|/" "-xmp-lr:hierarchicalsubject+<PicasaRegionNames"

Where C:\Tool\conf\args.txt file contains :
-xmp-dc:subject+<PicasaRegionNames#
-iptc:keywords+<PicasaRegionNames#

-xmp-dc:subject+=family
-iptc:keywords+=family
-xmp-lr:hierarchicalsubject+=family

-k

(I could not use neither "-api" for hierarchicalsubject nor "-if PicasaRegionNames"  inside the args file, results were different for some photos)

Second step, remove duplicates, as suggested by StarGeek.
exiftool -sep "##" "-xmp-lr:hierarchicalsubject<${xmp-lr:hierarchicalsubject;NoDups}" "-iptc:keywords<${iptc:keywords;NoDups}" "-xmp-dc:subject<${xmp:subject;NoDups}"
The advantage of this second step is to eliminate any duplicates in all keywords and photos, even if Picasa Faces has not been used.

One day, I'll add  -r to these shortcuts ...  :scared:

Many thanks for this help, I understood a lot of new methods, that I'll have to explain in my own ExifTool page