<br />

Performs hand gesture recognition on images.

**Signature:**

    export declare class GestureRecognizer extends VisionTaskRunner 

## Properties

| Property | Modifiers | Type | Description |
|---|---|---|---|
| [HAND_CONNECTIONS](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizerhand_connections) | `static` | Connection\[\] | An array containing the pairs of hand landmark indices to be rendered with connections. |

## Methods

| Method | Modifiers | Description |
|---|---|---|
| [createFromOptions(wasmFileset, gestureRecognizerOptions)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizercreatefromoptions) | `static` | Initializes the Wasm runtime and creates a new gesture recognizer from the provided options. |
| [createFromModelBuffer(wasmFileset, modelAssetBuffer)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizercreatefrommodelbuffer) | `static` | Initializes the Wasm runtime and creates a new gesture recognizer based on the provided model asset buffer. |
| [createFromModelPath(wasmFileset, modelAssetPath)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizercreatefrommodelpath) | `static` | Initializes the Wasm runtime and creates a new gesture recognizer based on the path to the model asset. |
| [setOptions(options)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizersetoptions) |   | Sets new options for the gesture recognizer. Calling `setOptions()` with a subset of options only affects those options. You can reset an option back to its default value by explicitly setting it to `undefined`. |
| [recognize(image, imageProcessingOptions)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizerrecognize) |   | Performs gesture recognition on the provided single image and waits synchronously for the response. Only use this method when the GestureRecognizer is created with running mode `image`. |
| [recognizeForVideo(videoFrame, timestamp, imageProcessingOptions)](https://developers.google.com/edge/api/mediapipe/js/tasks-vision.gesturerecognizer#gesturerecognizerrecognizeforvideo) |   | Performs gesture recognition on the provided video frame and waits synchronously for the response. Only use this method when the GestureRecognizer is created with running mode `video`. |

## GestureRecognizer.HAND_CONNECTIONS {#gesturerecognizerhand_connections}

An array containing the pairs of hand landmark indices to be rendered with connections.

**Signature:**

    static HAND_CONNECTIONS: Connection[];

## GestureRecognizer.createFromOptions() {#gesturerecognizercreatefromoptions}

Initializes the Wasm runtime and creates a new gesture recognizer from the provided options.

**Signature:**

    static createFromOptions(wasmFileset: WasmFileset, gestureRecognizerOptions: GestureRecognizerOptions): Promise<GestureRecognizer>;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| wasmFileset | WasmFileset | A configuration object that provides the location of the Wasm binary and its loader. |
| gestureRecognizerOptions | GestureRecognizerOptions | The options for the gesture recognizer. Note that either a path to the model asset or a model buffer needs to be provided (via `baseOptions`). |

**Returns:**

Promise\<GestureRecognizer\>

## GestureRecognizer.createFromModelBuffer() {#gesturerecognizercreatefrommodelbuffer}

Initializes the Wasm runtime and creates a new gesture recognizer based on the provided model asset buffer.

**Signature:**

    static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array | ReadableStreamDefaultReader): Promise<GestureRecognizer>;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| wasmFileset | WasmFileset | A configuration object that provides the location of the Wasm binary and its loader. |
| modelAssetBuffer | Uint8Array \| ReadableStreamDefaultReader | An array or a stream containing a binary representation of the model. |

**Returns:**

Promise\<GestureRecognizer\>

## GestureRecognizer.createFromModelPath() {#gesturerecognizercreatefrommodelpath}

Initializes the Wasm runtime and creates a new gesture recognizer based on the path to the model asset.

**Signature:**

    static createFromModelPath(wasmFileset: WasmFileset, modelAssetPath: string): Promise<GestureRecognizer>;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| wasmFileset | WasmFileset | A configuration object that provides the location of the Wasm binary and its loader. |
| modelAssetPath | string | The path to the model asset. |

**Returns:**

Promise\<GestureRecognizer\>

## GestureRecognizer.setOptions() {#gesturerecognizersetoptions}

Sets new options for the gesture recognizer. Calling `setOptions()` with a subset of options only affects those options. You can reset an option back to its default value by explicitly setting it to `undefined`.

**Signature:**

    setOptions(options: GestureRecognizerOptions): Promise<void>;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| options | GestureRecognizerOptions | The options for the gesture recognizer. |

**Returns:**

Promise\<void\>

## GestureRecognizer.recognize() {#gesturerecognizerrecognize}

Performs gesture recognition on the provided single image and waits synchronously for the response. Only use this method when the GestureRecognizer is created with running mode `image`.

**Signature:**

    recognize(image: ImageSource, imageProcessingOptions?: ImageProcessingOptions): GestureRecognizerResult;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| image | ImageSource | A single image to process. |
| imageProcessingOptions | ImageProcessingOptions | the `ImageProcessingOptions` specifying how to process the input image before running inference. |

**Returns:**

GestureRecognizerResult

## GestureRecognizer.recognizeForVideo() {#gesturerecognizerrecognizeforvideo}

Performs gesture recognition on the provided video frame and waits synchronously for the response. Only use this method when the GestureRecognizer is created with running mode `video`.

**Signature:**

    recognizeForVideo(videoFrame: ImageSource, timestamp: number, imageProcessingOptions?: ImageProcessingOptions): GestureRecognizerResult;

### Parameters

| Parameter | Type | Description |
|---|---|---|
| videoFrame | ImageSource | A video frame to process. |
| timestamp | number | The timestamp of the current frame, in ms. |
| imageProcessingOptions | ImageProcessingOptions | the `ImageProcessingOptions` specifying how to process the input image before running inference. |

**Returns:**

GestureRecognizerResult