Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it simply never found your 'haarcascade_frontalface_default.xml'

it simply never found your 'haarcascade_frontalface_default.xml'

i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.

in this case:

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong

img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about this

stop being a noob, and check your resources, please !

it simply never found your 'haarcascade_frontalface_default.xml'

i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.

in this case:

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong

# also:
img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about this
failing to do so.

stop being a noob, and check your resources, please !

it simply never found your 'haarcascade_frontalface_default.xml'

i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.

in this case:

face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong

# also:
img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about failing to do so.

stop being a noob, and check your resources, please !