Yesterday I built a Streamlit project that uses .dat and .xml files to detect faces and facial landmarks. It was working perfectly the day I built it, but today it cannot find the .xml and .dat files. They are located in the same folder as my project is on my machine.
When I check to see if they exist using:
os.access(‘shape_predictor_68_face_landmarks.dat’, os.F_OK)
it returns false, but I see them in the project folder. I found the following solution on these forums but it did not work:
predictor = Path(file).parents[0] / "shape_predictor_68_face_landmarks.dat"
dlib_facelandmark = dlib.shape_predictor(predictor)
This is the exact error I am receiving:
File “C:\Users\hanna\PycharmProjects\FaceDetector\main.py”, line 87, in detect_faces dlib_facelandmark = dlib.shape_predictor(‘shape_predictor_68_face_landmarks.dat’) RuntimeError: Unable to open shape_predictor_68_face_landmarks.dat