recognize icon indicating copy to clipboard operation
recognize copied to clipboard

People list rendering is slow (Also when merging)

Open PriceChild opened this issue 2 years ago • 15 comments

Describe the bug

Every time I load https://nextcloud/apps/photos/faces the list of people seems to be dynamically loaded.

My full collection hasn't completed scanning but there's at least a thousand detected people so far, many of whom I need to merge.

This is causing two annoying problems:

  1. The list populates slowly, jumping around as it goes.
  2. Huge CPU usage on the client rendering the thing.

I can see a couple of requests for each person, e.g. https://nextcloud/remote.php/dav/recognize/pricey/faces/519/ & https://nextcloud/apps/photos/api/v1/preview/12067?x=512&y=512 but the response times suggest most of the time is not spent waiting for these. e.g. they're sequential & a second apart, but only taking milliseconds for a response, indicating other processing time between?

If you continue to navigate within the same tab and maintain the session, subsequent pages (e.g. navigating in and out of people) don't seem to need the people list to be processed again. Annoyingly I seem to be then hitting a different bug sometimes where the people list just doesn't appear when choosing e.g. "Merge with another person" and I have to hit reload...

To Reproduce Steps to reproduce the behavior:

  1. Go to https://nextcloud/apps/photos/faces or open a person and choose the three dots and "merge with another person".
  2. Wait...

Expected behavior

  • Not having to wait as long for the list of people to render.
  • Not having faces in the list jump around for 10 minutes while it renders.

Recognize (please complete the following information):

  • Installed app version: 3.2.3
  • WASM mode: No
  • Enabled modes: face recognition

Server (please complete the following information):

  • Nextcloud version: 25.0.1
  • OS: Ubuntu 20.04
  • Docker container (if applicable): No
  • RAM: 32GB
  • Processor Architecture ARM64

Additional context Add any other context about the problem here.

PriceChild avatar Dec 01 '22 00:12 PriceChild

This should be fixed in v25.0.2

marcelklehr avatar Dec 01 '22 05:12 marcelklehr

I'm afraid there is no noticeable change. I‌'ve just updated to 25.0.2RC2 just to try this feature and I‌ cannot see any improvement.

It takes 9 minutes and 25 sec on my computer to show the faces (and interact, open a person's folder). One of the CPU‌ cores is maxed out the whole time.

Merging does not work at all, it just says "Merge person" on the top, but no bubbles to merge with are shown (not even after an hour of waiting ).

I'm running the server on an RPi 4 with 8GB of RAM, and I‌ do have quite a few photos, but a similar app ("Face Recognition") works like a charm on the same setup. (provided that I‌ had to compile the libs myself first)

I‌s there any chance of a real improvement that would make the app usable? I love the way it is integrated into Photos (in a much more seamless way than Face Recognition).

elpraga avatar Dec 03 '22 09:12 elpraga

BTW, tags within the Photos app are loaded much more quickly, there are also many on the same set of photos. (I have no clue if this detail is useful or not, I‌ added it just in case.)

elpraga avatar Dec 03 '22 10:12 elpraga

I‌'ve just updated to 25.0.2RC2 just to try this feature and I‌ cannot see any improvement.

Mmmh. Then maybe the backports didn't happen and the fix is only scheduled for 26 so far. I'll look into it

marcelklehr avatar Dec 03 '22 13:12 marcelklehr

Indeed, I only just created the backport PR: https://github.com/nextcloud/photos/pull/1523 It will then be in v25.0.3

marcelklehr avatar Dec 03 '22 13:12 marcelklehr

Is there a way to update the Photos app manually on 25.0.2 ?

I'm sorry, I'm not an expert, I couldn't understand how to do it by reading the PR.

Having this app working would be great and I could also test if merging works in the updated version.

elpraga avatar Dec 03 '22 16:12 elpraga

you can install the photos app manually by running the following steps

  1. install git and node.js and composer
  2. cd nextcloud/apps/
  3. git clone https://github.com/nextcloud/photos
  4. cd photos
  5. git checkout enh/stable25-lazy-load-faces
  6. composer install
  7. npm ci
  8. npm run build

marcelklehr avatar Dec 11 '22 17:12 marcelklehr

Thank you @marcelklehr ! I've not been able to try it yet, but I have discovered the "Memories" app that can also work with the data from Recognize (and it is usable ATM).

When I merged many people using Memories, "People" in the Photos app does not take so incredibly long to load.

Nonetheless, the two apps do not share the exact same photos, and when I try to merge using the Photos app, it is not working. (the screen just dims, no people to choose from are shown to merge with)

Is this behaviour also going to be fixed in 25.0.3 or does this behaviour need to be reported separately?

elpraga avatar Dec 16 '22 15:12 elpraga

Is this behaviour also going to be fixed in 25.0.3 or does this behaviour need to be reported separately?

Yep, it's fixed :)

marcelklehr avatar Jan 03 '23 13:01 marcelklehr

This still appears to be a problem for me, running:

Nextcloud: 27.0.2 Photos: 2.3.0 Recognize: 4.3.2

Loading the 'People' section in Photos takes about 10 minutes to load all the images. Happy to give someone access to debug if need be.

pjrobertson avatar Aug 22 '23 15:08 pjrobertson

I have the same issue. When i try to load https://example.com/apps/photos/faces the server takes 3 minutes approximately to respond correctly. I have 57 faces with a total of 30k images associated.

Nextcloud: 27.1.1 Photos: 2.3.0 Recognize: 5.0.1 MySQL: 8.0.34

One thing that i found is that the server used almost 50% of the CPU in those 3 minutes, in order to process the request:

image

What can i do to help resolve this issue?

danotrampus avatar Oct 12 '23 19:10 danotrampus

@pjrobertson I would be happy to debug a little on your instance, feel free to send credentials via email (address is on my gh profile)

marcelklehr avatar Oct 12 '23 19:10 marcelklehr

Same here, Nextcloud 27.0.2, Recognize 5.0.1, the list is really slow to load, even the count of pictures for each face, which I’d expect to show immediatly is slow. I’m wondering if it’s not a problem related to having lots of parallel requests at the same time. But what’s weird to me is that when reloading it’s slow again while I’d expect the browser to have the pictures in the cache and not refetch them.

MCMic avatar Oct 13 '23 07:10 MCMic

NC AIO VM v7.12.1 Memories v6.2.2 Preview Generator v5.4.0 Recognize v5.0.3

Very slow to load all the faces, then when I click on a recognized face and want to merge it to an existant one, it takes a long time to generate the list of existant faces (it's reloading the full list every times, it does not seem to cache) and then a long time to show again the list of faces, etc.

Nairolf76 avatar Feb 25 '24 01:02 Nairolf76

Hello, same problem here. 30s to display the people list, then 30s to display any one, then 15s just to display the people list during a merging operation, then 30s again to go back to the people list, and so on. I have 10k photos. Another user have 1k photos, the people feature is pretty responsive for him. The rest of the app is smooth for all users. I installed Recognize with its latest version in february, it is a fresh install of Recognize on Nextcloud V28.

Nextcloud Docker 28.0.5 Recognize 6.1.1 Preview Generator 5.5.0

Ryzen 5600G / SSD / 10Gb dedicated DDR4 for Nextcloud

PeggyFree avatar Apr 29 '24 11:04 PeggyFree