A face detection (micro) service. This services expects a numpy array as input (an RGB image) and outputs bounding boxes, probs, and five face landmarks. Currenty the model is implemented in pytorch-based mtcnn. The service acts as a server, and you'd have to implement a small client to talk to it. I used mlsocket for this.
I recommend x86 Unix or Unix-like machines.
-
Clone this repo
git clone https://github.com/leolani/cltl-facedetection.git
-
At the root directory of the repo (e.g.
cltl-facedtection
), build a docker image by runningdocker build -t cltl-facedetection .
For most of the time, CPU might be enough.
docker run -p 27004:27004 -it --rm cltl-facedetection
docker run -p 27004:27004 -it --rm --gpus all cltl-facedetection
Your system has to have a CUDA GPU with nvidia-driver installed. This might not work so well. Follow Setting up NVIDIA Container Toolkit.
-
Start the server in one terminal.
docker run -p 27004:27004 -it --rm cltl-facedetection
-
Open up another terminal. Preferably install a new python virtualenv for this client.
-
Install the necessary packages for this client example.
pip install -r requirements_example.txt
-
Run the
client.py
python client.py
See this video, for a step by step guide. See this video, to see how to use whta the model outputs.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Taewoon Kim ([email protected])