This project demonstrates a face detector based on KWIVER using the Haar Cascade classifier. Specifically, this project uses the frontal face classifier. The detector is demonstrated in two languages, C++ and Python. The C++ example implements a detection arrow that offers both image and video options. The Python example is a KWIVER process.
File Name | Description |
---|---|
face_detection.pipe | Sprokit pipeline file that runs the face detector on a list of input images |
face_detection_images.txt | Text file that lists the input images' locations |
face_detection.cxx | Face detector written in C++ |
face_detection.h | Face detector header file written in C++ |
CMakeLists.txt (C++) | Face detector source and header files added |
images | Directory where the sample images are stored |
videos | Directory where the sample videos are stored |
haarcascade_frontalface_alt.xml | The Haarcascade classifier used |
face_detection_video.pipe | Sprokit pipeline file that runs the face detector on a video |
faceDetection.py | Face detector written in Python |
face_detection_python.pipe | Sprokit pipeline file that runs the python face detector on a list of input images |
CMakeLists.txt (Python) | Face detector source file added |
In a bash terminal in the project directory::
cmake .
make -j7
To use an image, in <path/to/kwiver/build>/release/bin::
./pipeline_runner -p ../examples/pipelines/face_detection.pipe
After it has finished running, the annotated image will be in ../release/examples/pipelines/output
To use a video, in <path/to/kwiver/build>/release/bin::
./pipeline_runner -p ../examples/pipelines/face_detection_video.pipe
After it has finished running, the annotated frames will be in ../release/examples/pipelines/face_detection_output
In <path/to/kwiver/build>/release/bin::
./pipeline_runner -p ../examples/pipelines/face_detection_python.pipe
After it has finished running, the annotated image will be in ../release/examples/pipelines/output