Friday, May 22, 2020

Inside Microsoft Photos App

Microsoft Photos App is the App that comes with Windows 10.

I turns out you can back it up or move it to another user if you copy the following directory:

C:\Users\<your_username>\AppData\Local\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe-av.zip\Microsoft.Windows.Photos_8wekyb3d8bbwe

Where <your_username> is your username. This contains things like the photos, albums, face recognition data, tags, etc.

Microsoft has conveniently placed all this information in a SQLite database which is located at:
C:\Users\<your_username>\AppData\Local\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState\MediaDb.v1.sqlite

To view the data you can easily do so using DB Browser for SQLite.

If you are a developer this gives you a lot of information along with a pretty nice UI backed by Cognitive Services Face API (or so I assume). The difference is you don't have to pay for use of it because Microsoft is giving it to you for free with the Photos App (indirectly). All you have to do is query the SQLite database for any data you might want. Pretty nice. Thanks Microsoft.

Some tables you might find useful are:

TagVarient - the name of the tag (airplane, ocean, house, etc)
Tag - related to TagVarient and
Item - your photo or video name, size, location, duration, metadata, etc 
ItemTags - joins the Tag and Item tables includes confidence score
Folder - the folders that contain your pictures and their sub folders.
Location - cities where the photos / videos were taken
Person - the people that it tagged and you grouped or it grouped. Represents the items on the People tab in the app. Includes count of people that match that face.
Face - information of where the faces are in each picture
Album - albums (generated). Not sure if self-created ones are here, but I assume they are.