matiasdelellis / facerecognition

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

Click on "review people found" button takes really long now #770

Open axeljerabek opened 1 month ago

axeljerabek commented 1 month ago

Hey, Thanks for reporting issues back to Nextcloud Face Recognition. Please, try to complete this report in detail so we can help you easier. :smile:

Make sure you read all the documentation, and the FAQ, and that the issue has not been reported before. :wink:

Expected behaviour

Click and it shows detected people

Actual behaviour

A click takes over one hour on a non-high-end machine, with 100k pictures.

Tell us what happens instead

Steps to reproduce

  1. click on "review people found button"

Server configuration

Client configuration

Logs

Background task log with debug.

sudo -u apache php occ -vvv face:background_job ``` Insert your background log here ```

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Insert your Nextcloud log here ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
mrishab commented 1 month ago

I am facing the same problem. I set up facerecognize on existing dataset with 92918 images. The background_job finished successfully. In the settings > Facerecognize, when I click "Review people found", the API call to clusters endpoint fails with Gateway timeout error. There are 73109 faces with 33746 clusters.

For another user with 15253 images, 13354 faces and 5911 clusters, the API is able to respond in time.

I am using dockerize nextcloud. I have manually set up PDLIB. Here's the reference to docker image: https://github.com/mrishab/anton-apps/blob/master/nextcloud/Dockerfile.

mrishab commented 1 month ago

I am facing the same problem. I set up facerecognize on existing dataset with 92918 images. The background_job finished successfully. In the settings > Facerecognize, when I click "Review people found", the API call to clusters endpoint fails with Gateway timeout error. There are 73109 faces with 33746 clusters.

For another user with 15253 images, 13354 faces and 5911 clusters, the API is able to respond in time.

I am using dockerize nextcloud. I have manually set up PDLIB. Here's the reference to docker image: https://github.com/mrishab/anton-apps/blob/master/nextcloud/Dockerfile.

I was actually able to resolve by increasing the timeout setting on my reverse proxy. The request does take about a minute to respond but it's still workable.

matiasdelellis commented 1 month ago

Hi, The code for this function is somewhat archaic. Since I hope to recommend Memories, I haven't spent enough time on it yet. I still ask you, did you try memories? It is important because if it is more responsive it should do a similar implementation

axeljerabek commented 1 month ago

Well, "responsive" is maybe something else. But it is way faster at least. The problem is not to show the persons, but the button itself takes ages to show the clusters. And the "review people found" button does not exist in memories. The problem also did not occur in the older versions with about the same amount of persons/clusters. It exists mostly since the introduction of those two buttons on top, with the ignored persons.

matiasdelellis commented 4 weeks ago

Just leave it here for reference..

SELECT person, COUNT(*) AS FacesCount
FROM `oc_facerecog_faces` AS Faces
INNER JOIN `oc_facerecog_images` AS Images ON Images.id = Faces.image AND  person IS NOT NULL
INNER JOIN `oc_facerecog_persons` AS Persons ON Persons.id = Faces.person AND  name IS NULL
WHERE Persons.user = 'test'
GROUP BY person
HAVING FacesCount > 3
ORDER BY FacesCount DESC
LIMIT 50

I would have to implement a similar sentence, but for me it is still slow. 😞

axeljerabek commented 1 week ago

Now, it does not react anymore if the "review people found" button is clicked.