Skip to content

상세하게 얼굴 찾기 ​

인스턴스 선언 ​

상세하게 얼굴 찾기(DetailedFaceDetection) 블록을 작업 영역에 추가하면, Python 코드에는 다음과 같은 인스턴스 선언이 자동으로 삽입됩니다:

python
detailed_face_detection = DetailedFaceDetection(0)
# 여러 인스턴스가 있는 경우
detailed_face_detection_1 = DetailedFaceDetection(1)

매개변수 ​

이름구분설명범위 / 종류기본값
index드롭다운 옵션인스턴스 번호 (0부터 시작)0 이상 정수0

카메라 장치 선택하기 ​

상세하게 얼굴 찾기를 위한 카메라를 설정합니다.

device

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션카메라 장치 이름시스템 카메라 라벨-

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.device('')

모델 로드하기 ​

학습된 얼굴 모델을 불러옵니다. '상세하게 얼굴 찾기' 모듈의 기능들을 사용하기 위해서는 이 작업이 반드시 필요합니다.

load_model

매개변수 ​

이름구분설명범위 / 종류기본값
wait체크박스로드 완료 대기 여부TRUE / FALSETRUE

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.load_model(wait=True)

한 번 인식하기 ​

현재 화면에 있는 얼굴을 찾아 딱 한번 표시합니다.

detect_once

매개변수 ​

(없음)

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.detect_once()

연속 인식 시작 / 중지 ​

현재 화면에 있는 얼굴을 계속해서 따라가며 화면 상에 표시합니다.

detect_continuous

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션동작시작(start), 중지(stop)-

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

# unit = "start"
detailed_face_detection.detect_continuous()
# unit = "stop"
detailed_face_detection.stop()

인식 화면 표시하기 ​

카메라 화면에 얼굴 찾기 결과를 표시할지 말지를 결정합니다.

display

매개변수 ​

이름구분설명범위 / 종류기본값
on드롭다운 옵션표시 ON / OFF보이기(on=True), 숨기기(off=False)TRUE

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.display(True)
detailed_face_detection.display(False)

얼굴 부위 좌표 ​

얼굴 부위별 좌표를 반환합니다.

face_data

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션얼굴 부위얼굴(face), 왼쪽 눈(left eye), 오른쪽 눈(right eye), 입(mouth), 코(nose), 윗입술(upper lip), 아랫입술(lower lip), 왼쪽 입꼬리(left lip), 오른쪽 입꼬리(right lip), 왼쪽 눈동자(left pupil), 오른쪽 눈동자(right pupil)-
pos드롭다운 옵션좌표x, y-

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.face('x')
detailed_face_detection.left_eye('y')
detailed_face_detection.upper_lip('x')
detailed_face_detection.right_pupil('y')

얼굴 부위 사각형 정보 ​

얼굴 부위별 영역 사각형의 위치/크기 값을 반환합니다.

face_square

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션얼굴 부위얼굴(face), 왼쪽 눈(left eye), 오른쪽 눈(right eye), 입(mouth)-
pos드롭다운 옵션사각형 정보최소 x(min_x), 최대 x(max_x), 최소 y(min_y), 최대 y(max_y), 폭(width), 높이(height), 넓이(area)-

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.face('min_x')
detailed_face_detection.left_eye('area')

두 부위 사이 거리 ​

얼굴 부위 두 곳 사이의 거리를 반환합니다.

distance

매개변수 ​

이름구분설명범위 / 종류기본값
unit1드롭다운 옵션첫 번째 부위얼굴 부위 이름-
unit2드롭다운 옵션두 번째 부위얼굴 부위 이름-
type드롭다운 옵션거리 종류거리(생략 또는 None), 가로 거리(horizontal), 세로 거리(vertical)None

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.get_distance('left_eye', 'right_eye')  # 거리
detailed_face_detection.get_distance('left_pupil', 'right_pupil', 'horizontal')  # 가로 거리
detailed_face_detection.get_distance('upper_lip', 'lower_lip', 'vertical')  # 세로 거리

모델 상태 ​

얼굴 모델 로딩 상태를 반환합니다.
아직 불러오지 않았으면 0, 불러오는 중이면 1, 불러오기를 완료했으면 2를 반환합니다.

model_state

매개변수 ​

(없음)

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.model_state()

얼굴 감지 여부 ​

얼굴을 찾았는지 여부

detected

매개변수 ​

(없음)

Python ​

python
detailed_face_detection = DetailedFaceDetection(0)

detailed_face_detection.detected()