Error: the following arguments are required

5.2k Views Asked by At

This is my code:

ap = argparse.ArgumentParser()
ap.add_argument("-p", "--shape-predictor", required=True,
    help="path to facial landmark predictor", default="shape_predictor_68_face_landmarks.dat")
ap.add_argument("-a", "--alarm", type=str, default="alaram.wav",
    help="path alarm .WAV file")
ap.add_argument("-w", "--webcam", type=int, default=0,
    help="index of webcam on system")
args = vars(ap.parse_args())

this is my code

X

usage:

detect_drowsiness.py [-h] -p SHAPE_PREDICTOR [-a ALARM] [-w WEBCAM]

I am geting an error:

detect_drowsiness.py: error: the following arguments are required: -p/--shape-predict

1

There are 1 best solutions below

0
Peshmerge On

Download the file shape_predictor_68_face_landmarks.dat from here http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 and extract it and place in project directory and execute your python file with detect_drowsiness.py -p shape_predictor_68_face_landmarks.dat.

That needed file is a trained model for Dlib!