New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-vision-camera-detect-faces-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-vision-camera-detect-faces-plugin

detect face plugin for react-native-vision-camera

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-vision-camera-detect-faces-plugin

detect face plugin for react-native-vision-camera

Prequisites

Install react-native-vision-camera and react-native-worklets-core

npm install react-native-vision-camera react-native-worklets-core

or using yarn

yarn add react-native-vision-camera react-native-worklets-core

Please refer to this Documentation and follow the installation instructions.

Installation

npm install react-native-vision-camera-detect-faces-plugin

or using yarn

yarn add react-native-vision-camera-detect-faces-plugin

Usage

import React, { useEffect, useRef } from 'react';
import {
  Camera,
  useCameraDevice,
  useCameraPermission,
  useFrameProcessor
} from 'react-native-vision-camera';
import { detectFaces } from 'react-native-vision-camera-detect-faces-plugin';

// ...

const cameraRef = useRef<Camera>(null);

const { hasPermission, requestPermission } = useCameraPermission();
const cameraDevice = useCameraDevice('front');

const frameProcessor = useFrameProcessor((frame) => {
  'worklet';
  const faces = detectFaces(frame);

  if (faces.length > 0) {
    console.log(`faces in frame: ${faces[0].smilingProbability}`);
  }
}, []);

useEffect(() => {
  if (hasPermission) return;
  requestPermission();
}, []);

return (
  <Camera
    ref={cameraRef}
    style={StyleSheet.absoluteFill}
    isActive={true}
    device={cameraDevice}
    photo={true}
    frameProcessor={frameProcessor}
  />
);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Keywords

FAQs

Package last updated on 15 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc