matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
510 stars 46 forks source link

Collaboration / Scan files only once if shared #413

Open ggeorgg opened 3 years ago

ggeorgg commented 3 years ago

I have almost 400GB of pictures which I share with my wife. I want to to avoid to have to process them twice and I want to avoid to increase the database unnecessarily.

Maybe related issue / enhancement: https://github.com/matiasdelellis/facerecognition/issues/397

Steps to reproduce:

  1. Create user1
  2. Upload images with faces to user1
  3. Start face recognition for user1
  4. occ config:app:set facerecognition handle_shared_files --value true
  5. Create user2
  6. Share images from user1 with user2
  7. Start face recognition for user2

Current behaviour: Images are added again to the table, even if the table already contains them.

grafik

For 'oc_facerecog_persons' I think it is similar, but I don't know what would be best to handle it here.

Expected behavour: In step 7 I would expect to see only images added to the table 'oc_facerecog_images' which do belong only to user2. So we would need to determine if the image is a shared image. I don't know if there is already some kind of API / function existing which can be used to check if the file is shared or if a parent directory is shared. Like this, table 'oc_facerecog_images' would contain the same 'fileid' from table 'oc_filecache' only once where we could find the 'uid_owner' from table 'oc_share' in column 'user' if it is a shared file.

Still I would like user2 to be able to add / change the names of recognized faces in pictures which are shared with user2 by user1. Like this my wife and I can work on the same set of data and we would not have to do the same job twice. (So this request goes more into the direction "collaboration")

Does this make sense? Did you already think about this topic? Or do have doubts because of privacy reasons?

Best regards Georg

ei-ke commented 3 years ago

I think if it's optional or a hiden setting and there is some hint for potential privacy issues it should be okayish. I'm just playing around with this app and also would have the need to work with two users on one share - workaround would be a third user that poth persons share.