1

I tried firebase ml kit and got error this TypeError: (0 , _ml.default)(...).cloudDocumentTextRecognizerProcessImage is not a function

const onPressActionGallery = () => {
    ImagePicker.openPicker({
      cropping: true,
      includeBase64: true,
    })
      .then(async image => {
        const tempPhoto = [...uploadData.photo];
        const photoIndex = tempPhoto.findIndex(
          photo => photo.path === image.path,
        );
        if (photoIndex !== -1) {
          tempPhoto.splice(photoIndex, 1);
        } else {
          tempPhoto.push(image);
        }
        setUploadData(prev => {
          return {
            ...prev,
            photo: tempPhoto,
          };
        });
        const processingResult =
          await ml().cloudDocumentTextRecognizerProcessImage(tempPhoto);
        console.log(processingResult, 'processingResult');
      })
      .catch(err => console.log(err, 'err'));
  };
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

1

You can use on-device text recognition based on ML Kit https://github.com/a7medev/react-native-ml-kit/tree/main/text-recognition

Kirill Novikov
  • 2,576
  • 4
  • 20
  • 33