Data Science | Artificial Intelligence & Machine Learning | Sports Science
Basic Facial Recognition From an Image
The Project
Computer vision as a field is focused on using algorithms to give computers the ability to “see” and perceive the real world. Common computer vision tasks included object tracking, object recognition, and image retrieval. Performing these tasks requires the use of algorithms and the creation of models which are trained on large amounts of data to enable the system to recognize images.
For this project, we set out to create a basic facial recognition program that would import an image, detect faces in the image, and draw a red rectangle around each face in the image. The project was created in DeepNote using Python, and leveraged key libraries such as OpenCV, Pillow, and face_recognition.
Getting Started
To begin, we selected the image below of the U.S Women’s Olympic soccer team during a match against Australia. This image was chosen because it has multiple players from each team. It also has players at varying distances within the foreground and backgrounds, and has differing facial orientations which could pose a challenge to our facial detection system.

I first installed OpenCV and the face_recognition library. I then imported the necessary libraries and packages:
Next, the image is loaded and face_recognition is used to identify the faces present in the image:
The last step is to use OpenCV to draw the red bounding boxes around the faces that have been identified in the image, and save our output as a new image named 'soccer-faces.jpg'
Our output image shows the red bounding boxes around four of the five players in the image. You can see that #8 (Julie Hertz) is facing away from the camera in a direction opposite of the other players. No bounding box as drawn, as facial features were not identified. I was curious to see if the player in the background would be identified, as the image is blurry, but the algorithm did identify her face and produced the appropriate bounding box.
Future projects will look to identify faces in a large crowed of people and identify specific objects in an image. I will also look at developing a system for object tracking and identification using video.
Thank you for taking the time to review my project! Feel free to reach out with any questions or feedback.
Don't forget to Connect with me on LinkedIn as well!