- [Instructor] My faces.py script solution…is organized into two functions.…The detect faces function, that begins on line 10,…is the real meat of this program.…It takes an image path as the input argument,…performs the facial detection,…and returns the json output data.…I've included an optional display argument…to control whether or not the program…displays an image with boxes around the detected faces.…Scrolling down, on line 51, is the main function…that gets called when this script is executed…as a top level module.…
On lines 54 to 61, I use the Tkinter module…to create a file dialogue box…asking the user to choose an image to analyze.…The withdraw method, on line 54,…hides the Tk window that gets created,…so the user only sees the popup dialogue box.…That open file dialogue returns a path…to the selected image file, which I then pass…to the detect faces function on line 61.…I chose to set that display flag to True…because I like seeing the images with detection boxes.…
The output from the detect faces function…
Author
Released
6/8/2018Visit other courses in the series to see how to solve the same challenges in languages like C++, C#, JavaScript, PHP, Python, Ruby, Go, and Swift.
Skill Level Intermediate
Duration
Views
Related Courses
-
Learning the Python 3 Standard Library
with Kathryn Hodge2h 9m Intermediate -
Python Essential Training
with Bill Weinman4h 45m Intermediate -
Learning Python
with Joe Marini2h 27m Beginner -
Code Clinic: Java
with Carlos Rivas1h 13m Intermediate
-
Introduction
-
Welcome1m 26s
-
-
1. Problem 1: Weather Statistics
-
2. Problem 2: Where Am I?
-
Intro: Where am I?1m 46s
-
Making a POST with requests2m 14s
-
-
3. Problem 3: Eight Queens
-
Intro: Eight queens1m 42s
-
Understanding permutations3m 42s
-
-
4. Problem 4: Musical Instrument
-
Intro: Accessing peripherals1m 54s
-
-
5. Problem 5: Facial Recognition
-
Intro: Facial recognition1m 38s
-
Scaling images3m 12s
-
Saving results as JSON1m 51s
-
-
6. Problem 6: Real-Time Information Dashboard
-
Understanding Django2m 13s
-
Routing URLs with Django3m 53s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Loading images with OpenCV and imageio