# HolisticLandmarker

    class HolisticLandmarker: NSObject

Performs holistic landmarks detection on images.

This API expects a pre-trained holistic landmarks model asset bundle.
- `
  ### [init(modelPath:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/HolisticLandmarker.md.txt#/c:objc(cs)MPPHolisticLandmarker(im)initWithModelPath:error:)

  ` Creates a new instance of `HolisticLandmarker` from an absolute path to a model asset bundle stored locally on the device and the default `HolisticLandmarkerOptions`.

  #### Declaration

  Swift

      convenience init(modelPath: String) throws

  #### Parameters

  |---|---|
  | `modelPath` | An absolute path to a model asset bundle stored locally on the device. |

  #### Return Value

  A new instance of `HolisticLandmarker` with the given model path. `nil` if there is an error in initializing the holistic landmarker.
- `
  ### [init(options:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/HolisticLandmarker.md.txt#/c:objc(cs)MPPHolisticLandmarker(im)initWithOptions:error:)

  ` Creates a new instance of `HolisticLandmarker` from the given `HolisticLandmarkerOptions`.

  #### Declaration

  Swift

      init(options: HolisticLandmarkerOptions) throws

  #### Parameters

  |---|---|
  | `options` | The options of type `HolisticLandmarkerOptions` to use for configuring the `HolisticLandmarker`. |

  #### Return Value

  A new instance of `HolisticLandmarker` with the given options. `nil` if there is an error in initializing the holistic landmarker.
- `
  ### [detect(image:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/HolisticLandmarker.md.txt#/c:objc(cs)MPPHolisticLandmarker(im)detectImage:error:)

  ` Performs holistic landmarks detection on the provided `MPImage` using the whole image as region ofinterest. Rotation will be applied according to the `orientation` property of the providedm`MPImage`. Only use this method when the `HolisticLandmarker` is created with running mode, `.image`.

  This method supports performing holistic landmarks detection on 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.

  #### Declaration

  Swift

      func detect(image: MPImage) throws -> HolisticLandmarkerResult

  #### Parameters

  |---|---|
  | `image` | The `MPImage` on which holistic landmarks detection is to be performed. |

  #### Return Value

  An `HolisticLandmarkerResult` object that contains the holistic landmarks detection results.
- `
  ### [detect(videoFrame:timestampInMilliseconds:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/HolisticLandmarker.md.txt#/c:objc(cs)MPPHolisticLandmarker(im)detectVideoFrame:timestampInMilliseconds:error:)

  ` Performs holistic landmarks detection on the provided video frame of type `MPImage` using the whole image as region of interest. Rotation will be applied according to the `orientation` property of the provided `MPImage`. Only use this method when the `HolisticLandmarker` is created with running mode, `.video`.

  It's required to provide the video frame's timestamp (in milliseconds). The input timestamps must be monotonically increasing.

  This method supports performing holistic landmarks detection on 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.

  #### Declaration

  Swift

      func detect(videoFrame image: MPImage, timestampInMilliseconds: Int) throws -> HolisticLandmarkerResult

  #### Parameters

  |---|---|
  | `image` | The `MPImage` on which holistic landmarks detection is to be performed. |
  | `timestampInMilliseconds` | The video frame's timestamp (in milliseconds). The input timestamps must be monotonically increasing. |

  #### Return Value

  An `HolisticLandmarkerResult` object that contains the holistic landmarks detection results.
- `
  ### [detectAsync(image:timestampInMilliseconds:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/HolisticLandmarker.md.txt#/c:objc(cs)MPPHolisticLandmarker(im)detectAsyncImage:timestampInMilliseconds:error:)

  ` Sends live stream image data of type `MPImage` to perform holistic landmarks detection using the whole image as region of interest. Rotation will be applied according to the `orientation` property of the provided `MPImage`. Only use this method when the `HolisticLandmarker` is created with running mode, `.liveStream`.

  The object which needs to be continuously notified of the available results of holistic landmarks detection must confirm to `HolisticLandmarkerLiveStreamDelegate` protocol and implement the `holisticLandmarker(_:didFinishDetectionWithResult:timestampInMilliseconds:error:)` delegate method.

  It's required to provide a timestamp (in milliseconds) to indicate when the input image is sent to the holistic landmarker. The input timestamps must be monotonically increasing.

  This method supports performing holistic landmarks detection on 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 the input `MPImage` has a source type of `.image` ensure that the color space is RGB with an Alpha channel.

  If this method is used for performing holistic landmarks detection on live camera frames using `AVFoundation`, ensure that you request `AVCaptureVideoDataOutput` to output frames in `kCMPixelFormat_32BGRA` using its `videoSettings` property.

  #### Declaration

  Swift

      func detectAsync(image: MPImage, timestampInMilliseconds: Int) throws

  #### Parameters

  |---|---|
  | `image` | A live stream image data of type `MPImage` on which holistic landmarks detection is to be performed. |
  | `timestampInMilliseconds` | The timestamp (in milliseconds) which indicates when the input image is sent to the holistic landmarker. The input timestamps must be monotonically increasing. |