我无法解析python中用于检测OpenCv,python和dlib眨眼的参数。
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())
ap.add_argument("-p", "--shape-predictor", required=True)
_StoreAction(option_strings=['-p', '--shape-predictor'],
dest='shape_predictor', nargs=None, const=None, default=None, type=None,
choices=None, help=None, metavar=None)
ap.add_argument("-v", "--video", type=str, default="")
_StoreAction(option_strings=['-v', '--video'], dest='video', nargs=None, const=None, default='', type=<class 'str'>, choices=None, help=None,
metavar=None)
args = vars(ap.parse_args())
usage: [-h] -p SHAPE_PREDICTOR [-v VIDEO]
error: the following arguments are required: -p/--shape-predictor
答案 0 :(得分:0)
是
usage: [-h] -p SHAPE_PREDICTOR [-v VIDEO]
error: the following arguments are required: -p/--shape-predictor
是命令行的输出吗?
我不确定,但是您可能忘记设置-p SHAPE_PREDICTOR标志,这似乎是一个强制选项。您的argparser返回错误,因为他的参数不正确