This code is reliant on having jupyter installed.
You can run this code by running
jupyter notebook
Then select your notebook.
If you want to understand how the code works, the details are here:
https://realpython.com/blog/python/face-recognition-with-python/