matiasdelellis / facerecognition

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

Enabling handle_shared_folders causes images/clusters that can't be assigned faces #757

Closed vwbusguy closed 1 month ago

vwbusguy commented 1 month ago

This is a longstanding Nextcloud instance. My wife and I have shared auto-upload folders with each other and we have both handle_shared_folders and handle_group_folders enabled in facerecognition. However, in Memories, at the bottom of People, I have a bunch of photos that link to facerecognition under my wife's account and I can't name or rename.

This also means that I no longer see and can traverse unnamed clusters that my user does own because it is full of clusters owned by my wife's account.

Expected behaviour

With handle_shared_folders and/or handle_group_folders is enabled, user should be able to name photos they have been granted access to by another user.

Actual behaviour

Unassigned photos and clusters show up in Memories that cannot be assigned or renamed. I want her user to likewise be able to name images I've shared with her.

Steps to reproduce

  1. Ensure User 1 and User 2 both have facerecognition enabled in Nextcloud
  2. Have User 2 share a folder with User 1 containing images
  3. Enable handle_shared_folders in facerecognition and do a scan
  4. As User 1, open Memories->People and note unassigned clusters at the bottom belonging to another user than can't be named

Server configuration

Client configuration

Logs

Background task log with debug.

sudo -u apache php occ -vvv face:background_job ``` 1/8 - Executing task CheckRequirementsTask (Check all requirements) 2/8 - Executing task CheckCronTask (Check that service is started from either cron or from command) 3/8 - Executing task DisabledUserRemovalTask (Purge all the information of a user when disable the analysis.) 4/8 - Executing task StaleImagesRemovalTask (Crawl for stale images (either missing in filesystem or under .nomedia) and remove them from DB) 5/8 - Executing task CreateClustersTask (Create new persons or update existing persons) Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Face clustering will be created for the first time. 96019 faces found for clustering 60143 clusters found after clustering Skipping cluster creation, not enough data (yet) collected. For cluster creation, you need either one of the following: * have 1000 faces already processed * or you need to have 95% of you images processed Use stats command to track progress Clusters already exist, estimated there is no need to recreate them 6/8 - Executing task AddMissingImagesTask (Crawl for missing images for each user and insert them in DB) Skipping image scan for user csaenz that has disabled the analysis Skipping image scan for user fcc that has disabled the analysis Skipping image scan for user kodi that has disabled the analysis 7/8 - Executing task EnumerateImagesMissingFacesTask (Find all images which don't have faces generated for them) 8/8 - Executing task ImageProcessingTask (Process all images to extract faces) NOTE: Starting face recognition. If you experience random crashes after this point, please look FAQ at https://github.com/matiasdelellis/facerecognition/wiki/FAQ ```

Browser log

Screenshot from 2024-06-04 11-18-48

Screenshot from 2024-06-04 11-19-18

vwbusguy commented 1 month ago

It looks like this is a problem with Memories instead of FaceDetection.

https://github.com/pulsejet/memories/blob/master/src/components/modal/FaceEditModal.vue#L80