Slow Facial Recognition Processing

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Slow Facial Recognition Processing

Post by /RaspberryPi »


TLDR: Face recognition processing very slow, how to speed it up?

For context, this is a school project. As the subject implies, we use facial recognition on a raspberry pi, the video (RTSP) stream is coming from a live IP camera, both devices are connected on wifi. Our project needs to take snapshots of recognized and unrecognized faces and upload it to Firebase. The whole source code has been tested and it is working as intended but raspberry pi is taking too slow to process the continuous stream of images. We do not have a trained model as the user will have to upload their own images to which the program will compare the faces detected instead.
Note that we also have a Face Mask Detection (trained model) thing going on apart from the actual Face Recognition and Detection. The program is intended for a dormitory where new and old tenants arrive and leave constantly

To try and speed this, I tried skipping the frames of which the raspberry pi processes. I tried frame skipping between 5 to 20 frames. I also set the video feed window stream to 800x640 pixels and I also tried a 90x90 one but still it took a while, around 5-10 seconds to process the image before moving on to the next frame. My fried argues it's the camera that is slow, not the raspi itself. If so, are there any recommended IP cameras we can use with specific requirements?

Specifications:
Relevant Libraries used: face_recognition, OpenCV (cv2), tensorflow, threading, firebase_admin
Raspberry Pi 4 Model B 8gb (64 bit OS) GPU memory set to 124

idk if relevant but we made an app in where the user can access the firebase database of taken snapshots and of who is recognized. not at all connected to the raspi
submitted by /u/Ok_Sheepherder9913
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... rocessing/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”