This is a web app which uses Single Shot Multibox detector (SSD) framework to detect human faces in a live feed of webcame.
- The web app uses JavaScript to ask for Webcam permission, once granted it captures frames and sends them to the Flask backend via an AJAX post request.
- The Flask backend captures the incoming frames, uses the SSD model (trained on human selfie images) to detect human faces and returns detected bounding box coordinates.
- The ajax call receives the bounding box coordinates and plots them onto the html canvas.
The model is running on CPU, so the response time is a bit slow.
- Pytorch (0.4.1)
- Torchvision (0.2.1)
- Numpy
- Pillow
To run the application:
- Install requirements using
pip installl -r requirements.txt
python app.py
- Visit
localhost:6006
on your Google Chrome browser.
Note: Please use Google Chrome, this app has some issues running on Firefox.
The SSD code is adapted form of original open source ssd.pytorch implementation which can be found here.