【发布时间】:2021-11-15 23:01:19
【问题描述】:
我遇到了 argparse 库的问题。
我有 encodings.pickle 文件,我正在按照下面的代码来识别演员,但它似乎加载嵌入不起作用。
代码如下:
ap = argparse.ArgumentParser()
ap.add_argument("-e", "--encodings", required=True,
help="path to serialized db of facial encodings")
ap.add_argument("-i", "--image", required=True,
help="path to input image")
ap.add_argument("-d", "--detection-method", type=str, default="cnn",
help="face detection model to use: either `hog` or `cnn`")
ap.add_argument("-fnn", "--fast-nn", action="store_true")
args = parser.parse_args('')
print(args)
# load the known faces and embeddings
print("[INFO] loading encodings...")
data = pickle.loads(open(args["encodings"], "rb").read())
源代码:
https://github.com/divya21raj/Actor-Recognition-In-Movies/blob/master/faceRecVideo.py
【问题讨论】:
标签: python