python - Python错误:需要以下参数:-p/-shape-predictor

标签 python opencv

我是使用python的新手,我想运行此代码,但出现此错误。
码:

# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--shape-predictor", required=True, help="path to facial landmark predictor")
ap.add_argument("-v", "--video", type=str, default="", help="path to input video file")
args = vars(ap.parse_args())

enter image description here

用法:
detect_blinks.py [-h] -p SHAPE_PREDICTOR

我得到的错误是:
the following arguments are required: -p/--shape-predictor

最佳答案

如用法所示,您需要传递必要的参数-p/--shape-predictor

您可以按照以下方式运行此脚本:

python detect_blinks.py -p my/path/to/predictor

关于python - Python错误:需要以下参数:-p/-shape-predictor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60825168/

相关文章:

python - KL(Kullback-Leibler)距离与 Python 中的直方图平滑

javascript - 在 python selenium 中使用 JS 脚本向下滚动

python - 将 KNN 火车从 Opencv 3 转换为 2

image - Tkinter Canvas不会在c.create_image上显示图像

python - 如何调整图像大小并保持纵横比

C# OpenCV FAST 特征检测

c++ - 如何在 OpenCV 2.3.1 中使用轮廓?

python - 在 python 中使用继承

python - 左加入 apache beam

python - 拓扑数据分析 - 从哪里开始