/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow } from "@workglow/task-graph"; import type { ImageValue } from "@workglow/util/media"; import { DataPortSchema } from "@workglow/util/schema"; import type { ModelConfig } from "../model/ModelSchema"; import { AiVisionTask } from "./base/AiVisionTask"; export declare const GestureRecognizerInputSchema: { readonly type: "object"; readonly properties: { readonly image: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; readonly model: { readonly oneOf: readonly [{ readonly title: "Model"; readonly description: `The model ${string}`; } & Record & { readonly format: import(".").TypeModelSemantic; readonly type: "string"; }, { readonly type: "object"; readonly properties: { readonly model_id: { readonly type: "string"; }; readonly capabilities: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly "x-ui-editor": "multiselect"; }; readonly title: { readonly type: "string"; }; readonly description: { readonly type: "string"; readonly "x-ui-editor": "textarea"; }; readonly provider: { readonly type: "string"; }; readonly provider_config: { readonly type: "object"; readonly properties: { readonly credential_key: { readonly type: "string"; readonly format: "credential"; readonly "x-ui-hidden": true; }; readonly native_dimensions: { readonly type: "integer"; readonly description: "Native output vector dimensions for embedding models"; }; readonly mrl: { readonly type: "boolean"; readonly description: "Whether the model supports Matryoshka Representation Learning"; }; }; readonly additionalProperties: true; readonly default: {}; }; readonly metadata: { readonly type: "object"; readonly default: {}; readonly "x-ui-hidden": true; }; }; readonly required: readonly ["provider", "provider_config"]; readonly format: "model"; readonly additionalProperties: true; } & Record & { readonly format: import(".").TypeModelSemantic; }]; } & Record & { readonly format: import(".").TypeModelSemantic; }; readonly numHands: { readonly type: "number"; readonly minimum: 1; readonly maximum: 10; readonly default: 1; readonly title: "Number of Hands"; readonly description: "The maximum number of hands to detect"; readonly "x-ui-group": "Configuration"; }; readonly minHandDetectionConfidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly default: 0.5; readonly title: "Min Hand Detection Confidence"; readonly description: "Minimum confidence score for hand detection"; readonly "x-ui-group": "Configuration"; }; readonly minHandPresenceConfidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly default: 0.5; readonly title: "Min Hand Presence Confidence"; readonly description: "Minimum confidence score for hand presence"; readonly "x-ui-group": "Configuration"; }; readonly minTrackingConfidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly default: 0.5; readonly title: "Min Tracking Confidence"; readonly description: "Minimum confidence score for hand tracking"; readonly "x-ui-group": "Configuration"; }; }; readonly required: readonly ["image", "model"]; readonly additionalProperties: false; }; export declare const GestureRecognizerOutputSchema: { readonly type: "object"; readonly properties: { readonly hands: { readonly oneOf: readonly [{ readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly gestures: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Gesture Label"; readonly description: "The recognized gesture (e.g., 'Thumb_Up', 'Victory', etc.)"; }; readonly score: { readonly type: "number"; readonly title: "Confidence Score"; readonly description: "Confidence score for the gesture"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Gestures"; readonly description: "Recognized gestures for this hand"; }; readonly handedness: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Hand Label"; readonly description: "Whether the hand is 'Left' or 'Right'"; }; readonly score: { readonly type: "number"; readonly title: "Confidence Score"; readonly description: "Confidence score for the handedness classification"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Handedness"; readonly description: "Handedness classification (left/right)"; }; readonly landmarks: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly x: { readonly type: "number"; readonly title: "X Coordinate"; readonly description: "X coordinate normalized to [0.0, 1.0]"; }; readonly y: { readonly type: "number"; readonly title: "Y Coordinate"; readonly description: "Y coordinate normalized to [0.0, 1.0]"; }; readonly z: { readonly type: "number"; readonly title: "Z Coordinate"; readonly description: "Z coordinate (depth)"; }; }; readonly required: readonly ["x", "y", "z"]; readonly format: "point:3d:relative"; readonly additionalProperties: false; }; readonly title: "Landmarks"; readonly description: "21 hand landmarks in image coordinates"; readonly format: "points:3d:relative"; }; readonly worldLandmarks: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly x: { readonly type: "number"; readonly title: "X Coordinate"; readonly description: "X coordinate normalized to [0.0, 1.0]"; }; readonly y: { readonly type: "number"; readonly title: "Y Coordinate"; readonly description: "Y coordinate normalized to [0.0, 1.0]"; }; readonly z: { readonly type: "number"; readonly title: "Z Coordinate"; readonly description: "Z coordinate (depth)"; }; }; readonly required: readonly ["x", "y", "z"]; readonly format: "point:3d:relative"; readonly additionalProperties: false; }; readonly title: "World Landmarks"; readonly description: "21 hand landmarks in 3D world coordinates (meters)"; readonly format: "points:3d:meters"; }; }; readonly required: readonly ["gestures", "handedness", "landmarks", "worldLandmarks"]; readonly additionalProperties: false; }; }, { readonly type: "array"; readonly items: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly gestures: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Gesture Label"; readonly description: "The recognized gesture (e.g., 'Thumb_Up', 'Victory', etc.)"; }; readonly score: { readonly type: "number"; readonly title: "Confidence Score"; readonly description: "Confidence score for the gesture"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Gestures"; readonly description: "Recognized gestures for this hand"; }; readonly handedness: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Hand Label"; readonly description: "Whether the hand is 'Left' or 'Right'"; }; readonly score: { readonly type: "number"; readonly title: "Confidence Score"; readonly description: "Confidence score for the handedness classification"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Handedness"; readonly description: "Handedness classification (left/right)"; }; readonly landmarks: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly x: { readonly type: "number"; readonly title: "X Coordinate"; readonly description: "X coordinate normalized to [0.0, 1.0]"; }; readonly y: { readonly type: "number"; readonly title: "Y Coordinate"; readonly description: "Y coordinate normalized to [0.0, 1.0]"; }; readonly z: { readonly type: "number"; readonly title: "Z Coordinate"; readonly description: "Z coordinate (depth)"; }; }; readonly required: readonly ["x", "y", "z"]; readonly format: "point:3d:relative"; readonly additionalProperties: false; }; readonly title: "Landmarks"; readonly description: "21 hand landmarks in image coordinates"; readonly format: "points:3d:relative"; }; readonly worldLandmarks: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly x: { readonly type: "number"; readonly title: "X Coordinate"; readonly description: "X coordinate normalized to [0.0, 1.0]"; }; readonly y: { readonly type: "number"; readonly title: "Y Coordinate"; readonly description: "Y coordinate normalized to [0.0, 1.0]"; }; readonly z: { readonly type: "number"; readonly title: "Z Coordinate"; readonly description: "Z coordinate (depth)"; }; }; readonly required: readonly ["x", "y", "z"]; readonly format: "point:3d:relative"; readonly additionalProperties: false; }; readonly title: "World Landmarks"; readonly description: "21 hand landmarks in 3D world coordinates (meters)"; readonly format: "points:3d:meters"; }; }; readonly required: readonly ["gestures", "handedness", "landmarks", "worldLandmarks"]; readonly additionalProperties: false; }; }; }]; readonly title: "Hand Detections"; readonly description: "Detected hands with gestures, handedness, and landmarks"; }; }; readonly required: readonly ["hands"]; readonly additionalProperties: false; }; export type GestureRecognizerTaskInput = Omit<{ minTrackingConfidence?: number | undefined; numHands?: number | undefined; minHandDetectionConfidence?: number | undefined; minHandPresenceConfidence?: number | undefined; model: string | ModelConfig; image: string | { [x: string]: unknown; }; }, "image"> & { image: ImageValue; }; export type GestureRecognizerTaskOutput = { hands: { landmarks: { x: number; y: number; z: number; }[]; gestures: { score: number; label: string; }[]; handedness: { score: number; label: string; }[]; worldLandmarks: { x: number; y: number; z: number; }[]; }[] | { landmarks: { x: number; y: number; z: number; }[]; gestures: { score: number; label: string; }[]; handedness: { score: number; label: string; }[]; worldLandmarks: { x: number; y: number; z: number; }[]; }[][]; }; export type GestureRecognizerTaskConfig = TaskConfig; /** * Recognizes hand gestures in images using MediaPipe Gesture Recognizer. * Detects hand landmarks, identifies gestures (like thumbs up, victory sign, etc.), * and classifies left vs. right hands. */ export declare class GestureRecognizerTask extends AiVisionTask { static type: string; /** Capabilities required of the model; gated in {@link AiTask.execute}. */ static readonly requires: ["vision.gesture"]; static category: string; static title: string; static description: string; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; } export declare const gestureRecognizer: (input: GestureRecognizerTaskInput, config?: GestureRecognizerTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { gestureRecognizer: CreateWorkflow; } } //# sourceMappingURL=GestureRecognizerTask.d.ts.map