1.4.0 • Published 4 months ago

vision-camera-trustee-face-detector-v3 v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

vision-camera-trustee-face-detector-v3

GitHub license npm version

Description

vision-camera-trustee-face-detector-v3 is a React Native library that integrates with the Vision Camera module to provide face detection functionality. It allows you to easily detect faces in real-time using the front camera and visualize the detected faces on the screen.

Features

  • Real-time face detection using the front camera
  • Integration with the Vision Camera module
  • Adjustable face visualization with customizable styles
  • Convert frame to base64

Installation

yarn add vision-camera-trustee-face-detector-v3

Usage

import { StyleSheet, Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import {
  Camera,
  useCameraDevice,
  useFrameProcessor,
} from 'react-native-vision-camera';
import { scanFaces } from 'vision-camera-trustee-face-detector-v3';
import { Worklets } from 'react-native-worklets-core';

export default function App() {
  const device = useCameraDevice('front');

  React.useEffect(() => {
    (async () => {
      const status = await Camera.requestCameraPermission();
      console.log({ status });
    })();
  }, [device]);

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

    try {
      const scannedFaces = scanFaces(frame, {});
      console.log(scannedFaces?.faces);
    } catch (error) {
      console.error({ error });
    }
  }, []);

  if (device == null) return <Text>No Device</Text>;
  if (device) {
    return (
      <View style={{ position: 'relative', flex: 1 }}>
        <Camera
          style={StyleSheet.absoluteFill}
          device={device}
          isActive={!!device}
          frameProcessor={frameProcessor}
          //pixel format should be either yuv or rgb
          pixelFormat="yuv"
        />
      </View>
    );
  }
}
1.4.0

4 months ago

1.2.0

4 months ago

1.1.29

4 months ago

1.1.28

4 months ago

1.2.8

4 months ago

1.2.7

4 months ago

1.3.5

4 months ago

1.2.6

4 months ago

1.3.4

4 months ago

1.2.5

4 months ago

1.3.3

4 months ago

1.2.4

4 months ago

1.3.2

4 months ago

1.2.3

4 months ago

1.3.1

4 months ago

1.2.2

4 months ago

1.3.0

4 months ago

1.2.1

4 months ago

1.1.30

4 months ago

1.1.33

4 months ago

1.1.32

4 months ago

1.1.31

4 months ago

1.2.9

4 months ago

1.1.27

4 months ago

1.1.9

4 months ago

1.1.8

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.5

4 months ago

1.1.4

4 months ago

1.1.3

4 months ago

1.1.12

4 months ago

1.1.11

4 months ago

1.1.10

4 months ago

1.1.16

4 months ago

1.1.15

4 months ago

1.1.14

4 months ago

1.1.13

4 months ago

1.1.19

4 months ago

1.1.18

4 months ago

1.1.17

4 months ago

1.1.22

4 months ago

1.1.21

4 months ago

1.1.20

4 months ago

1.1.26

4 months ago

1.1.25

4 months ago

1.1.2

4 months ago