Class

VNRequest

The abstract superclass for analysis requests.

Declaration

@interface VNRequest : NSObject

Overview

Other Vision request handlers that perform image analysis inherit from this abstract base class. Instantiate one of its subclasses to perform image analysis.

Topics

Initializing a Request

- init

Creates a new Vision request with no completion handler.

- initWithCompletionHandler:

Creates a new Vision request with an optional completion handler.

Configuring a Request

completionHandler

The completion handler block that's invoked after the request has finished processing.

preferBackgroundProcessing

A hint to minimize the resource burden of the request.

results

The collection of VNObservation results generated by request processing.

usesCPUOnly

A Boolean signifying that the Vision request should execute exclusively on the CPU.

revision

The specific algorithm or implementation revision that is to be used to perform the request.

Canceling a Request

- cancel

Cancels the request before it can finish executing.

Beta

Executing a Completion Handler

VNRequestCompletionHandler

A type alias to encapsulate the syntax for the completion handler block that's invoked after the request has finished processing.

Determining the Revision

VNRequestRevisionProviding

A protocol for specifying the revision number of Vision algorithms.

currentRevision

The current revison supported by the request.

defaultRevision

The revision of the latest request for the particular SDK linked with the client application.

supportedRevisions

The collection of currently-supported algorithm versions for the class of request.

Relationships

Inherits From

Conforms To

See Also

Still Image Analysis

Detecting Objects in Still Images

Locate and demarcate rectangles, faces, barcodes, and text in images using the Vision framework.

VNImageRequestHandler

An object that processes one or more image analysis requests pertaining to a single image.

VNImageBasedRequest

The abstract superclass for image analysis requests that focus on a specific part of an image.

VNClassifyImageRequest

A request to classify an image.

Beta
VNGenerateImageFeaturePrintRequest

An image-based request to generate feature prints from an image.

Beta
VNObservation

The abstract superclass for analysis results.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software