VisionFaceDetection
An example of use a Vision framework for face landmarks detection
Landmark detection needs to be divided in to two steps.
First one is face rectangle detection by using VNDetectFaceRectanglesRequest based on pixelBuffer provided by delegate function captureOutput.
Next we need to setup the property inputFaceObservations of VNDetectFaceLandmarksRequest object, to provide the input.
Now we are redy to start landmarks detection.
It's possible to detects landmarks like: faceContour, leftEye, rightEye, nose, noseCrest, lips, outerLips, leftEyebrow, and rightEyebrow.
To display the results I'm using multiple CAShapeLayer with UIBezierPath.
Landmarks detection is working on live front camera preview.
If you want more details about using Vision framework, go and check my blogpost about it

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

