0

我可以像这样从VNFaceObservation这个函数中获取面部地标数据,handleFaceDetectionObservations(observations: [VNFaceObservation])

private func handleFaceDetectionObservations(observations: [VNFaceObservation]) {
        for observation in observations {
            
            //FACE LANDMARKS
            if let landmarks = observation.landmarks {
                
                if let leftEye = landmarks.leftEye {
                    self.handleLandmark(leftEye, faceBoundingBox: faceRectConverted)
                }
                if let leftEyebrow = landmarks.leftEyebrow {
                    self.handleLandmark(leftEyebrow, faceBoundingBox: faceRectConverted)
                }
                if let rightEye = landmarks.rightEye {
                    self.handleLandmark(rightEye, faceBoundingBox: faceRectConverted)
                }
                if let rightEyebrow = landmarks.rightEyebrow {
                    self.handleLandmark(rightEyebrow, faceBoundingBox: faceRectConverted)
                }

                if let nose = landmarks.nose {
                    self.handleLandmark(nose, faceBoundingBox: faceRectConverted)
                }

                if let outerLips = landmarks.outerLips {
                    self.handleLandmark(outerLips, faceBoundingBox: faceRectConverted)
                }
                if let innerLips = landmarks.innerLips {
                    self.handleLandmark(innerLips, faceBoundingBox: faceRectConverted)
                }
            }
        }
    }

那么有什么方法可以根据上述地标预测面部情绪(例如微笑、愤怒)?

4

0 回答 0