python - 如何使用opencv和flask打开相机进行人脸检测
解决方案
Usage
并Error
表明你必须用参数来运行它——比如
drowsiness_detection.py -p path_to_dlib_facial_landmark_predictor
或者
drowsiness_detection.py --shape-predictor path_to_dlib_facial_landmark_predictor
你必须用正确的路径代替path_to_dlib_facial_landmark_predictor
.
我不使用dlib
所以我不知道它应该是什么路径。
如果您的代码中不需要dlib's shape predictor
,请不要使用required=True
,并且在开始时不需要它。
编辑:
我在教程Facial landmarks with dlib, OpenCV, and Python中找到了类似的代码,
本教程展示了如何运行它
python facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat \
--image images/example_01.jpg
但首先它需要下载shape_predictor_68_face_landmarks.dat.bz2并解压缩。
推荐阅读
- python - 我在使用 numpy 和 openCV 时遇到问题
- html - 带页码的长 HTML 打印
- python - 更改 Pickle 文件的内容
- postgresql - 如何使用 Postgresql 生成月度报告(两个日期之间)
- error-handling - 预期结构配置,在使用 process::exit 时找到 ()
- javascript - 如何使用 react-router 的 Link 组件链接到我的应用程序之外的 URL?
- python - 在 Python 中使用 for 循环将值分别保存在字典中
- .htaccess - www + http 到 https 转发
- ruby-on-rails - 在不更改表单宽度的情况下在 html 输入中设置 maxlength?
- swift - 如何更改单个 TextField 的键盘语言?