Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- detector = dlib.get_frontal_face_detector()
- predictor = dlib.shape_predictor('res/model.dat')
- # detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
- cap = cv.VideoCapture(0)
- while True:
- _, frame = cap.read(0)
- gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
- dets = detector(gray, 0)
- print(dets)
- for det in dets:
- landmarks = shape_to_np(predictor(gray, det))
- cv.imshow('test', frame)
- if cv.waitKey(1) == ord('q'):
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement