photonixapp / photonix

A modern, web-based photo management server. Run it on your home server and it will let you find the right photo from your collection on any device. Smart filtering is made possible by object recognition, face recognition, location awareness, color analysis and other ML algorithms.
https://photonix.org/
GNU Affero General Public License v3.0
1.85k stars 125 forks source link

Export face and object recognition data. #354

Open aero31aero opened 3 years ago

aero31aero commented 3 years ago

Is your feature request related to a problem? Please describe.

I found out about this project from r/selfhosted and I was writing my own tool for my own personal use, didn't want to reinvent the wheel for face and object recog.

Describe the solution you'd like

Have photonix give me an API endpoint or a dump of JSON/XML/similar data that I can parse in my own application to process the face and object recognition data. I am fine with importing photos into Photonix, but I want to use my own tool to ultimately filter the photos.

Additional context

I'll just describe my program for a bit. It works by creating 'views' into your library, using the concept of mounting photos. So, for example, I have a mount map that takes my complete library (or a subsection of it) and mounts it as /year/month/day/time-camera-name.jpg or another that mounts them as /tags/tag-name/timestamp.jpg. I can endlessly write my filters and create folder structures I want for viewing the photos how I want. For example, I can easily filter it such that I only mount photos that have certain tags but don't have other tags and are within a particular date range or of a particular location.

You could probably see how I could make use of the face recog data for adding another layer of filtering too.


For geeking out, here's how my maps look like: https://github.com/scarlet-finch/scarfin/blob/master/src/mount-maps/template.js

nomandera commented 3 years ago

Perhaps this is the most open way

https://github.com/photonixapp/photonix/issues/139

damianmoore commented 2 years ago

Hi @aero31aero. Sounds like a neat idea and I've experimented with something similar creating a custom Fuse mount. If you're not aware of it - there is a GraphQL API endpoint you might be interested in experimenting with. If you go to /graphql you should see a "self-documenting" interface and be able to query with something like this:

Screenshot from 2021-10-25 16-40-46

We also aim to implement metadata exporting in future as @nomandera mentioned.

aero31aero commented 2 years ago

That's really powerful and should do what I want. Thanks! I'll try it out and see how it goes.