Author Topic: Create categories from Picasa Name Tags  (Read 7111 times)

Ceiriog

  • New Members
  • *
  • Posts: 30
Create categories from Picasa Name Tags
« on: May 26, 2014, 12:15:25 AM »
I am converting an iMatch 3 script to create categories in iMatch 5

In iMatch 3, the following command:
   s = db.ParseVariables("{Image.XMP.http://www.metadataworkinggroup.com/schemas/regions/mwg-rs:Regions/mwg-rs:RegionList[" + CStr(r) + "]/mwg-rs:Name}",img)

would get the Picasa Name tag value.

In my new script, I am using the following command:
s = context.Parse("{Image.XMP.http://www.metadataworkinggroup.com/schemas/regions/mwg-rs:Regions/mwg-rs:RegionList[" + CStr(r) + "]/mwg-rs:Name}")

which should give me the same result, but I am getting nothing.  What am I missing here?

I am sure all my settings are correct as I can get results for variables such as {File.FullName} or {File.DateTime}, but I can't seem to get a result for the {Image.XMP......) variable.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #1 on: May 26, 2014, 07:29:43 AM »
Without seeing the actual metadata IMatch has extracted from your file it is impossible to comment.
Please send me one of your files, or several so I can have a look.

I think you can also make IMatch produce categories from MWG name tags using plain data-driven categories. No need for scripts, unless you want something specific.

Ceiriog

  • New Members
  • *
  • Posts: 30
Re: Create categories from Picasa Name Tags
« Reply #2 on: May 26, 2014, 03:47:48 PM »
Using the xmp editor in iMatch3, the attached file has a Face Tag under the variable name:

http://www.metadataworkinggroup.com/schemas/regions/mwg-rs:Regions/mwg-rs:RegionList[1]/mwg-rs:Name

In the original script written by: Arend Fuite, 'image.XMP.' is appended to the front of the above string to get the actual variable name.  Not sure where this name is documented, but I am assuming it is the same variable name in iMatch5, since we are using the same image file.

The Picasa Face Tag in the attached file is: 'Raniseth, Steve'

[attachment deleted by admin]

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #3 on: May 26, 2014, 04:05:53 PM »
IMatch 5 uses a totally different system to work with metadata than IMatch 3.

You can use the VarToy App to experiment with variables.
To get the variable name for any metadata tag displayed in the Metadata Panel, right-click the tag entry and then choose Copy as Variable. Then paste the variable wherever you need it.

To see all metadata contained in your files in the Metadata Panel, switch it to the Browser mode.

This is what I did. I added your file to a database and looked at it in the Metadata Panel in Browser mode. The metadata tag with the person name / title is named Regionname:



I now created a new data-driven category in the Category View. Using the RegionName tag IMatch automatically extracts each region name (person) from your files, and produces a child category for each unique name. It then assigns the files containing regions with that name to that category.



This gives you an automatic "persons in image" category hierarchy without the need for scripts. In your database you should see many more child categories for persons of course. My database contained only your image for this test.



It's done in 30 seconds and from then on it's fully automatic.

[attachment deleted by admin]

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #4 on: May 26, 2014, 04:09:33 PM »
PS.: If possible, can you produce a few more sample files with multiple persons and send them to me (small images are OK). See my contact details below.

I will work on regions for one of the first updates after IMatch 5 is out, linking it with the face annotation feature in the Viewer etc. And I need more samples to test more cases.

jch2103

  • Oldtimer
  • ****
  • Posts: 2243
Re: Create categories from Picasa Name Tags
« Reply #5 on: May 26, 2014, 04:19:31 PM »
A small technical question to both Ceiriog and Mario:

When I tried looking at the jpg Ceiriog posted, I couldn't see any metadata. (I'm also interested in face metadata.) In the past, I've found that all metadata gets stripped for posted files, unless they're zipped first. Mario, do you have the ability as forum administrator to see metadata for such files?
John

jch2103

  • Oldtimer
  • ****
  • Posts: 2243
Re: Create categories from Picasa Name Tags
« Reply #6 on: May 26, 2014, 04:40:28 PM »
PS.: If possible, can you produce a few more sample files with multiple persons and send them to me (small images are OK). See my contact details below.

I will work on regions for one of the first updates after IMatch 5 is out, linking it with the face annotation feature in the Viewer etc. And I need more samples to test more cases.

I assume you wouldn't mind a few more sample files. Attached are some from my own experimentation with face recognition. Let me know if you have questions.


