Skip to main content

useDetectObjects

@fovea/annotation-tool


@fovea/annotation-tool / hooks/useDetection / useDetectObjects

Function: useDetectObjects()

useDetectObjects(options?): UseMutationResult<DetectionResponse, ApiError, DetectionRequest, unknown>

Defined in: src/hooks/useDetection.ts:40

Mutation hook for detecting objects in video frames. Processes video frames and returns detected objects with bounding boxes.

Parameters

options?

UseMutationOptions<DetectionResponse, ApiError, DetectionRequest, unknown>

TanStack Mutation options

Returns

UseMutationResult<DetectionResponse, ApiError, DetectionRequest, unknown>

Mutation result with detect function

Example

const detectMutation = useDetectObjects({
onSuccess: (data) => {
console.log(`Found ${data.total_detections} objects`)
}
})

// Trigger detection
detectMutation.mutate({
videoId: 'video-123',
query: 'person wearing red shirt',
confidenceThreshold: 0.5
})