Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. detector = dlib.get_frontal_face_detector()
  2. predictor = dlib.shape_predictor('res/model.dat')
  3. # detector = dlib.cnn_face_detection_model_v1('mmod_human_face_detector.dat')
  4.  
  5. cap = cv.VideoCapture(0)
  6.  
  7. while True:
  8. _, frame = cap.read(0)
  9. gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
  10. dets = detector(gray, 0)
  11. print(dets)
  12. for det in dets:
  13. landmarks = shape_to_np(predictor(gray, det))
  14.  
  15. cv.imshow('test', frame)
  16.  
  17. if cv.waitKey(1) == ord('q'):
  18. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement