Skip to content

얼굴 찾기 ​

인스턴스 선언 ​

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

python
face_detection = FaceDetection(0)
# 여러 인스턴스가 있는 경우
face_detection_1 = FaceDetection(1)

매개변수 ​

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

카메라 장치 선택하기 ​

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

device

매개변수 ​

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

Python ​

python
face_detection = FaceDetection(0)

face_detection.device('')

모델 로드하기 ​

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

load_model

매개변수 ​

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

Python ​

python
face_detection = FaceDetection(0)

face_detection.load_model(wait=True)

한 번 인식하기 ​

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

detect_once

매개변수 ​

(없음)

Python ​

python
face_detection = FaceDetection(0)

face_detection.detect_once()

연속 인식 시작 / 중지 ​

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

detect_continuous

매개변수 ​

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

Python ​

python
face_detection = FaceDetection(0)

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

인식 화면 표시하기 ​

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

display

매개변수 ​

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

Python ​

python
face_detection = FaceDetection(0)

face_detection.display(True)
face_detection.display(False)

얼굴 부위 위치 ​

얼굴 또는 얼굴 부위의 위치 좌표를 반환합니다.

face_data

매개변수 ​

이름구분설명범위 / 종류기본값
unit드롭다운 옵션얼굴 부위얼굴(face), 왼쪽 눈(left eye), 오른쪽 눈(right eye), 왼쪽 귀(left ear), 오른쪽 귀(right ear), 코(nose), 입(mouth)-
pos드롭다운 옵션좌표 종류x, y-

Python ​

python
face_detection = FaceDetection(0)

face_detection.face('x')
face_detection.left_eye('y')
face_detection.right_eye('x')
face_detection.left_ear('x')
face_detection.right_ear('y')
face_detection.nose('x')
face_detection.mouth('y')

얼굴 사각형 정보 ​

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

face_square

매개변수 ​

이름구분설명범위 / 종류기본값
pos드롭다운 옵션사각형 정보최소 x(min_x), 최대 x(max_x), 최소 y(min_y), 최대 y(max_y), 폭(width), 높이(height), 넓이(area)-

Python ​

python
face_detection = FaceDetection(0)

face_detection.face('min_x')
face_detection.face('width')
face_detection.face('area')

두 부위 사이 거리 ​

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

distance

매개변수 ​

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

Python ​

python
face_detection = FaceDetection(0)

face_detection.get_distance('left_eye', 'right_eye')  # 거리
face_detection.get_distance('left_eye', 'right_eye', 'horizontal')  # 가로 거리
face_detection.get_distance('nose', 'mouth', 'vertical')  # 세로 거리

모델 상태 ​

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

model_state

매개변수 ​

(없음)

Python ​

python
face_detection = FaceDetection(0)

face_detection.model_state()

얼굴 감지 여부 ​

얼굴을 찾았는지 여부

detected

매개변수 ​

(없음)

Python ​

python
face_detection = FaceDetection(0)

face_detection.detected()