Skip to content

pedrol2b/react-native-vision-camera-mlkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

react-native-vision-camera-mlkit

Contributors Forks Stargazers Issues MIT License

πŸ“¦ A Google ML Kit frame processor plugin for react-native-vision-camera.

This plugin provides a simple way to use various ML Kit Vision APIs in your React Native App's Frame processor.

⚠️ This plugin is still in development and not yet ready for iOS.

🧡 Vision APIs Roadmap

This roadmap provides an overview of the progress for implementing various ML Kit Vision APIs. Note that all completed items are currently only available for Android. iOS support is still in development.

# APIs Android iOS
1 Barcode scanning done in-progress
2 Face detection not-started not-started
3 Face mesh detection not-started not-supported
4 Text recognition v2 done in-progress
5 Image labeling done in-progress
6 Object detection and tracking done in-progress
7 Digital ink recognition not-started not-started
8 Pose detection not-started not-started
9 Selfie segmentation not-started not-started
10 Subject segmentation not-started not-supported
11 Document scanner not-started not-supported

πŸ’¬ Video and image analysis APIs to label images and detect barcodes, text, faces, and objects.

Scan and process barcodes. Supports most standard 1D and 2D formats.

Detect faces and facial landmarks.

Detect face mesh info on close-range images.

Recognize and extract text from images.

Identify objects, locations, activities, animal species, products, and more. Use a general-purpose base model or tailor to your use case with a custom TensorFlow Lite model.

Localize and track in real time one or more objects in the live camera feed.

Recognizes handwritten text and handdrawn shapes on a digital surface, such as a touch screen. Recognizes 300+ languages, emojis and basic shapes.

Detect the position of the human body in real time.

Separate the background from users within a scene and focus on what matters.

Separate subjects (people, pets, or objects) from the background in a picture.

Digitize physical documents from pictures.

πŸš€ Getting Started

🚨 Required Dependencies

Ensure you have installed the required packages before installing this plugin.

# Package Version
1 react-native-vision-camera >=4.0.1
2 react-native-worklets-core >=1.2.0

Follow the installation instructions for each package.

πŸ’» Installation

To install the plugin, run:

npm install react-native-vision-camera-mlkit
# or
yarn add react-native-vision-camera-mlkit

πŸͺ Hooks

useBarcodeScanner (Barcode scanning)

  const { barcodeScanner } = useBarcodeScanner();

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

      runAsync(frame, () => {
        'worklet';

        const barcodes = barcodeScanner(frame);
        console.log(barcodes);
      });
    },
    [barcodeScanner]
  );

useImageLabeler (Image labeling)

  const { imageLabeler } = useImageLabeler();

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

      runAsync(frame, () => {
        'worklet';

        const labels = imageLabeler(frame);
        console.log(labels);
      });
    },
    [imageLabeler]
  );

useObjectDetector (Object detection and tracking)

  const { objectDetector } = useObjectDetector();

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

      runAsync(frame, () => {
        'worklet';

        const objects = objectDetector(frame);
        console.log(objects);
      });
    },
    [objectDetector]
  );

useTextRecognizer (Text recognition v2)

  const { textRecognizer } = useTextRecognizer();

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

      runAsync(frame, () => {
        'worklet';

        const text = textRecognizer(frame);
        console.log(text);
      });
    },
    [textRecognizer]
  );