人脸检测的性能对比

No1:

protoPath = os.path.sep.join([args["detector"], "deploy.prototxt"])
modelPath = os.path.sep.join([args["detector"],"res10_300x300_ssd_iter_140000.caffemodel"])
net = cv2.dnn.readNetFromCaffe(protoPath, modelPath)

blob = cv2.dnn.blobFromImage(cv2.resize(frame, (300, 300)), 1.0,(300, 300), (104.0, 177.0, 123.0))        
net.setInput(blob)
detections = net.forward()

No2:

detector = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")

gray = cv2.cvtColor(frameClone_cascade, cv2.COLOR_BGR2GRAY)
rects = detector.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5, minSize=(20, 20),flags=cv2.CASCADE_SCALE_IMAGE)

 

No3:

detector_age_gender = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")

rects = detector_age_gender(gray, 1)	


 

你可能感兴趣的:(AI)