Apple Photos database import/sync

What are the plans (if any) for support of Apple Photos databases? I’ve recently come across two very interesting projects that can interrogate/export Apple Photos database and pictures and was curious if you were familiar with them or have any thoughts. The interesting thing to me is being able to leverage and extract the machine learning and tagging that Apple does on-device and then extract it into other databases. I would love to see Photostructure able to take all Apple Photos database information and incorporate into it’s own database either as a one-time import or a periodic sync. Thoughts?

Here’s the two projects I was referring to:

Thanks for taking the time to share this! I saw Simon’s post when it was on hackernews, which pointed to osxphotos: both are excellent work.

(full disclosure: I’ve had some horrible experiences with Apple Photos corrupting my library ((several times!)), so personally, I don’t use it, but I understand the desire to not re-do any organization or curation work that people have done in other apps, which is why the next version pulls in Picasa and IPTC tags).

Caution: the following is me prattling on, rubber-ducky style.

Ideally there would be a way to plug in third party “curators” into PhotoStructure, so if someone wanted to incorporate new tags from different sources, they could.

The reason why I haven’t just pulled this all into PhotoStructure already is because, at least currently, the exact same code runs on all 5 different flavors of PhotoStructure, and my only runtime requirement for every PhotoStructure edition is Node.

Both of these projects require a Python 3 runtime (which, if I could make as a dependency, would help so many other things, especially with ML/AI related projects, but would be a bear to package into the already-large PhotoStructure for Desktops editions).

The other issue with curation is very similar to the problem with keyword and other metadata editing: when there are several “variants” for a given asset, which variant (just the “best”, or all of them?) should contribute to the final asset’s metadata?

Currently metadata tag values are “layered”: the variants are sorted given a set of heuristics, and for any given tag, the “best” variant with a value is the value for the asset.

Apple Photos doesn’t really de-dupe things (at least in my library) very well, so there is likely to be metadata in the photos library for more than one variant. I guess the layering strategy still makes sense in this case, as well?

In any case, osxphotos supports a one-time extraction of library metadata into sidecars. PhotoStructure already looks for and reads from these sidecars (and support for Title and Description are coming as well). So, if you’re willing to run osxphotos export ... --sidecar ..., the metadata that gets added to those sidecars will already make it’s way into your PhotoStructure library.

A couple beta users are already using osxphotos to feed PhotoStructure, fwiw.

For tags that aren’t added as sidecars: I’m already spinning up ExifTool to do metadata extraction: there could be 1 or more tools that are configured as a setting, that when given a path to a filename, returns a JSON object with N tags (like the ZOVERALLAESTHETICSCORE). I guess this could be translated into a star rating for photos, and labels could be interpreted as additional keywords, perhaps?

And thus concludes this rubber-ducky episode. Thanks for tuning in.