MPPFaceStylizer
@interface MPPFaceStylizer : NSObjectClass that performs face stylization on images.
- 
                  
                  Creates a new instance of FaceStylizerfrom an absolute path to a model bundle stored locally on the device and the defaultFaceStylizer.DeclarationObjective-C - (nullable instancetype)initWithModelPath:(nonnull NSString *)modelPath error:(NSError *_Nullable *_Nullable)error;ParametersmodelPathAn absolute path to a TensorFlow Lite model file stored locally on the device. Return ValueA new instance of FaceStylizerwith the given model path.nilif there is an error in initializing the face stylizer.
- 
                  
                  Creates a new instance of FaceStylizerfrom the givenFaceStylizerOptions.DeclarationObjective-C - (nullable instancetype)initWithOptions: (nonnull MPPFaceStylizerOptions *)options error:(NSError *_Nullable *_Nullable)error;ParametersoptionsThe options of type FaceStylizerOptionsto use for configuring theFaceStylizer.Return ValueA new instance of FaceStylizerwith the given options.nilif there is an error in initializing the face stylizer.
- 
                  
                  Performs face stylization on the provided MPImageand returns aFaceStylizerResultcontaining 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 theorientationproperty of the providedMPImage.This method supports face stylization RGBA images. If your MPImagehas a source type of.pixelBufferor.sampleBuffer, the underlying pixel buffer must usekCVPixelFormatType_32BGRAas its pixel format.If your MPImagehas a source type of.imageensure that the color space is RGB with an Alpha channel.DeclarationObjective-C - (nullable MPPFaceStylizerResult *)stylizeImage:(nonnull MPPImage *)image error:(NSError *_Nullable *_Nullable) error;ParametersimageThe MPImageon which face stylization is to be performed.Return ValueA FaceStylizerResultthat 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. ThestylizedImageof theFaceStylizerResultisnilif there is no face detected in the input image.FaceStylizerResultisnilif there is an error in initializing the face stylizer.
- 
                  
                  Performs face stylization on the provided MPImageand returns aFaceStylizerResultcontaining 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 theorientationproperty of the providedMPImage.This method supports face stylization RGBA images. If your MPImagehas a source type of.pixelBufferor.sampleBuffer, the underlying pixel buffer must usekCVPixelFormatType_32BGRAas its pixel format.If your MPImagehas a source type of.imageensure that the color space is RGB with an Alpha channel.DeclarationObjective-C - (nullable MPPFaceStylizerResult *)stylizeImage:(nonnull MPPImage *)image regionOfInterest:(CGRect)regionOfInterest error:(NSError *_Nullable *_Nullable) error;ParametersimageThe MPImageon which face stylization is to be performed.Return ValueA FaceStylizerResultthat 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. ThestylizedImageof theFaceStylizerResultisnilif there is no face detected in the input image.FaceStylizerResultisnilif there is an error in initializing the face stylizer.
- 
                  
                  Undocumented DeclarationObjective-C - (instancetype)init NS_UNAVAILABLE;
- 
                  
                  Undocumented DeclarationObjective-C + (instancetype)new NS_UNAVAILABLE;