Building a Facial Recognition Lock Client With Raspberry Pi

A guided tour featuring Express.js, WebRTC, React and a dash of automation

Restarone Solutions
The Startup

--

Last year, I was commissioned to build a Facial Recognition API at work. It was a joy to build and ended up being a major feature in the application I was working on at the time. In this article, I’ll walk you through the process of building a lock client powered by a preexisting facial recognition backend.

The lock’s hardware consists of a Raspberry Pi 4, official 7 inch touchscreen and a Pi camera v2. The facial recognition client has the following behaviour:

  • Starts when the Pi boots (including the GUI for the app and its server).
  • When a user requests access, it captures the user’s image and sends it to the facial recognition API.
  • If it is an authorized/recognized user, it unlocks a network-connected lock by sending a web request to it.
  • Uploads the image captured to AWS S3.
  • Sends a message to a Slack channel with the name of the user who unlocked the door along with the captured image.

The result

When the application is idling, it presents the user with an Apple-like interface with a slider.

--

--

Restarone Solutions
The Startup

Restarone is the one-stop shop for turning digital dreams into reality.