This is a toy project for learning how to use a couple of python libraries.
- The web client sends video stream data (from the user's webcam) to a flask server using socketio
- The server does some processing on the video stream
- The client receives the processed video stream and re-displays the results in a different frame
In the demo site, the server is simply flipping the image horizontally. You could imagine it doing something more useful (e.g. applying some filters, OpenCv processing, detections from OpenCV).
- setup heroku (
brew install heroku
) - Use a python virtualenv
git clone https://github.com/dxue2012/python-webcam-flask.git
pip install -r requirements.txt
IF YOU HAVE HEROKU:
-
heroku local
IF NOT: -
gunicorn -k eventlet -w 1 app:app --log-file=-
-
in your browser, navigate to localhost:5000
git push heroku master
- heroku open
If you run into a 'protocol not found' error, see if this stackoverflow answer helps.