Cmd shows error

Traceback (most recent call last):
File “face_detector.py”, line 13, in
faces = face_cascade.detectMultiScale(gray_frame,1.3,5)
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function ‘cv::CascadeClassifier::detectMultiScale’

[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

Check if haarcascade_frontalface_alt.xml file path mentioned by your is correct or not. This xml file should be present in the same folder where this .py file is

If error still persists than let us know more about it.

no that file is not in the current directory…how do i know in which dir its in

Just use file explorer directly. to check it. But if you want to know in jupyter itself than use this lines of code.

import os
print(os.listdir())

A list will appear showing names of all files present in the directory.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.