14번째 줄:
14번째 줄:
|이후 이 디렉터리 안의 모델을 사용한다.
|이후 이 디렉터리 안의 모델을 사용한다.
|-
|-
−
|사용할 모듈 불러오기
+
|사용할 모듈 설치 및 불러오기
−
|<syntaxhighlight lang="python">
+
|pip install CMake dlib opencv-python numpy
+
+
* 윈도우에선 visual studio 설치가 선행되어야 한다.(설치 옵션에서 C++ 모듈을 포함하게 하면 관련 컴파일러 등이 함께 설치된다.)
+
+
cmake는 dlib를 설치하기 위해 필요하다.<syntaxhighlight lang="python">
import dlib # 얼굴인식
import dlib # 얼굴인식
import cv2 # 이미지처리
import cv2 # 이미지처리
28번째 줄:
32번째 줄:
|<syntaxhighlight lang="python">
|<syntaxhighlight lang="python">
detector = dlib.get_frontal_face_detector() # 얼굴탐지모델
detector = dlib.get_frontal_face_detector() # 얼굴탐지모델
−
sp = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat') # 얼굴 랜드마크 탐지 모델. 학습된 모델을 가져온다.
+
predictor = dlib.shape_predictor('models/shape_predictor_68_face_landmarks.dat') # 얼굴 랜드마크 탐지 모델. 학습된 모델을 가져온다.
</syntaxhighlight>
</syntaxhighlight>
−
|-
−
|
−
|
−
|-
−
|얼굴 특징점 표시
−
|
|}
|}