Deep Learning - Face Regconition

화이티 ·2024년 1월 19일
0

Deep Learning

목록 보기
20/24

https://developers.google.com/mediapipe/solutions/vision/face_landmarker#get_started
0. Face에서 특징점 추출 완료 (478 개)
1. 4번점 사용(코)
2. 얼굴에 마스크 씌우는 코드 가져와서 4번애 씌우기
2.1 콜르 중심으로해서 bbox(boundbox)값은 임의로 계산
3. 손 동작인식하는 코드 합치기
4. 손 동작에 따라거 다른 마스크 씌우기
OpenCV기능 배우기
LSTM/RNN (시계열 관련 모델)

import cv2
import mediapipe as mp
# 얼굴에서 특징점 찾기 관련 기능
mp_face = mp.solutions.face_mesh
# 특징점 찾기 세부 기능
face = mp_face.FaceMesh(
    min_detection_confidence = 0.5, # 얼굴 표현할 최소 정확도
    min_tracking_confidence = 0.5 # 특징점 표현할 최서 정확도
    
)
# 특징점 표현 기능
mp_drawing = mp.solutions.drawing_utils
video  = cv2.VideoCapture(0)
while video.isOpened():
    ret, img = video.read()
    img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
    img = cv2.flip(img,1)
    # 얼굴에서 특징점 검출하기
    face_result = face.process(img)
    img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
    if not ret:
        break
    if face_result.multi_face_landmarks is not None:
        for res in face_result.multi_face_landmarks:
            mp_drawing.draw_landmarks(img, res, mp.solutions.face_mesh.FACEMESH_TESSELATION)
    k = cv2.waitKey(30)
    if k == 49:
        break
    cv2.imshow('face', img)
video.release()
cv2.destroyAllWindows()


profile
열심히 공부합시다! The best is yet to come! 💜

0개의 댓글

관련 채용 정보