0.2.1 • Published 6 years ago

react-native-cloud-vision-api v0.2.1

Weekly downloads
5
License
-
Repository
github
Last release
6 years ago

Node Cloud Vision API

react-cloud-vision-api is a react client wrapper for Cloud Vision API. This package is modification of https://www.npmjs.com/package/node-cloud-vision-api package.

Cloud Vision API Docs https://cloud.google.com/vision/docs/

Note that it has limited features and tested only in scope of project.

Supported features

Feature TypeDescription
FACE_DETECTIONRun face detection
LANDMARK_DETECTIONRun models to execute landmark detection
LOGO_DETECTIONRun models to execute product logo detection
LABEL_DETECTIONRun models to execute Image Content Analysis
TEXT_DETECTIONRun models to execute OCR on an image
SAFE_SEARCH_DETECTIONRun models to compute image safe search properties

Setup

Preparation

Install

npm install react-cloud-vision-api --save

Auth

API requests on node-cloud-vision-api is internally managed by google-api-nodejs-client

You can setup auth data with the following samples

  • Use Server Key
import vision from "react-cloud-vision-api";
vision.init({ auth: 'YOUR_API_KEY'})

Sample

const vision = require('react-cloud-vision-api')
vision.init({auth: 'YOUR_API_KEY'})
const req = new vision.Request({
  image: new vision.Image({
    base64: base64Img,
  }),
  features: [
    new vision.Feature('TEXT_DETECTION', 4),
    new vision.Feature('LABEL_DETECTION', 10),
  ]
})