How to use redis to run remotely a haar face detector This demo implements a producer/consumer pattern to distribute an image processing algorithm in a remote computer. A script reads an image that is shared with face detection script by means of a Radis database. The following picture describes a two computers architecture; naturaly, all the modules could also run in the same computer or in three different computers.
The model image has been redimensioned. A modified version presents the boxes correspoding to Haar Cascades face and eyes detections results. The modified images keep the same licence as determined by the original licence. "FF_15" by Rodrigo Favero is licensed under CC BY-NC-SA 2.0
The Redis database can be run opening a terminal and using the provide docker-compose file:
$ docker-compose up
To run the python scripts you'll need Python v3.6 or higher. Install the application's library dependencies with the following - it is recommended that you use virtualenv
or similar:
$ virtualenv -p python3.6 venv
$ source venv/bin/activate
$ pip install -r app/requirements.txt
Within the virtual environment you can run the detection script:
$ python3 facedecteng.py
and in another terminalthe capture script:
$ python3 capture.py
This second script should save a processed image.
You can use now also the C++ client in src.
$ cd src
$ make
$ ./capture
The C++ client uses the hiredis library. The dependecies of the client are:
$ sudo apt-get install -y libhiredis-dev
$ sudo apt install pkg-config
$ sudo apt install pkgconf
$ sudo apt-get install libgtk-3-dev
$ sudo apt install libopencv-dev
The same as in local but taking care of setting the correct paths for the Redis database.