기능 설명
이 기능을 사용하면 카메라에서 캡처한 openGL 텍스처를 기반으로 Apple ARKit의 표준을 사용하여 52개의 BlendShape를 생성할 수 있습니다. 자세한 내용은 ARFaceAnchor를 참고하십시오. blendshape 데이터를 기반으로 추가 개발을 수행할 수 있습니다. 예를 들어 Unity에 데이터를 전달하여 모델을 구동할 수 있습니다. iOS 통합 가이드
API 호출
1. 효과 활성화:
[self.beautyKit setFeatureEnableDisable:ANIMOJI_52_EXPRESSION enable:YES];
2. 얼굴 키포인트의 콜백을 구성합니다.
- (void)registerSDKEventListener:(id<YTSDKEventListener> _Nullable)listener;
@implementation listener
- (void)onYTDataEvent:(id)event
{
NSLog(@"YTData %@", event);
}
@end
onYTDataUpdate 는 JSON string 구조를 반환하고 최대 5개의 안면 인식 정보를 반환합니다.
{
"face_info":[{
"trace_id":5,
"face_256_point":[
180.0,
112.2,
...
],
"face_256_visible":[
0.85,
...
],
"out_of_screen":true,
"left_eye_high_vis_ratio:1.0,
"right_eye_high_vis_ratio":1.0,
"left_eyebrow_high_vis_ratio":1.0,
"right_eyebrow_high_vis_ratio":1.0,
"mouth_high_vis_ratio":1.0,
"expression_weights":[
0.12,
-0.32
...
]
},
...
]
}
필드 의미
trace_id: 얼굴 ID입니다. 연속 비디오 스트림 과정에서 얻은 얼굴의 얼굴 ID가 동일하면 동일한 사람으로 간주할 수 있습니다.
expression_weights: 실시간 blendshape 데이터입니다. 52개 요소의 배열이며, 요소의 값 범위는 0에서 1.0입니다. {"eyeBlinkLeft","eyeLookDownLeft","eyeLookInLeft","eyeLookOutLeft","eyeLookUpLeft","eyeSquintLeft","eyeWideLeft","eyeBlinkRight","eyeLookDownRight","eyeLookInRight","eyeLookOutRight","eyeLookUpRight","eyeSquintRight","eyeWideRight","jawForward","jawLeft","jawRight","jawOpen","mouthClose","mouthFunnel","mouthPucker","mouthRight","mouthLeft","mouthSmileLeft","mouthSmileRight","mouthFrownRight","mouthFrownLeft","mouthDimpleLeft","mouthDimpleRight","mouthStretchLeft","mouthStretchRight","mouthRollLower","mouthRollUpper","mouthShrugLower","mouthShrugUpper","mouthPressLeft","mouthPressRight","mouthLowerDownLeft","mouthLowerDownRight","mouthUpperUpLeft","mouthUpperUpRight","browDownLeft","browDownRight","browInnerUp","browOuterUpLeft","browOuterUpRight","cheekPuff","cheekSquintLeft","cheekSquintRight","noseSneerLeft","noseSneerRight","tongueOut"}
나머지 필드는 얼굴 특징 정보입니다. 반환 여부는 사용하는 License 유형에 따라 다릅니다. 얼굴 표정 데이터만 필요한 경우 해당 필드를 무시할 수 있습니다.
문제 해결에 도움이 되었나요?