First: Download the necessary requirements: pip install opencv-python face_recognition.
Why? This is already a powerful library for classifying photos, we don't need to do the legwork ourselves. We can just use the import to our advantage.

Second: Build the script.
Import all the necessary imports. I have already written them down. 
Create a for loop that will loop through each image in the folder. 
In this script, I use model HOG. If you have a powerful GPU use CNN.


Originally in this script, I had a simple for loop, but I realized I had folders within folders, so we used os.walk
os.walk loops through the main folder, its subfolders, and all the files inside them.

Third: Load the reference photos.
Why? We need to teach the script what our friends look like before it can find them.
We loop through a reference folder, clean up the file names (so "Avi1" becomes "Avi"), and calculate the mathematical face encodings for each person.

Fourth: Scan the target photos and find the faces.
Using os.walk, we go deep into our 50GB target folder and load each image.
For every image, we locate the faces and calculate their encodings.

Fifth: Compare and sort the matches!
We compare the mystery faces in the target photos against our known reference encodings.
If a match is found, we automatically create a sorted folder for that person and copy the photo directly inside. No more manual sorting!
