One Logo Pool Ball
Vision · IOS API REFERENCE

GenerateIterativeSegmentationRequest

class · iOS 27.0+ · SDK 27.1

final class GenerateIterativeSegmentationRequest

A request that generates a segmentation mask from points, a rectangle, or a scribble. Initialize with a seed point, a seed rectangle, or a seed scribble buffer to generate the initial segmentation mask. Then add points to iteratively refine the segmentation mask. The request supports a maximum of 13 points when seeded with a point or scribble, or 11 points when seeded with a box.

Members (15)

get · iOS 27.0+

descriptor

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

An enum that identifies the request and request revision.

get · iOS 27.0+

assetStatus

TypeScript
get assetStatus(): Promise<DownloadableAssetsRequestStatus>
Swift declaration
final var assetStatus: DownloadableAssetsRequestStatus { get async }

The current download status of the assets required by the request.

get · iOS 27.0+

qualityLevel

TypeScript
get qualityLevel(): GenerateIterativeSegmentationRequest_QualityLevel
Swift declaration
final var qualityLevel: GenerateIterativeSegmentationRequest.QualityLevel { get set }

Controls the resolution of the produced mask. Higher resolutions will produce a smoother mask. Lower resolutions will be faster.

set · iOS 27.0+

qualityLevel

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

Controls the resolution of the produced mask. Higher resolutions will produce a smoother mask. Lower resolutions will be faster.

method · iOS 27.0+

addExcludedPoint

TypeScript
addExcludedPoint(point: NormalizedPoint): void
Swift declaration
final func addExcludedPoint(_ point: NormalizedPoint) throws

Refines the mask with a point that is excluded from the desired segmentation. Throws an error if the total number of added points exceeds the limit. (13 points when seedPoint or seedScribbleBuffer was used, or 11 points when seedBox was used)

method · iOS 27.0+

addIncludedPoint

TypeScript
addIncludedPoint(point: NormalizedPoint): void
Swift declaration
final func addIncludedPoint(_ point: NormalizedPoint) throws

Refines the mask with a point that is part of the desired segmentation. Throws an error if the total number of added points exceeds the limit. (13 points when seedPoint or seedScribbleBuffer was used, or 11 points when seedBox was used)

get · iOS 27.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 27.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 27.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.

init · iOS 27.0+

init

TypeScript
static initSeedScribbleBuffer(seedScribbleBuffer: _CoreVideo_CVReadOnlyPixelBuffer, revision?: (GenerateIterativeSegmentationRequest_Revision) | null): GenerateIterativeSegmentationRequest
Swift declaration
init(seedScribbleBuffer: CVReadOnlyPixelBuffer, _ revision: GenerateIterativeSegmentationRequest.Revision? = nil)

Instantiates with a scribble buffer.

get · iOS 27.0+

supportedRevisions

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

The revisions supported by ``GenerateIterativeSegmentationRequest``.

get · iOS 27.0+

supportedComputeStageDevices

TypeScript
get supportedComputeStageDevices(): NativeMap<ComputeStage, Array<_CoreML_MLComputeDevice>>
Swift declaration
final var supportedComputeStageDevices: [ComputeStage : [MLComputeDevice]] { get }
init · iOS 27.0+

init

TypeScript
static initSeedBox(seedBox: NormalizedRect, revision?: (GenerateIterativeSegmentationRequest_Revision) | null): GenerateIterativeSegmentationRequest
Swift declaration
init(seedBox: NormalizedRect, _ revision: GenerateIterativeSegmentationRequest.Revision? = nil)

Instantiates with a seed box. No result will be produced if the box is outside the ``regionOfInterest``. By default, the ``regionOfInterest`` is the whole image.

get · iOS 27.0+

revision

TypeScript
get revision(): GenerateIterativeSegmentationRequest_Revision
Swift declaration
final let revision: GenerateIterativeSegmentationRequest.Revision

The request's configured revision.

init · iOS 27.0+

init

TypeScript
static initSeedPoint(seedPoint: NormalizedPoint, revision?: (GenerateIterativeSegmentationRequest_Revision) | null): GenerateIterativeSegmentationRequest
Swift declaration
init(seedPoint: NormalizedPoint, _ revision: GenerateIterativeSegmentationRequest.Revision? = nil)

Instantiates with a seed point. No result will be produced if the point is outside the ``regionOfInterest``. By default, the ``regionOfInterest`` is the whole image. This point is counted toward the total number of points that can be added.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

GenerateIterativeSegmentationRequest.downloadAssets(progress:)

The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'Subprogress' conform to 'Copyable'

All Vision types →