바뀜

308 바이트 추가됨 ,  2021년 10월 1일 (금) 16:48
10번째 줄: 10번째 줄:  
detector = dlib.get_frontal_face_detector()  # 얼굴탐지모델
 
detector = dlib.get_frontal_face_detector()  # 얼굴탐지모델
 
predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')  # 얼굴 랜드마크 탐지 모델. 학습된 모델을 가져온다.
 
predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')  # 얼굴 랜드마크 탐지 모델. 학습된 모델을 가져온다.
facerec = dlib.face_recognition_model_v1('models/dlib_face_recognition_resnet_model_v1.dat')  # 인식모델. 랜드마크에서 shape를 받아 구분한다.
+
facerec = dlib.face_recognition_model_v1('models/dlib_face_recognition_resnet_model_v1.dat')  # 인식모델. 랜드마크에서 shape를 받아 구분한다. 얼굴의 특징을 받아 분류정보를 배열로 저장한다.
 
# 위 모델로 특정인을 인식할 수 있다.
 
# 위 모델로 특정인을 인식할 수 있다.
   22번째 줄: 22번째 줄:  
분류할 얼굴을 특정 디렉터리 안에 그림파일로 넣고, 이들의 특징을 담은 넘파이 배열을 descs.npy에 저장한다.
 
분류할 얼굴을 특정 디렉터리 안에 그림파일로 넣고, 이들의 특징을 담은 넘파이 배열을 descs.npy에 저장한다.
   −
이는 최초에 얼굴에 대해 교육할 때만 사용한다.<syntaxhighlight lang="python">
+
이는 최초에 얼굴에 대해 교육할 때만 사용한다.
 +
 
 +
유의 : png는 인식이 잘 안되는듯;;? jpg로 넣도록 하자. +교육할 땐 얼굴 하나만 있는 사진을 사용하자. 여러 명이 있는 사진의 경우, 얼굴 하나만 받는다.(얼굴이 없으면 에러가 난다.)<syntaxhighlight lang="python">
 
def educate():
 
def educate():
 
     import os
 
     import os