
Face Recognition and Face Detection series in Python
- Detecting Faces with 20 lines in Python
- Face Recognition with 20 lines in Python
- Detecting Facial Features with 20 lines in Python
- Facial Features and Face Recognition with 20 lines in Python
- Performance improvements with code
- Resize the camera input with OpenCV
- Working with Haar Cascades and OpenCV
- Detect and blur faces 😁 using haar cascades
- Detect and blur faces 😁 using DNN
Hi!
In my last post I share some lines of code which allowed me to run some of the face recognition demos 6 times faster. I added a Frames per Second (FPS) feature in my samples. Later, thinking about performance, I realize that I don’t need to work with a full HD picture (1920 x 1080), so I added some code to resize the photo before the face detection process.
However, while I was coding around this solution I also realized that I may want to initialize my camera to start in a lower resolution. So, I searched online on how to do this with OpenCV and I found 3 beautiful lines of code.

So, I manage to improve my processing code from 20FPS to +30FPS … which is very good ! Later on this posts I’ll try to do some similar FPS tests on a smaller device and I’ll see and share how this works.
Happy Coding!
Greetings @ Burlington
El Bruno
Resources
- Anaconda Distribution, https://www.anaconda.com/distribution/
- Visual Studio Code, https://code.visualstudio.com/
- Adam Geitgey, https://github.com/ageitgey/face_recognition
- StackOverflow, fps – how to divide count by time function to determine fps
- OpenCV, How to set camera resolution (webcam) with opencv?
1 comment