Technically speaking, "Photos" uses PhotoAnalysis.framework, and this framework runs in the background if CoreDuet scheduler allows it.
CoreDuet allows photoanalysisd to run if:
Laptop is connected to Power source
Have more than 30% battery power
Photos app is not running
No one is working with the computer
So if you want photoanalysisd to run, ...