Getting error when using the files of nose and eyes haarcascade classifier

Below is the error that I’m getting:
C:\Users\rauna\Documents\Coding Blocks ML\6. KNN\opencv>snapchat_got_project.py
cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:569: error: (-2:Unspecified error) in function ‘bool _cdecl cv::HaarEvaluator::Feature::read(const class cv::FileNode &,const class cv::Size &)’

Invalid HAAR feature (expected: ‘rw.r.x + rw.r.width <= W’), where
‘rw.r.x + rw.r.width’ is 16
must be less than or equal to
‘W’ is 15

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Users\rauna\Documents\Coding Blocks ML\6. KNN\opencv\snapchat_got_project.py”, line 7, in
nose_cascade = cv2.CascadeClassifier(‘Nose18x15.xml’)
SystemError: <class ‘cv2.CascadeClassifier’> returned a result with an error set
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

Hey @raunaqsingh10,

Try to download (don’t copy and paste it in newly created file) the XML file from the source who created this file. And then put it in the same directory in which your original python file is placed.

For example, when I use frontalEyes.xml, it gives the following error

Invalid HAAR feature (expected: ‘rw.r.x + rw.r.width <= W’), where

'rw.r.x + rw.r.width' is 22

must be less than or equal to
‘W’ is 16
When I open this XML file, I get the link of the original file, like in this case, I got http://www-personal.umich.edu/~shameem/haarcascade_eye.xml, then I downloaded this file and put it in the main project directory.

Now it will work fine.

that is a different xml file that detects both the eyes separately.

But the frontalEyes35x16.xml is kinda broken i guess?