@ashleysmart/react-native-vision-camera-face-detector
Version:
Frame Processor Plugin to detect faces using MLKit Vision Face Detector for React Native Vision Camera!
29 lines (27 loc) • 703 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.detectFaces = detectFaces;
var _reactNativeVisionCamera = require("@ashleysmart/react-native-vision-camera");
const plugin = _reactNativeVisionCamera.VisionCameraProxy.initFrameProcessorPlugin('detectFaces', {});
/**
* Detect faces on frame
*
* @param {DetectFacesType} props Detect faces prop
*/
function detectFaces({
frame,
callback,
options
}) {
'worklet';
if (!plugin) {
throw new Error('Failed to load Frame Processor Plugin "detectFaces"!');
}
// @ts-ignore
const result = plugin.call(frame, options);
callback?.(result);
return result;
}
//# sourceMappingURL=FaceDetector.js.map