/** * @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 FaceLandmarkerInputSchema: { 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 numFaces: { readonly type: "number"; readonly minimum: 1; readonly maximum: 10; readonly default: 1; readonly title: "Number of Faces"; readonly description: "The maximum number of faces to detect"; readonly "x-ui-group": "Configuration"; }; readonly minFaceDetectionConfidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly default: 0.5; readonly title: "Min Face Detection Confidence"; readonly description: "Minimum confidence score for face detection"; readonly "x-ui-group": "Configuration"; }; readonly minFacePresenceConfidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly default: 0.5; readonly title: "Min Face Presence Confidence"; readonly description: "Minimum confidence score for face 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 face tracking"; readonly "x-ui-group": "Configuration"; }; readonly outputFaceBlendshapes: { readonly type: "boolean"; readonly default: false; readonly title: "Output Face Blendshapes"; readonly description: "Whether to output blendshape coefficients for facial expressions"; readonly "x-ui-group": "Configuration"; }; readonly outputFacialTransformationMatrixes: { readonly type: "boolean"; readonly default: false; readonly title: "Output Facial Transformation Matrix"; readonly description: "Whether to output transformation matrix for effects rendering"; readonly "x-ui-group": "Configuration"; }; }; readonly required: readonly ["image", "model"]; readonly additionalProperties: false; }; export declare const FaceLandmarkerOutputSchema: { readonly type: "object"; readonly properties: { readonly faces: { readonly oneOf: readonly [{ readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { 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: "478 facial landmarks in image coordinates"; readonly format: "points:3d:relative"; }; readonly blendshapes: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Blendshape Label"; readonly description: "Name of the blendshape (e.g., 'browDownLeft', 'eyeBlinkRight', etc.)"; }; readonly score: { readonly type: "number"; readonly title: "Coefficient Value"; readonly description: "Coefficient value for this blendshape"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Blendshapes"; readonly description: "52 blendshape coefficients representing facial expressions"; }; readonly transformationMatrix: { readonly type: "array"; readonly items: { readonly type: "number"; }; readonly minItems: 16; readonly maxItems: 16; readonly title: "Transformation Matrix"; readonly description: "4x4 transformation matrix for face effects rendering"; }; }; readonly required: readonly ["landmarks"]; readonly additionalProperties: false; }; }, { readonly type: "array"; readonly items: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { 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: "478 facial landmarks in image coordinates"; readonly format: "points:3d:relative"; }; readonly blendshapes: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Blendshape Label"; readonly description: "Name of the blendshape (e.g., 'browDownLeft', 'eyeBlinkRight', etc.)"; }; readonly score: { readonly type: "number"; readonly title: "Coefficient Value"; readonly description: "Coefficient value for this blendshape"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Blendshapes"; readonly description: "52 blendshape coefficients representing facial expressions"; }; readonly transformationMatrix: { readonly type: "array"; readonly items: { readonly type: "number"; }; readonly minItems: 16; readonly maxItems: 16; readonly title: "Transformation Matrix"; readonly description: "4x4 transformation matrix for face effects rendering"; }; }; readonly required: readonly ["landmarks"]; readonly additionalProperties: false; }; }; }]; readonly title: "Face Detections"; readonly description: "Detected faces with landmarks, blendshapes, and transformation matrices"; }; }; readonly required: readonly ["faces"]; readonly additionalProperties: false; }; export type FaceLandmarkerTaskInput = Omit<{ numFaces?: number | undefined; minFaceDetectionConfidence?: number | undefined; minFacePresenceConfidence?: number | undefined; minTrackingConfidence?: number | undefined; outputFaceBlendshapes?: boolean | undefined; outputFacialTransformationMatrixes?: boolean | undefined; model: string | ModelConfig; image: string | { [x: string]: unknown; }; }, "image"> & { image: ImageValue; }; export type FaceLandmarkerTaskOutput = { faces: { blendshapes?: { score: number; label: string; }[] | undefined; transformationMatrix?: number[] | undefined; landmarks: { x: number; y: number; z: number; }[]; }[] | { blendshapes?: { score: number; label: string; }[] | undefined; transformationMatrix?: number[] | undefined; landmarks: { x: number; y: number; z: number; }[]; }[][]; }; export type FaceLandmarkerTaskConfig = TaskConfig; /** * Detects facial landmarks and expressions in images using MediaPipe Face Landmarker. * Identifies 478 facial landmarks, 52 blendshape coefficients for expressions, * and provides transformation matrices for AR effects. */ export declare class FaceLandmarkerTask extends AiVisionTask { static type: string; /** Capabilities required of the model; gated in {@link AiTask.execute}. */ static readonly requires: ["vision.face-landmarks"]; static category: string; static title: string; static description: string; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; } export declare const faceLandmarker: (input: FaceLandmarkerTaskInput, config?: FaceLandmarkerTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { faceLandmarker: CreateWorkflow; } } //# sourceMappingURL=FaceLandmarkerTask.d.ts.map