Skip to content

dmsolutionz/FaceBox-CV

Repository files navigation

Facebox-CV

🎥 🔘 Computer Vision Control demo using Pytorch and OpenCV.

Face detection using FaceBoxes (2017), a state-of-the-art method (for 2018) in CPU speed for multi-target facebox detection. (https://arxiv.org/abs/1708.05234)

Methodology

1. 📃 FaceBoxes By Shifeng Zhang (et al.)

Implementing a great paper by Shifeng Zhang et al. with a face detection model capable of running at 20 FPS on a single CPU core. Perfect for user-interaction control.

2. 🕵️‍♀️ Import Model and Predict for Single Face

→ 📔 Notebook 01-Faceboxes-Eval-Image.ipynb

3. 🕵️‍♂️ Iterate over Predictions for Multiple Targets

→ 📔 Notebook 02-Faceboxes-Refactor.ipynb

5. 🎥 🔴 Realtime Facebox from Webcam Capture

Output is masked but movement is captured by the bounding box.

→ 📑 Refactored into face_utils.py

6. 🎬 OpenCV Control Loop

Putting it all together in a control loop, and linking facebox movement with a media asset. The black box on the right shows the webcam output with the detected face outlined.

→ 📑 Run vision.py


Quick-Start
$ conda create -n facebox-cv pip jupyter python=3.6
$ conda activate facebox-cv
$ git clone https://github.com/lukexyz/FaceBox-CV.git
$ cd FaceBox-CV
$ pip install -r requirements.txt

Find system specific pytorch installation from pytorch.org (dev: windows|pip|python|cuda=10.1)

$ pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html

Run FaceBox-CV

$ python vision.py
Notes

For OSX Only compatible with NVIDIA Gpu's as pytorch will complain you don't have it compiled with CUDA. There are workarounds for macbooks but be aware they might just not work.

Acknowledgements

About

🎥 🔘 Computer vision control demo using Pytorch and OpenCV

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published