I am building a smart doorbell that needs to recognize family members. I tried using a standard ResNet model, but it's way too slow for real-time processing on the Pi. I need something that can run at at least 10-15 FPS without overheating the CPU. Is MediaPipe the way to go, or should I look into quantized models using OpenVINO or TensorFlow Lite?
3 answers
For a Raspberry Pi 4, you absolutely need to use quantization. I recommend converting your model to TensorFlow Lite with 8-bit integer quantization (INT8). This can speed up inference by 4x. MediaPipe is excellent for face detection (finding the face), but for the actual recognition (matching the ID), you’ll want a lightweight model like MobileFaceNet. If you have the budget, adding an Intel Movidius Neural Compute Stick 2 and using the OpenVINO toolkit will give you the 15+ FPS you’re looking for with much higher stability.
What is the lighting condition at your front door? Most edge-based recognition models struggle with backlighting or shadows, which are very common for outdoor doorbell cameras.
Try the 'Face_recognition' library by Adam Geitge. It’s built on dlib and is incredibly easy to set up, though you might still need to overclock your Pi to get decent speed.
Good suggestion, Barbara. However, for a doorbell, I'd still lean toward TFLite. Dlib can be quite heavy on the Pi 4 unless you are only processing small frames like 320x240.
Thomas, it's mostly shaded but gets bright in the afternoon. To handle that, I'm thinking of using a basic exposure adjustment in OpenCV before feeding the frame to the model. Linda, I will definitely try the INT8 quantization route. I didn't realize the performance jump was that significant on ARM-based processors. I'll check out MobileFaceNet today!