Python 导入用于面部识别的库时出错?
我将继续学习本教程。它教我如何创建面部识别数据集 到目前为止,我正在导入我的库;但是,我得到以下错误: 用法:face_recognition.py[-h]-c/--cascade c/u cascade-o输出 facial_recognition.py:错误:需要以下参数: -c/--cascade/-o/--output,-o/--output 这是我使用的代码Python 导入用于面部识别的库时出错?,python,argparse,facial-identification,Python,Argparse,Facial Identification,我将继续学习本教程。它教我如何创建面部识别数据集 到目前为止,我正在导入我的库;但是,我得到以下错误: 用法:face_recognition.py[-h]-c/--cascade c/u cascade-o输出 facial_recognition.py:错误:需要以下参数: -c/--cascade/-o/--output,-o/--output 这是我使用的代码 import argparse import imutils import time import cv2 import os
import argparse
import imutils
import time
import cv2
import os
ap = argparse.ArgumentParser()
ap.add_argument("-c/ --cascade", "-o/--output", required=True,
help = "path to where the face cascade resides")
ap.add_argument("-o", "--output", required=True,
help="path to output directory")
args = vars(ap.parse_args())
看起来您在运行脚本时没有提供任何命令行参数?我猜您试图导入一个仅作为独立脚本编写的模块。您是否阅读了有关argparse的链接?