Many people say it is not possible to disable that feature. But there might be some workarounds depending on your needs.
If you (and other users of the computer) do not want that feature, you might want to forcibly stop the program that performs the face detection/photo analysis.
The process (or program) responsible for the analysis is called
photoanalysisd. you can be a bit bold about it and try to prevent the process from running altogether.
Forcibly stopping the program performing the analysis
A) Using an app to forcibly pause (the process that performs) the analysis
As someone said here you can use an external app to pause the process before it goes nuts and makes your computer heat up.
B) Forcibly disabling the process for the whole computer
Terminal.app in the Applications > Utilities folder, you could go for completely preventing the
photoanalysisd process from ever starting up with the following command (requires admin priviledges):
sudo chmod -x /System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/Current/Support/photoanalysisd
Basically, it changes the permissions of the program file and forbids running it, thus making it impossible to launch. This way, the system will not start it and it won't be a burden for your CPU anymore.
PS: Note that preventing the process from running might have side effects (even though I do not see any yet).
PSS: If you update to a newer version of MacOS, you might need to re-do this B) step.
Restoring the functionality (if used option B)
But if it does, you can always restore the permissions and everything would be back to normal with this command:
sudo chmod +x /System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/Current/Support/photoanalysisd