I've been trying to parse arguments on the command line. In the code which I've been trying to run.
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--prototxt ", required=True,
help="path to Caffe 'deploy' prototxt file")
ap.add_argument("-m", "--model", required=True,
help="path to Caffe pre-trained model")
So, I go to that directory using cd
then, I've tried
python people_counter.py --prototxt C:\Users\mustafa\Downloads\people-counting-opencv\people-counting-opencv\mobilenet_ssd --model C:\Users\mustafa\Downloads\people-counting-opencv\people-counting-opencv\mobilenet_ssd
And here is the error message:
[INFO] loading model...
Traceback (most recent call last):
File "people_counter.py", line 49, in <module>
net = cv2.dnn.readNetFromCaffe(args["prototxt"], args["model"])
KeyError: 'prototxt'
I am sure that both paths are true.
EDIT: I've seen that I had defined
prototxt
with space. So I removed it.