1

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

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

1

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!

Peshmerge
  • 1,024
  • 1
  • 14
  • 27