This project implements a basic version of the Viola-Jones object detection algorithm for facial feature extraction. It reads a PGM (Portable Graymap) image, processes it, and outputs a modified PGM image.
Before you can build and run the code, you need the following:
-
A C++ Compiler (GNU C++ Compiler): You'll need a C++ compiler and build tools.
-
make
Utility: Verify that it's installed and in your PATH by opening a command prompt or PowerShell and typingmake --version
. You should see version information. -
IrfanView (or another PGM viewer): To view the PGM images, it's recommended to install IrfanView. Download it from https://www.irfanview.com/. This program can also be used to convert between JPEG/PNG and PGM formats.
-
Python Virtual Environment with certain modules The modules required are in requirements.txt
Build with make
: Use the provided Makefile
to build the project:
$ make
This will create an executable file named facial_extract_cpu
and facial_extract_gpu
. Since the Makefile is automated, the testing of our dataset across both executables are logged in logs/cpu
and logs/gpu
. The detected (drawn rectangles on candidates) images are located in Detected_Images/
. The data analysis script generates plots in logs/plots
Please refer to the MIT license attached to this repository.