Skip to content

daveyjones/react-native-vision-camera-text-recognition

ย 
ย 

Repository files navigation

react-native-vision-camera-text-recognition

A plugin to Scanning Text,Translate using ML Kit Text Recognition and ML Kit Translation. With High Performance and many features.

๐Ÿšจ Required Modules

react-native-vision-camera = 4.0.5
react-native-worklets-core = 1.3.3

๐Ÿ’ป Installation

npm install react-native-vision-camera-text-recognition
yarn add react-native-vision-camera-text-recognition

๐Ÿ‘ทFeatures

Easy To Use.
Works Just Writing few lines of Code.
Works With React Native Vision Camera.
Works for Both Cameras.
Works Fast.
Works With Android ๐Ÿค– and IOS.๐Ÿ“ฑ
Writen With Kotlin and Swift.
Can translate text. ๐ŸŒ

๐Ÿ’ก Usage

import React, { useState } from 'react'
import { useCameraDevice } from 'react-native-vision-camera'
import { Camera } from 'react-native-vision-camera-text-recognition';

function App (){
  const [data,setData] = useState(null)
  const device = useCameraDevice('back');
  console.log(data)
  return(
    <>
      {!!device && (
        <Camera
          style={StyleSheet.absoluteFill}
          device={device}
          isActive
          options={{
            language: 'latin',
            mode: 'translate',
            from: 'english',
            to: 'german'
          }}
          callback={(d) => setData(d)}
        />
      )}
    </>
  )
}

export default App;

Also You Can Use Like This

import React from 'react';
import { StyleSheet } from "react-native";
import {
  Camera,
  useCameraDevice,
  useFrameProcessor,
} from "react-native-vision-camera";
import { useTextRecognition } from "react-native-vision-camera-text-recognition";

function App() {
  const device = useCameraDevice('back');
  const options = { language : 'latin', mode: 'recognize' }
  const {scanText} = useTextRecognition(options)
  const frameProcessor = useFrameProcessor((frame) => {
    'worklet'
    const data = scanText(frame)
    console.log(data, 'data')
  }, [])
  return (
    <>
      {!!device && (
        <Camera
          style={StyleSheet.absoluteFill}
          device={device}
          isActive
          frameProcessor={frameProcessor}
        />
      )}
    </>
  );
}
export default App;

โš™๏ธ Options

Name Type Values Default
language string latin, chinese, devanagari, japanese, korean latin
mode string recognize, translate recognize
from,to string See Below english,german

Afrikaans: ๐Ÿ‡ฟ๐Ÿ‡ฆ, ๐Ÿ‡จ๐Ÿ‡ซ

Albanian: ๐Ÿ‡ฆ๐Ÿ‡ฑ

Arabic: ๐Ÿ‡ฆ๐Ÿ‡ช, ๐Ÿ‡ธ๐Ÿ‡ฆ

Belarusian: ๐Ÿ‡ง๐Ÿ‡พ

Bulgarian: ๐Ÿ‡ง๐Ÿ‡ฌ

Bengali: ๐Ÿ‡ง๐Ÿ‡ฉ, ๐Ÿ‡ฎ๐Ÿ‡ณ

Catalan: ๐Ÿ‡ช๐Ÿ‡ธ, ๐Ÿ‡ฆ๐Ÿ‡ฉ

Czech: ๐Ÿ‡จ๐Ÿ‡ฟ

Welsh: ๐Ÿด

Danish: ๐Ÿ‡ฉ๐Ÿ‡ฐ

German: ๐Ÿ‡ฉ๐Ÿ‡ช

Greek: ๐Ÿ‡ฌ๐Ÿ‡ท

English: ๐Ÿ‡ฌ๐Ÿ‡ง, ๐Ÿ‡บ๐Ÿ‡ธ

Esperanto: ๐ŸŒ

Spanish: ๐Ÿ‡ช๐Ÿ‡ธ

Estonian: ๐Ÿ‡ช๐Ÿ‡ช

Persian: ๐Ÿ‡ฎ๐Ÿ‡ท, ๐Ÿ‡ฆ๐Ÿ‡ซ

Finnish: ๐Ÿ‡ซ๐Ÿ‡ฎ

French: ๐Ÿ‡ซ๐Ÿ‡ท

Irish: ๐Ÿ‡ฎ๐Ÿ‡ช

Galician: ๐Ÿ‡ช๐Ÿ‡ธ

Gujarati: ๐Ÿ‡ฎ๐Ÿ‡ณ

Hebrew: ๐Ÿ‡ฎ๐Ÿ‡ฑ

Hindi: ๐Ÿ‡ฎ๐Ÿ‡ณ

Croatian: ๐Ÿ‡ญ๐Ÿ‡ท

Haitian: ๐Ÿ‡ญ๐Ÿ‡น

Hungarian: ๐Ÿ‡ญ๐Ÿ‡บ

Indonesian: ๐Ÿ‡ฎ๐Ÿ‡ฉ

Icelandic: ๐Ÿ‡ฎ๐Ÿ‡ธ

Italian: ๐Ÿ‡ฎ๐Ÿ‡น

Japanese: ๐Ÿ‡ฏ๐Ÿ‡ต

Georgian: ๐Ÿ‡ฌ๐Ÿ‡ช

Canada: ๐Ÿ‡จ๐Ÿ‡ฆ

Korean: ๐Ÿ‡ฐ๐Ÿ‡ท, ๐Ÿ‡ฐ๐Ÿ‡ต

Lithuanian: ๐Ÿ‡ฑ๐Ÿ‡น

Latvian: ๐Ÿ‡ฑ๐Ÿ‡ป

Macedonian: ๐Ÿ‡ฒ๐Ÿ‡ฐ

Marathi: ๐Ÿ‡ฎ๐Ÿ‡ณ

Malay: ๐Ÿ‡ฒ๐Ÿ‡พ, ๐Ÿ‡ธ๐Ÿ‡ฌ

Maltese: ๐Ÿ‡ฒ๐Ÿ‡น

Dutch: ๐Ÿ‡ณ๐Ÿ‡ฑ, ๐Ÿ‡ง๐Ÿ‡ช

Norwegian: ๐Ÿ‡ณ๐Ÿ‡ด

Polish: ๐Ÿ‡ต๐Ÿ‡ฑ

Portuguese: ๐Ÿ‡ต๐Ÿ‡น

Romanian: ๐Ÿ‡ท๐Ÿ‡ด

Russian: ๐Ÿ‡ท๐Ÿ‡บ

Slovak: ๐Ÿ‡ธ๐Ÿ‡ฐ

Slovenian: ๐Ÿ‡ธ๐Ÿ‡ฎ

Swedish: ๐Ÿ‡ธ๐Ÿ‡ช, ๐Ÿ‡ซ๐Ÿ‡ฎ

Swahili: ๐Ÿ‡ฐ๐Ÿ‡ช, ๐Ÿ‡น๐Ÿ‡ฟ

Tamil: ๐Ÿ‡ฎ๐Ÿ‡ณ, ๐Ÿ‡ฑ๐Ÿ‡ฐ

Telugu: ๐Ÿ‡ฎ๐Ÿ‡ณ

Thai: ๐Ÿ‡น๐Ÿ‡ญ

Tagalog: ๐Ÿ‡ต๐Ÿ‡ญ

Turkish: ๐Ÿ‡น๐Ÿ‡ท

Ukrainian: ๐Ÿ‡บ๐Ÿ‡ฆ

Urdu: ๐Ÿ‡ต๐Ÿ‡ฐ, ๐Ÿ‡ฎ๐Ÿ‡ณ

Vietnamese: ๐Ÿ‡ป๐Ÿ‡ณ

Chinese: ๐Ÿ‡จ๐Ÿ‡ณ

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 39.3%
  • Swift 37.2%
  • TypeScript 16.0%
  • Objective-C++ 3.6%
  • Ruby 3.3%
  • Objective-C 0.4%
  • JavaScript 0.2%