[attachment deleted by admin]
John

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #7 on: May 26, 2014, 04:45:57 PM »
A small technical question to both Ceiriog and Mario:

When I tried looking at the jpg Ceiriog posted, I couldn't see any metadata. (I'm also interested in face metadata.) In the past, I've found that all metadata gets stripped for posted files, unless they're zipped first. Mario, do you have the ability as forum administrator to see metadata for such files?

I think when you click on the image itself, you get the processed variant. Click on the link under the image to get the original.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #8 on: May 26, 2014, 04:50:07 PM »
I assume you wouldn't mind a few more sample files. Attached are some from my own experimentation with face recognition. Let me know if you have questions.

Thanks. Works like a charm out of the box:



[attachment deleted by admin]

Ceiriog

  • New Members
  • *
  • Posts: 30
Re: Create categories from Picasa Name Tags
« Reply #9 on: May 26, 2014, 10:43:34 PM »
Thanks for your help, I will give it a try and let you know how it works.  It would  be better than running a script as my names would get updated whenever I add a file to iMatch or rescan existing files.

Ceiriog

  • New Members
  • *
  • Posts: 30
Re: Create categories from Picasa Name Tags
« Reply #10 on: May 26, 2014, 11:42:05 PM »
I set up a new data driven 'Faces' category and it loaded about 6000 faces in less the 5 seconds.  Worked great - I will trash the script!

To: jch2103 - the metadata stays with the file - not sure why it would appear to have been stripped out.  If you use Picasa to do face recognition, when you enable it, you have to make sure you check the box to store tags in photos, otherwise I believe they are stored in a Picasa.ini file.

jch2103

  • Oldtimer
  • ****
  • Posts: 2243
Re: Create categories from Picasa Name Tags
« Reply #11 on: May 27, 2014, 01:30:11 AM »
I set up a new data driven 'Faces' category and it loaded about 6000 faces in less the 5 seconds.  Worked great - I will trash the script!

To: jch2103 - the metadata stays with the file - not sure why it would appear to have been stripped out.  If you use Picasa to do face recognition, when you enable it, you have to make sure you check the box to store tags in photos, otherwise I believe they are stored in a Picasa.ini file.

As Mario pointed out above, the metadata is preserved in the downloaded image if you click the image link; however, if you click the image for downloading, the forum software strips out all metadata!
John

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #12 on: May 27, 2014, 10:31:30 AM »
I set up a new data driven 'Faces' category and it loaded about 6000 faces in less the 5 seconds.  Worked great - I will trash the script!
Very good. And you may have noticed that data-driven categories support multiple levels in IMatch 5. This means you can produce other category levels above or below the levels you use for your face data.

For example, if you have images with GPS data, you could setup a hierarchy like

Country
 |-Location
  |- Person


which gives you an automatic and always up-to-date categorization of who you photographed, and where. To find all photos taken of Mary in Ontario in Canada is then just a few mouse clicks... just to give you some ideas.

Ceiriog

  • New Members
  • *
  • Posts: 30
Re: Create categories from Picasa Name Tags
« Reply #13 on: May 27, 2014, 03:35:41 PM »
It would be nice if you could move the individuals in the person group to specific hierarchies.  For example, some persons might be in a family hierarchy and some might be in a friends group.  is there a way to create data driven categories that look for specific values?

The only way I can see to do this is to create a new category in the family hierarchy for  a specific person and use a formula to get the results from the person group.  Any other ideas?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #14 on: May 27, 2014, 04:12:24 PM »
You can filter data-driven categories.
You can reference them in formulas.
You can use Alias categories.

I suggest you read the exhaustive and very informative help topic on categories to learn about all the category features IMatch 5 offers.

Frank

  • Sr. Member
  • **
  • Posts: 360
Re: Create categories from Picasa Name Tags
« Reply #15 on: May 27, 2014, 08:20:57 PM »
@Mario,
you still need pictures with faces on it? I can sent you tons of it.

BUT only JPG!

Frank

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: Create categories from Picasa Name Tags
« Reply #16 on: May 27, 2014, 09:21:32 PM »
I have received quite a number of files yesterday.
If you also use Picasa to add these tags, I think I have enough samples for now.

Frank

  • Sr. Member
  • **
  • Posts: 360
Re: Create categories from Picasa Name Tags
« Reply #17 on: May 28, 2014, 06:51:21 AM »
Yes, i usw picasa
Frank