Error while loading XML files

i am getting error SystemError: <class ‘cv2.CascadeClassifier’> returned a result with an error set.
But than i resolved this error using cv2.CascadeClassifier(cv2.data.haarcascades +“frontalEyes35x16.xml”)

but after than an error again raised with error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale’

Please Help

hey @lgoyal50_be19 ,
This error means that the file path doesn’t exists , and hence the cascade Classifier is empty.

Kindly check the path once and provide the correct path.
Thank You :slightly_smiling_face:.

I placed both python file and xml files in same folder.

can you let me know on what openCV version are you working on.

Because we have found many students stucked at the same point when they are working on version 4.0+ , so we recommend to work on 3.4 version as it more stable and works good too.

yes version of cv2 is 4.3.0

kindly lower it to 3.4. It will work fine.