14

I've recently been building a large photo library, and, now that almost all of the content is in, I would like to start completing the people album. Photos says that it will "continue to scan your remaining photos when you're not using the app and your Mac is connected to power", so what I've been doing is letting the app run in the background (opening it and the focusing to another Window), telling my Mac never to sleep, plugging it in and leaving it on overnight. This, however, does not seem to be working; indeed, the number of faces scanned seems to be going DOWN (yesterday 57,807 photos had been scanned and now it's just 57,381). I seem to be meeting perfect conditions and yet nothing's happening. I should perhaps mention, however, that I've been getting it a little off each time, but not in a way that should affect it, I hope.

  • The first two nights I quit photos
  • The third night I left Photos focused.
  • And tonight I left Mission Control focused

The third night I left Photos focused and tonight I left Mission Control running.

What is causing this problem, and what am I doing wrong? If it helps, here are my system specs: My System Specs: mojave

1
  • You can add a face and the name of the person by opening the photo and tapping info button "i" . That way MAYBE the algo would add at least that person faster than others. Also later it will ask you to confirm other photos of the same person.
    – anki
    Apr 28 '19 at 18:13
13

The conditions are unclear at this time.

Apple does not inform on how photoanalysisd or photolibraryd work. It is something they need to address properly. As far as I know, photoanalysis uses CoreML and Vision to analyse what images contain, not only Faces in People. So if you search for mountain, it should retrieve images of mountains.

When it comes to how this daemon actually work, I've looked at the process and how it responds to different changes in the macOS environment. From a bit of trial, I think I've figured out how to make it work in a somewhat expectable way. To summarise, the following technique (if you will) should help you crawl about 1K images an hour.

Note: this depends on the hardware you are currently running on. You milage may vary.

Prerequisites:

  1. Have photos imported into Photos.app
  2. Have manually marked faces of people you want Photos to recognise.
  3. Make sure you do not have any items in your library that can cause havoc. You can use Smart Filters with Unable to Upload.
  4. Ensure that your power settings are set to never sleep. (Screen saver can still be on).
  5. Plug your Mac to power, it will be running for a while depending on your collection size.

Solution:

Close all apps, reboot your Mac, make sure you untick the "Reopen windows..." before you reboot. We want macOS to return to desktop without any apps loading. Also make sure you have disabled any apps from starting with macOS too: Users & Groups > Your User > Login Items

Then, once rebooted:

  1. Open Activity Monitor.app and search for photoanalysisd. It should not be found (but leave the window open).
  2. Open Photos.app, wait a minute, then close it. You should see photolibraryd and photoanalysisd in Activity Monitor.app now.
  3. Give it a minute or two (or maybe 10), and now you should see photoanalysisd begin to churn through your photos rather quickly.

For the best possible result, make sure you leave the Mac running over night. If you have a lot of images (50000+) you probably need to do this a couple of nights.

A few things to consider.

  • The daemon can take some time to get it going. When I open Safari it starts churning. You can try this if you don't see any activity after 10 minutes.
  • photoanalysisd can hang up some times. If this happens, check if photolibraryd is doing something (check Activity Monitor.app). If this is the case, It is probably pushing updates to the library.
  • It can sometimes help if you leave your iPhone/iPad unplugged. It seems that Photos only work on a single device at one time.
  • If there is no activity for a while and you don't manage to solve it with the above. Reboot and repeat.

The above has worked for me on 12K photos. I've re-imported them twice to confirm. It took me two days total (by making sure it starts and leave it over night).

Enjoy.

6
  • Great answer @Elmo! Feb 10 '20 at 21:32
  • 1
    Hi and thank you for such a thorough answer. Please clarify: how can I tell that if photoanalysisd had begun to churn through your photos rather quickly ?
    – WhatHiFi
    Nov 21 '20 at 15:07
  • Hello, you should notice increased usage, such as high cpu usage.
    – Ole Aldric
    Nov 21 '20 at 16:04
  • You can use /usr/bin/caffeinate -im to never sleep but let the screen turn off. Aug 7 at 20:09
  • “ items in your library that can cause havoc” - like what? Great answer btw, thanks for it.
    – Roberto
    Sep 5 at 11:10
4

Apparently because the library is on an external drive there's a bug that's causing this to happen. I'll keep everyone posted for when there is a fix!

3
  • 1
    Any update? Where did you learn about this?
    – G-Wiz
    Oct 12 '19 at 15:33
  • 2
    I'm not sure. I reported it on the apple bug tracker and I think they've added it to their list but I don't know for certain Oct 14 '19 at 7:35
  • 1
    I have tried to run this from an external drive and experienced no issues at all. Do you have an update to this? Marking your own answer as accepted like this is frowned upon.
    – Ole Aldric
    Feb 16 at 13:45
1

Firstly, you should completely Quit photos. The scanning service will run in the background even if the app is closed.

Secondly, when you go to the People tab, is there a button to see the (incomplete) People album? This might give you better insight into its progress.

3
  • I can go into the album but there are over 30,000 photos that haven't been scanned so I don't think it would help Apr 28 '19 at 18:36
  • @John 30k photos is a lot, you'll just have to be patient if it's making progress. Are your photos set to "optimize?" If so, consider it would have to download the original before scanning in that case.
    – Ezekiel
    Apr 28 '19 at 19:57
  • I don't have iCloud Photo Library enabled. I understand that 30K is a lot but I can go into Photos and check how many have been scanned and I know it's not making any progress. Apr 29 '19 at 7:19
0

For me, the answer seems to be to ensure that photos is not running on any other device. That meant I need to close photos on my iPad and iPhones (for extra safety, I powered them off but I don't think that was necessary). On my AppleTV I signed out of my iCloud account. After doing this, Activity Monitor showed that photoanalysisd began using significant CPU time (until this its CPU time was insignificant). I'm posting this in real-time. I hope the update finally finishes now - I've got 15k photos and 300+ people, running Catalina on a 2019 MacBook Pro 13".

0

@Elmo's answer solves problem for me (250k photos in library). One thing that helps is to do all of those steps with your Mac disconnected from the Internet. This means you don't have to go around turning off Photos on iPhones, iPads, Mac Minis, iMacs and all the other stuff that might be connected to your cloud. It also has the advantage that all the other Internet activity that uses up CPU time stops.

I'm using a Mac Pro (2013) with 2Tb OWC SSD upgrade for my Photos library. photoanalysisd getting to use 150%+ of CPU(s, writing about 1Gb/hr to disk and doing about 4300 photos per hour.

0

I found that photoanalysisd was using 0% CPU and 0 CPU time in Activity Monitor and nothing was happening.. However, I selected that line in Activity Monitor, and clicked the Cog Wheel icon. I picked SAMPLE PROCESS. It ran a sample of the Photoanslysisd process and that caused it to kickoff.

It is running and now I also see activity in Photolibraryd. I assume it is updating as it finds things.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .