Many people, including me, use a combination of libraries to work on the images, such as: OpenCV itself, , etc. But this is a very confusing and problematic process. Dlib installation, for example, can be extremely complex and frustrating. Dlib Pillow This is a python library that uses OpenCV to detect, align and extract faces images for classification purposes, either using HOG or Neural Network . OpenCV is more than capable of doing everything that is needed in an image processing pipeline, such as: , and , also known as . detect faces align faces extract faces Face Chips Installation Clone the If you have just create an environment with the attached file: repository ! Anaconda conda env create -f newHogEnv.yml To test just run the program : pythonfaces.py python pythonfaces.py |image.jpg| It has two other arguments: python pythonfaces.py |image.jpg| |face cascade model| |eye cascade model| If you enter only the image file name, it will assume the files that are in the "./data/haarcascades" folder. The program detects the faces in the passed image, extracting each one in a new image. It transforms in monochrome, aligns the face (aligns the eyes horizontally) and cuts the person's face, in a square shape to the size you want. Use as a library There are several useful functions in this module and you can import it like this: pythonfaces import detectFaces This function receives an OpenCV image (it can be a video frame), detects the faces in it and returns a list with images. The first is the original marked image (where the faces and eyes are) and the others are the cropped images of each face found (Face Chip), properly aligned and scaled. You can save the images with: cv2.imwrite(|path the file to be written|, |OpenCV image object|) of The parameters are: : OpenCV image; img : Size of the "square" of each Face Chip to be generated; img_h, img_w : Model haar cascade for face detection - included in "/ data / haarcascades"; face_cascade_file : Haar cascade model for eye detection - included in "/ data / haarcascades"; eye_cascade_file These models came from the original OpenCV project on Github. See the code for for other functions. pythonfaces.py