Please see the following blog post for more details about this code Eigenface using OpenCV (C++/Python) AI Courses by OpenCV Want to become an expert in AI? AI Courses by OpenCV is a great place to start.