Skip to content

Instantly share code, notes, and snippets.

@bikz05
Last active June 11, 2016 09:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bikz05/0148dc9451e5f107ddb0 to your computer and use it in GitHub Desktop.
Save bikz05/0148dc9451e5f107ddb0 to your computer and use it in GitHub Desktop.
Face Detection using OpenCV
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AwasthiMaddy
Copy link

AwasthiMaddy commented Jun 11, 2016

Hi
When I run this face detection notebook, I get error in the 5th cell : 'tuple' object has no attribute 'shape' in some of the images. Do you know how to resolve this error.
BTW thanks for the notebook!!

@AwasthiMaddy
Copy link

If the faces are detected then detectMultiScale returns the ndarray else it returns an empty tuple. So faces.shape[0] throws the error when no faces are detected. Instead len(faces) can be used to get the number of faces detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment