One Logo Pool Ball
Vision · IOS API REFERENCE

GeneratePersonSegmentationRequest

class · iOS 18.0+ · SDK 27.1

final class GeneratePersonSegmentationRequest

A request that produces a matte image for a person it finds in the input image. 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.

Members (13)

get · iOS 18.0+

descriptor

TypeScript
get descriptor(): RequestDescriptor
Swift declaration
final var descriptor: RequestDescriptor { get }

An enum that identifies the request and request revision.

get · iOS 18.0+

qualityLevel

TypeScript
get qualityLevel(): GeneratePersonSegmentationRequest_QualityLevel
Swift declaration
final var qualityLevel: GeneratePersonSegmentationRequest.QualityLevel { get set }

Segmentation speed vs. accuracy control. The default is `.accurate`.

set · iOS 18.0+

qualityLevel

TypeScript
set qualityLevel(value: GeneratePersonSegmentationRequest_QualityLevel)
Swift declaration
final var qualityLevel: GeneratePersonSegmentationRequest.QualityLevel { get set }

Segmentation speed vs. accuracy control. The default is `.accurate`.

get · iOS 18.0+

regionOfInterest

TypeScript
get regionOfInterest(): NormalizedRect
Swift declaration
final var regionOfInterest: NormalizedRect { get set }

The region of the image in which Vision will perform the request. The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner. By default, the region of interest will be the full image.

set · iOS 18.0+

regionOfInterest

TypeScript
set regionOfInterest(value: NormalizedRect)
Swift declaration
final var regionOfInterest: NormalizedRect { get set }

The region of the image in which Vision will perform the request. The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner. By default, the region of interest will be the full image.

method · iOS 18.0+

setComputeDevice

TypeScript
setComputeDevice(computeDevice: (_CoreML_MLComputeDevice) | null, computeStage: ComputeStage): void
Swift declaration
final func setComputeDevice(_ computeDevice: MLComputeDevice?, for computeStage: ComputeStage)

Assigns a compute device for a compute stage. If the parameter `computeDevice` is `nil`, the framework removes any explicit compute device assignment and allows the framework to select the device. Configure any compute device for a given compute stage. When performing a request, the system makes a validity check. Use `supportedComputeStageDevices` to get valid compute devices for a request’s compute stages. - Parameters: - `computeDevice: `The compute device to assign to the compute stage. - `computeStage: `The compute stage.

get · iOS 18.0+

supportedRevisions

TypeScript
static get supportedRevisions(): Array<GeneratePersonSegmentationRequest_Revision>
Swift declaration
static let supportedRevisions: [GeneratePersonSegmentationRequest.Revision]

The collection of currently-supported revisions for `GeneratePersonSegmentationRequest `.

get · iOS 18.0+

frameAnalysisSpacing

TypeScript
get frameAnalysisSpacing(): _CoreMedia_CMTime
Swift declaration
final let frameAnalysisSpacing: CMTime

The reciprocal of maximum rate at which buffers will be processed. The request will not process buffers that fall within the `frameAnalysisSpacing` since the previously performed analysis. The analysis is not done by wall time but by analysis of of the time stamps of the samplebuffers being processed.

get · iOS 18.0+

outputPixelFormatType

TypeScript
get outputPixelFormatType(): SDKHandle
Swift declaration
final var outputPixelFormatType: OSType { get set }

The desired pixel format type of the observation.

set · iOS 18.0+

outputPixelFormatType

TypeScript
set outputPixelFormatType(value: SDKHandle)
Swift declaration
final var outputPixelFormatType: OSType { get set }

The desired pixel format type of the observation.

get · iOS 18.0+

supportedOutputPixelFormats

TypeScript
get supportedOutputPixelFormats(): Array<SDKHandle>
Swift declaration
final var supportedOutputPixelFormats: [OSType] { get }

The collection of supported pixel format types.

get · iOS 18.0+

revision

TypeScript
get revision(): GeneratePersonSegmentationRequest_Revision
Swift declaration
final let revision: GeneratePersonSegmentationRequest.Revision

The request's configured revision.

init · iOS 18.0+

init

TypeScript
static init(revision?: (GeneratePersonSegmentationRequest_Revision) | null, frameAnalysisSpacing?: (_CoreMedia_CMTime) | null): GeneratePersonSegmentationRequest
Swift declaration
init(_ revision: GeneratePersonSegmentationRequest.Revision? = nil, frameAnalysisSpacing: CMTime? = nil)

Skipped declarations

No declarations were skipped in this snapshot.

All Vision types →