I am using the inbuilt cascade classifier for the face detection. This is how the code is (OpenCV Python Tutorials):
import numpy as np import cv2 face_casc
Maybe, you use virtualenv for python like me. You try this.
import os base_directory = os.path.abspath(os.getcwd()) directory_cv2 = os.path.join(base_directory, "Lib", "site-packages", "cv2","data") print("la carpeta es: {}".format(directory_cv2))