webgpu-cluster / src /detection /workerMessages.ts
apssouza22's picture
Deploy GPU detection cluster (Docker Space)
4bdf735 verified
Raw
History Blame Contribute Delete
457 Bytes
import type {ObjectDetectionOutput} from '@huggingface/transformers';
export type DetectionResult = ObjectDetectionOutput[number];
export type WorkerRequest =
| {type: 'init'}
| {type: 'detect'; id: number; threshold: number; frame: VideoFrame};
export type WorkerResponse =
| {type: 'status'; message: string}
| {type: 'ready'}
| {type: 'detect-result'; id: number; results: DetectionResult[]}
| {type: 'error'; error: string; id?: number};