Integrating Facial Recognition with IoT for Access Control: Unlocking Doors using Electromagnets and Logging Worker Entries
- Node.js
- Python 3.6+
There are two ways to run this project:
- Using a Raspberry Pi 4 + Webcam
- Using a computer with a webcam + ESP8266
Choose one of the above and follow the instructions below.
Connect relay to GPIO 7. Connect webcam to Raspberry Pi.
Connect relay to GPIO 5 (D1). Edit wifi configuration in /relay/main.ino
and upload to ESP8266.
- Clone this repository:
git clone git@github.com:superhooman/robt310.git
cd robt310
- Install the required packages for each subsystem:
/cron
:Also, if you are using ESP8266, then create acd cron npm ci
.env
file in thecron
directory and add the following:RELAY_ADDRESS=<address of the relay> # e.g. http://192.168.0.193/
/deepface
:cd deepface pip3 install deepface # or pip install deepface python3 check.py # to download the required models
/system
:cd system npm ci npx prisma db push
- Now, we need to setup processes to run each subsystem. We will use
pm2
to manage these processes. Installpm2
globally:
npm install -g pm2
- Start the processes:
/cron
:cd cron pm2 start index.js --name "cron"
/system
:cd system npm run build pm2 start npm --name "system" -- start
- You all set! Now you can access the system at
http://localhost:3000
and the cron job will check camera every 10 seconds.