const frameProcessor = useFrameProcessor((frame) => { 'worklet'; // CRUCIAL: Marks this function as a worklet runAsync(frame, () => { 'worklet'; const faces = detectFaces(frame); runOnJS(setDetectedFaces)(faces); runOnJS(console.log)('Detected faces:', faces.length); }); }, [detectFaces]) I have tried in the way you suggested but does got my answer. please help!