Using Haar Feature-Based Cascade Classifiers for Face Detection on a Raspberry Pi for IoT Applications
- Link to Draft on Google Drive
- Link to Positive Image Set
- Link to Negative Image Set
- Link to OpenCV3.4
- Link to OpenCV4
Prequisites: python-opencv installed via pip, opencv installed via building from source (link to macos).
- Clone the repo.
- Download the positive image set. Then rename
labelstoyolo_labels,label2tolabels,imagestopos_images. - Download the negative image set. Rename the image directory to
neg_imagesand remove all samples containing human faces withrm Human*. Put theneg_imagesdirectory in thearchivedirectory. This is your complete dataset.
Run the face detection model with the following command:
> python face_detection.py [-r] [-t]
The -r flag denotes that the script is being run on a Raspberry Pi, and the script will use the Picamera2 module accordingly. The -t flag denotes that we are logging the time it takes to compute a frame.
Run the model evaluation script with the following command:
> python test_model.py --config <path_to_config>
Reference the config files in config/ to understand how to write a config file for this script.
Run the profiling script with the following command:
python test_utilization.py face_detection.py