Performs face stylization on the provided MPImage and returns a FaceStylizerResult
containing a copy of the stylized image. This method should not be used in high-throughput
applications since the returned image is copied. Rotation will be applied according to the
orientation property of the provided MPImage.
This method supports face stylization RGBA images. If your MPImage has a source type of
.pixelBuffer or .sampleBuffer, the underlying pixel buffer must use
kCVPixelFormatType_32BGRA as its pixel format.
If your MPImage has a source type of .image ensure that the color space is RGB with an
Alpha channel.
The MPImage on which face stylization is to be performed.
Return Value
A FaceStylizerResult that contains the stylized image of the most visible face. The
returned image is copied. The stylized output image size is the same as the model output
size. The stylizedImage of the FaceStylizerResult is nil if there is no face detected in
the input image. FaceStylizerResult is nil if there is an error in initializing the face
stylizer.
Performs face stylization on the provided MPImage and returns a FaceStylizerResult
containing a copy of the stylized image. This method should not be used in high-throughput
applications since the returned image is copied. Rotation will be applied according to the
orientation property of the provided MPImage.
This method supports face stylization RGBA images. If your MPImage has a source type of
.pixelBuffer or .sampleBuffer, the underlying pixel buffer must use
kCVPixelFormatType_32BGRA as its pixel format.
If your MPImage has a source type of .image ensure that the color space is RGB with an
Alpha channel.
The MPImage on which face stylization is to be performed.
Return Value
A FaceStylizerResult that contains the stylized image of the most visible face. The
returned image is copied. The stylized output image size is the same as the model output
size. The stylizedImage of the FaceStylizerResult is nil if there is no face detected in
the input image. FaceStylizerResult is nil if there is an error in initializing the face
stylizer.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-08 UTC."],[],[],null,["# MediaPipeTasksVision Framework Reference\n\nFaceStylizer\n============\n\n class FaceStylizer : NSObject\n\nClass that performs face stylization on images.\n- `\n ``\n ``\n `\n\n ### [init(modelPath:)](#/c:objc(cs)MPPFaceStylizer(im)initWithModelPath:error:)\n\n `\n ` \n Creates a new instance of `FaceStylizer` from an absolute path to a model bundle stored locally\n on the device and the default `FaceStylizer`. \n\n #### Declaration\n\n Swift \n\n convenience init(modelPath: String) throws\n\n #### Parameters\n\n |-------------------|--------------------------------------------------------------------------------|\n | ` `*modelPath*` ` | An absolute path to a TensorFlow Lite model file stored locally on the device. |\n\n #### Return Value\n\n A new instance of `FaceStylizer` with the given model path. `nil` if there is an error in\n initializing the face stylizer.\n- `\n ``\n ``\n `\n\n ### [init(options:)](#/c:objc(cs)MPPFaceStylizer(im)initWithOptions:error:)\n\n `\n ` \n Creates a new instance of `FaceStylizer` from the given [FaceStylizerOptions](../Classes.html#/c:objc(cs)MPPFaceStylizerOptions). \n\n #### Declaration\n\n Swift \n\n init(options: ../Classes.html#/c:objc(cs)MPPFaceStylizerOptions) throws\n\n #### Parameters\n\n |-----------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*options*` ` | The options of type [FaceStylizerOptions](../Classes.html#/c:objc(cs)MPPFaceStylizerOptions) to use for configuring the `FaceStylizer`. |\n\n #### Return Value\n\n A new instance of `FaceStylizer` with the given options. `nil` if there is an error in\n initializing the face stylizer.\n- `\n ``\n ``\n `\n\n ### [stylize(image:)](#/c:objc(cs)MPPFaceStylizer(im)stylizeImage:error:)\n\n `\n ` \n Performs face stylization on the provided [MPImage](../Classes/MPImage.html) and returns a [FaceStylizerResult](../Classes/FaceStylizerResult.html)\n containing a copy of the stylized image. This method should not be used in high-throughput\n applications since the returned image is copied. Rotation will be applied according to the\n `orientation` property of the provided [MPImage](../Classes/MPImage.html).\n\n This method supports face stylization RGBA images. If your [MPImage](../Classes/MPImage.html) has a source type of\n [.pixelBuffer](../Constants.html#/c:MPPImage.h@MPPImageSourceTypePixelBuffer) or [.sampleBuffer](../Constants.html#/c:MPPImage.h@MPPImageSourceTypeSampleBuffer), the underlying pixel buffer must use\n `kCVPixelFormatType_32BGRA` as its pixel format.\n\n If your [MPImage](../Classes/MPImage.html) has a source type of [.image](../Constants.html#/c:MPPImage.h@MPPImageSourceTypeImage) ensure that the color space is RGB with an\n Alpha channel. \n\n #### Declaration\n\n Swift \n\n func stylize(image: ../Classes/MPImage.html) throws -\u003e ../Classes/FaceStylizerResult.html\n\n #### Parameters\n\n |---------------|--------------------------------------------------------------------------------------|\n | ` `*image*` ` | The [MPImage](../Classes/MPImage.html) on which face stylization is to be performed. |\n\n #### Return Value\n\n A [FaceStylizerResult](../Classes/FaceStylizerResult.html) that contains the stylized image of the most visible face. The\n returned image is copied. The stylized output image size is the same as the model output\n size. The `stylizedImage` of the [FaceStylizerResult](../Classes/FaceStylizerResult.html) is `nil` if there is no face detected in\n the input image. [FaceStylizerResult](../Classes/FaceStylizerResult.html) is `nil` if there is an error in initializing the face\n stylizer.\n- `\n ``\n ``\n `\n\n ### [stylize(image:regionOfInterest:)](#/c:objc(cs)MPPFaceStylizer(im)stylizeImage:regionOfInterest:error:)\n\n `\n ` \n Performs face stylization on the provided [MPImage](../Classes/MPImage.html) and returns a [FaceStylizerResult](../Classes/FaceStylizerResult.html)\n containing a copy of the stylized image. This method should not be used in high-throughput\n applications since the returned image is copied. Rotation will be applied according to the\n `orientation` property of the provided [MPImage](../Classes/MPImage.html).\n\n This method supports face stylization RGBA images. If your [MPImage](../Classes/MPImage.html) has a source type of\n [.pixelBuffer](../Constants.html#/c:MPPImage.h@MPPImageSourceTypePixelBuffer) or [.sampleBuffer](../Constants.html#/c:MPPImage.h@MPPImageSourceTypeSampleBuffer), the underlying pixel buffer must use\n `kCVPixelFormatType_32BGRA` as its pixel format.\n\n If your [MPImage](../Classes/MPImage.html) has a source type of [.image](../Constants.html#/c:MPPImage.h@MPPImageSourceTypeImage) ensure that the color space is RGB with an\n Alpha channel. \n\n #### Declaration\n\n Swift \n\n func stylize(image: ../Classes/MPImage.html, regionOfInterest: CGRect) throws -\u003e ../Classes/FaceStylizerResult.html\n\n #### Parameters\n\n |---------------|--------------------------------------------------------------------------------------|\n | ` `*image*` ` | The [MPImage](../Classes/MPImage.html) on which face stylization is to be performed. |\n\n #### Return Value\n\n A [FaceStylizerResult](../Classes/FaceStylizerResult.html) that contains the stylized image of the most visible face. The\n returned image is copied. The stylized output image size is the same as the model output\n size. The `stylizedImage` of the [FaceStylizerResult](../Classes/FaceStylizerResult.html) is `nil` if there is no face detected in\n the input image. [FaceStylizerResult](../Classes/FaceStylizerResult.html) is `nil` if there is an error in initializing the face\n stylizer.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)MPPFaceStylizer(im)init)\n\n `\n ` \n Undocumented\n- `\n ``\n ``\n `\n\n ### [+new](#/c:objc(cs)MPPFaceStylizer(cm)new)\n\n `\n ` \n Undocumented"]]