![]() On line 12, add your email address from your Mailgun account.ġ3. On line 10, replace "YOUR_API_KEY" with your API key from Mailgun.ġ2. On line 9, " " replace “ YOUR_DOMAIN_NAME ” with your Mailgun domain.ġ1. Open facial_req_email.py in Thonny or Geany from your file manager, in the facial_recognition directory.ġ0. (Image credit: Tom's Hardware) Adding Email Notifications to Facial Recognitionĩ. Right-Click within the dataset folder and select New Folder. Navigate to the facial_recognition folder and then the dataset folder.ĥ. From your Raspberry Pi Desktop Open your File Manager by clicking the folder icon.Ĥ. Now let’s put together our dataset that we will use to train our Pi. Copy the files containing the Python code we need. Open a new terminal on your Pi by pressing Ctrl-T.Ģ. Let’s start by downloading the Python code for facial recognition.ġ. In this section, we will focus on training our Pi for the faces we want it to recognize. Part 2: Train the Model for Raspberry Pi Facial Recognition If, when training your model (Part 2, step 15), you get errors saying “No module named imutils” or “No module named face-recognition,” install these again using pip2 instead of pip. Once again, we will restart our swapfile with the command: sudo systemctl restart dphys-swapfileĥ. Press Ctrl-X, Y and then Enter to save your changes to dsudo phys-swapfile. Once the file is open, uncomment CONF_SWAPSIZE=100 and delete or comment out CONF_SWAPSIZE=2048. ![]() In your terminal enter: sudo nano /etc/dphys-swapfile D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \Īfter we successfully install OpenCV, we will return our swapfile to its original state. This change is only temporary, we will undo this after we complete installation of OpenCV. Press Ctrl-X, Y and then Enter to save your changes to dphys-swapfile. Once the file is open, comment out the line CONF_SWAPSIZE=100 and add CONF_SWAPSIZE=2048. ![]() To expand the swapfile, we will start by opening dphys-swapfile for editing: sudo nano /etc/dphys-swapfile We’ll take a quick break from installing packages for Raspberry Pi facial recognition to expand the swapfile before running the next set of commands. ![]() Sudo apt install python3-dev python3-pip python3-numpy Sudo apt install libatlas-base-dev liblapacke-dev gfortran Sudo apt install libgtk-3-dev libqtgui4 libqtwebkit4 libqt4-test python3-pyqt5 Sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libdc1394-22-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev Sudo apt install libjpeg-dev libtiff-dev libjasper-dev libpng-dev libwebp-dev libopenexr-dev Sudo apt install cmake build-essential pkg-config git Please refer to Using a Raspberry Pi Camera instead of a USB Webcam section near the bottom of this post. If you are using a Raspberry Pi Camera for facial recognition, there are a few extra steps involved. Plug in your webcam into one of the USB ports of your Raspberry Pi. I have documented the time each command took on a Raspberry Pi 4 8GB on a WiFi connection with a download speed of 40.5 Mbps.ġ. Plan for at least 2 hours to complete this section of the Raspberry Pi facial recognition tutorial.
0 Comments
Leave a Reply. |