Platforms to show: All Mac Windows Linux Cross-Platform

VNDetectFaceLandmarksRequestMBS class

Super class: VNImageBasedRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Vision MBS MacFrameworks Plugin 19.4 ✅ Yes ❌ No ❌ No ✅ Yes All
An image analysis request that finds facial features (such as the eyes and mouth) in an image.
Example
// we like to find face landmarks in the image
Var request As New VNDetectFaceLandmarksRequestMBS
Var requests() As VNRequestMBS = Array(request)

Var file As FolderItem = SpecialFolder.Desktop.Child("image0.jpeg")
Var imageRequestHandler As VNImageRequestHandlerMBS = VNImageRequestHandlerMBS.RequestWithFile(file)

// perform request synchronously. Asynchronously with callback is also possible
Var error As NSErrorMBS
Var r As Boolean = imageRequestHandler.performRequests(requests, error)

If r Then

Var results() As VNObservationMBS = request.results
Var result As VNObservationMBS = results(0)
If result IsA VNFaceObservationMBS Then
Var hresult As VNFaceObservationMBS = VNFaceObservationMBS(result)
// show first observation confidence. See boundingBox in debugger
Var boundingBox As CGRectMBS = hresult.boundingBox
Var landmarks As VNFaceLandmarks2DMBS = hresult.landmarks

Break // check all the parts in the debugger
End If
End If

By default, a face landmarks request first locates all faces in the input image, then analyzes each to detect facial features.
If you've already located all the faces in an image, or want to detect landmarks in only a subset of the faces in the image, set the inputFaceObservations property to an array of VNFaceObservationMBS objects representing the faces you want to analyze. (You can either use face observations output by a VNDetectFaceRectanglesRequestMBS or manually create VNFaceObservation instances with the bounding boxes of the faces you want to analyze.)
Subclass of the VNImageBasedRequestMBS class.

Constellations

Constant Value Description
VNRequestFaceLandmarksConstellation65Points 1 A constellation with 65 points.
VNRequestFaceLandmarksConstellation76Points 2 A constellation with 76 points.
VNRequestFaceLandmarksConstellationNotDefined 0 An undefined constellation.

Super class VNImageBasedRequestMBS

Super class VNRequestMBS

This class has no sub classes.

Blog Entries

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


VNDetectFaceCaptureQualityRequestMBS   -   VNDetectFaceRectanglesRequestMBS


The biggest plugin in space...