这篇文档,完全借鉴miguelgrinberg的博客。
https://blog.miguelgrinberg.com/post/flask-video-streaming-revisited
想看具体实现细节,可以看上面文章。
目的:要用摄像头获取图像,后期做人脸识别。
可以直接获取他的代码:
git clone https://github.com/miguelgrinberg/flask-video-streaming.git
然后运行代码如下:
$ CAMERA=opencv python app.py
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
效果如下: