Skip to content

Instantly share code, notes, and snippets.

@bikz05
Last active June 11, 2016 09:50
Show Gist options
  • 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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