CascadeClassifier is empty


i tried to write the path in cascadeclassifier and the haarcascade_frontalface_default.xml and haarcascade_eye.xml are already in the same folder as my code. But it still shows the same error. Someone please help me

welcome.

your paths are wrong.

you need to quote the backslashes in those strings. or use r-strings, a feature of python.

please work through this introduction to python
https://docs.python.org/3/tutorial/introduction.html#strings

it worked!! thank you man. It seems i need to learn more the basic

Char '\' has special meaning in any string - even in path

ie. '\n' means new line, '\t' means tabulator, etc.

And you have '\test' in path so it treats '\t' as tabulator.

You may use prefix 'r' to create 'raw' string and then '\'will be treated as normal char

r"C:\Hamid\test\haarcscade_eye.xml"

or you have to use double '\\'

"C:\\Hamid\\test\\haarcscade_eye.xml"

or you can try to use '/' like in Linux

"C:/Hamid/test/haarcscade_eye.xml"