Machine Learning Photo Classification in Photos 5 - RhetTbull/osxphotos GitHub Wiki

In Catalina, Apple added machine learning to Photos to automatically classify photos based on subject of the photo. For example, if you search for "trees", Photos will show all photos with trees even if you haven't tagged or labeled the photos as such. osxphotos provides access to these through the labels property.

The data for the image classification labels is stored in Photos Library.photoslibrary/database/search/psi.sqlite which has the following schema:

See also this post by Simon Willison.