<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/GeneratePersonSegmentationRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision33GeneratePersonSegmentationRequestC"
  },
  "title" : "GeneratePersonSegmentationRequest"
}
-->

# GeneratePersonSegmentationRequest

A request that produces a matte image for a person it finds in the input image.

```
final class GeneratePersonSegmentationRequest
```

## Overview

Perform this request to detect and generate an image mask for a person in an image. The request returns the resulting image mask in an instance of [`PixelBufferObservation`](/documentation/Vision/PixelBufferObservation).

## Topics

### Creating a request

[`init(_:frameAnalysisSpacing:)`](/documentation/Vision/GeneratePersonSegmentationRequest/init(_:frameAnalysisSpacing:))

Creates a person-segmentation request.

### Performing a request

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-80bya)

Performs the request on an image URL and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-3f3f1)

Performs the request on image data and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-qxxx)

Performs the request on a Core Graphics image and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-xspx)

Performs the request on a pixel buffer and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-3hddl)

Performs the request on a Core Media buffer and produces observations.

[`perform(on:orientation:)`](/documentation/Vision/ImageProcessingRequest/perform(on:orientation:)-85ex1)

Performs the request on a Core Image image and produces observations.

### Understanding the result

[`PixelBufferObservation`](/documentation/Vision/PixelBufferObservation)

An object that represents an image that an image-analysis request produces.

### Configuring a request

[`qualityLevel`](/documentation/Vision/GeneratePersonSegmentationRequest/qualityLevel-swift.property)

A value that indicates how the request balances accuracy and performance.

[`QualityLevel`](/documentation/Vision/GeneratePersonSegmentationRequest/QualityLevel-swift.enum)

Constants that define the levels of quality for a person-segmentation request.

[`outputPixelFormatType`](/documentation/Vision/GeneratePersonSegmentationRequest/outputPixelFormatType)

The desired pixel format of the observation.

[`supportedOutputPixelFormats`](/documentation/Vision/GeneratePersonSegmentationRequest/supportedOutputPixelFormats)

The collection of supported pixel format types.

### Getting the revision

[`revision`](/documentation/Vision/GeneratePersonSegmentationRequest/revision-swift.property)

The algorithm or implementation the request uses.

[`supportedRevisions`](/documentation/Vision/GeneratePersonSegmentationRequest/supportedRevisions)

The collection of revisions the request supports.

[`Revision`](/documentation/Vision/GeneratePersonSegmentationRequest/Revision-swift.enum)

A type that describes the algorithm or implementation that the request performs.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`ImageProcessingRequest`](/documentation/Vision/ImageProcessingRequest)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`StatefulRequest`](/documentation/Vision/StatefulRequest)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`VisionRequest`](/documentation/Vision/VisionRequest)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)