The short answer
To make it run face analysis as much as possible, plug in your Mac, and make it not sleep, and it will run in the background.
On MacOS 14.6.1 on an M2 MBP Pro I went to system settings and did Battery > Options > Prevent automatic sleeping on power adapter when the display is off > On
and let my Mac sit for a while with Console streaming.
... but even then it doesn't run very much.
The long answer
How to even figure out if face analysis is running?
This isn't as easy as it should be. I dove into Console.app and the log
command to try to detect when face analysis is running. I found that it's controlled by a daemon called dasd
. So what the heck is dasd
?
Apparently it stands for Duet Activity Scheduler, and is related to Centralized Task Scheduling (CTS), and XPC (which might stand for Cross Process Communication). This blog post How macOS runs background activities seems to provide the best current description, but notes that Apple provides no direct documentation.
When I poked around in the system logs, I found log lines like these:
default 16:00:10.538463-0400 dasd '501:com.apple.photoanalysisd.backgroundanalysis:529421' has compatibility score of -1.000000 with 501:com.apple.mediaanalysisd.photos.face:F030F1 (Started at Wed Aug 21 15:58:44 2024). Bailing out.
– looks like dasd
is deciding that face recognition can't run because some other background photo task is running
default 15:12:32.532365-0400 dasd '501:com.apple.mediaanalysisd.photos.face:205587' CurrentScore: 1.000000, ThresholdScore: 0.243348 DecisionToRun:1
– looks like dasd
has decided face analysis can run
default 15:12:32.655895-0400 dasd STARTING activity 501:com.apple.mediaanalysisd.photos.face:205587 <private>!
– face analysis is starting
default 15:12:42.098011-0400 dasd Activity 501:com.apple.mediaanalysisd.photos.face:205587 has been running for 0.1573464155197143 minutes
– face recognition has been running for 9.4 ish seconds so far
- and so on
Generally after a few minutes com.apple.mediaanalysisd.photos.face
gets shut down and other background tasks run
and then gets cancelled and submits its activity (maybe to iCloud?):
default 15:15:22.482486-0400 dasd NO LONGER RUNNING 501:com.apple.mediaanalysisd.photos.face:205587 ...Tasks running in group [<private>] are 0!
default 15:15:22.494095-0400 dasd Submitted Activity: 501:com.apple.mediaanalysisd.photos.face:183D88 at priority 5 with interval 7200 (Mon Aug 19 10:42:19 2024 - Mon Aug 19 12:42:19 2024)
Notably it looks like
- only runs when plugged in and computer is not being used
- runs at most ever 5-10 minutes, for a few minutes at a time
I haven't figured out yet how to get it to run more, maybe there's an obscure way to configure it.
Additional notes
Console.app is good for playing around, stream the device logs and search for photos.face
.
For more serious analysis the log command with predicates is better. E.g.
log show --style compact --predicate '(sender == "dasd") && (eventMessage CONTAINS "photos.face")'
log show --style compact --predicate '(sender == "dasd") && (eventMessage CONTAINS "photos.face") && (eventMessage CONTAINS "running")' > ~/Downloads/dasd-photos.face-running.log
(takes a while to run, puts everything into a file)