A lightweight web application which adds googly eyes to an image sent to its POST /imageUpload
endpoint.
POST payload |
Response body | Faces |
---|---|---|
n_faces=1 |
||
n_faces=2 |
||
n_faces=3 |
Install in editable mode using pip:
cd googlyeyes/
conda create -n googlyeyes-env -c conda-forge python=3.6 coverage flake8 Flask Flask-RESTful imutils dlib opencv numpy pytest requests
conda activate googlyeyes-env
docker build -t googlyeyes-app .
You can then run the application using:
docker run -d -p 5000:5000 googlyeyes-app
pytest
Name Stmts Miss Cover Missing
--------------------------------------------------------------
googlyeyes/helper_functions.py 23 0 100%
googlyeyes/process_image.py 48 14 71% 149-178, 182
googlyeyes/server.py 34 15 56% 21-22, 26-38, 47-53, 64-65
tests/test_helper_functions.py 36 0 100%
tests/test_process_image.py 30 0 100%
tests/test_server.py 47 0 100%
--------------------------------------------------------------
TOTAL 218 29 87%
Performance tests were made by making 1000 sequential requests to a single docker image running the application:
Statistic | Response time (ms) |
---|---|
Mean | 354.90 |
99.9% | 829.52 |
99.999% | 845.59 |
To-do for v0.4.
68 facial coordinate points from the iBUG 300-W dataset.
- Credits to pyimagesearch for the code to find the facial landmarks.
- Credits to sagaragarwal94 for his simple webserver API using Flask.
- Credits to fireant for his StackOverflow answer on overlaying a PNG image with OpenCV.
- Credits to the Helen dataset which was used for testing.