Giter Site home page Giter Site logo

node-cloud-vision-api's People

Contributors

comoc avatar kroleg avatar tejitak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-cloud-vision-api's Issues

Language Hint as paramater to TEXT DETECTION

Hi, The code is working fine , can you please tell me how to send Langauge hint as paramter to TEXT DETECTION so that it can detect other languages also , now its only detecting english.

UTF-8 characters

I don't know if it is an issue with google vision API, but the returned characters are in western subset only while correct locale is detected

client modules not found.

I am getting the errors:
Uncaught Error: Cannot find module './lib/clients/v1'
and
Uncaught Error: Cannot find module './lib/clients/v1alpha1'
when trying to require in each of the different branches.

The errors are coming from the following line in node-cloud-vision-app/index.js:
const Endpoint = require('./lib/clients/' + options.version)

Here is what my file looks like:

'use strict'
const vision = require('node-cloud-vision-api')

// init with auth
vision.init({auth: 'XXXXXXXXXXXXXXXXXXXX'})

// construct parameters
const req = new vision.Request({
  image: new vision.Image('/Users/richardbross/Downloads/card.jpg'),
  features: [
    new vision.Feature('FACE_DETECTION', 4),
    new vision.Feature('LABEL_DETECTION', 10),
  ]
})

// send single request
vision.annotate(req).then((res) => {
  // handling response
  console.log(JSON.stringify(res.responses))
}, (e) => {
  console.log('Error: ', e)
})

Add an option to specify request timeout

I've got some images that are pretty big, and when I try to submit them, I get a request timeout. It would be nice to be able to set a timeout flag in the options.

Deprecate in favor of official Cloud Vision API clients

Thanks for making this client!

Now, gcloud-node and google-api-nodejs-client both officially support the Cloud Vision API. For the best developer experience, these clients are the recommended way to use the Cloud Vision API in Node.js.

Please consider deprecating node-cloud-vision-api and pointing to the official clients:

npm deprecate node-cloud-vision-api "Deprecated in favor of official Cloud Vision API clients: https://github.com/GoogleCloudPlatform/gcloud-node and https://github.com/google/google-api-nodejs-client"

[email protected]:google-cloud/vision Permission denied

My tutorial is not working out of the box

https://cloud.google.com/vision/docs/reference/libraries#client-libraries-install-nodejs

$ sudo npm install --save @google-cloud/vision
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
|\e you sure you want to continue connecting (yes/no)?
npm ERR! git clone [email protected]:google-cloud/vision Cloning into bare repository '/home/johnreed/.npm/_git-remotes/git-github-com-google-cloud-vision-41bc45c9'...
npm ERR! git clone [email protected]:google-cloud/vision Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
npm ERR! git clone [email protected]:google-cloud/vision Permission denied (publickey).
npm ERR! git clone [email protected]:google-cloud/vision fatal: Could not read from remote repository.
npm ERR! git clone [email protected]:google-cloud/vision
npm ERR! git clone [email protected]:google-cloud/vision Please make sure you have the correct access rights
npm ERR! git clone [email protected]:google-cloud/vision and the repository exists.
npm ERR! addLocal Could not install google-cloud/vision
npm ERR! Error: ENOENT, stat 'google-cloud/vision'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.2.0-27-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "@google-cloud/vision"
npm ERR! cwd /home/johnreed/workspace/node-js-getting-started
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! path google-cloud/vision
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/johnreed/workspace/node-js-getting-started/npm-debug.log
npm ERR! not ok code 0

$ cat /home/johnreed/workspace/node-js-getting-started/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli '@google-cloud/vision' ]
2 info using [email protected]
3 info using [email protected]
4 verbose readDependencies using package.json deps
5 verbose cache add [ '@google-cloud/vision', null ]
6 verbose cache add name=undefined spec="@google-cloud/vision" args=["@google-cloud/vision",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: '@google-cloud/vision',
7 verbose parsed url path: '@google-cloud/vision',
7 verbose parsed url href: '@google-cloud/vision' }
8 verbose cache add name="" spec="google-cloud/vision" args=["","google-cloud/vision"]
9 verbose parsed url { protocol: null,
9 verbose parsed url slashes: null,
9 verbose parsed url auth: null,
9 verbose parsed url host: null,
9 verbose parsed url port: null,
9 verbose parsed url hostname: null,
9 verbose parsed url hash: null,
9 verbose parsed url search: null,
9 verbose parsed url query: null,
9 verbose parsed url pathname: 'google-cloud/vision',
9 verbose parsed url path: 'google-cloud/vision',
9 verbose parsed url href: 'google-cloud/vision' }
10 silly lockFile d5a09ed3-google-cloud-vision google-cloud/vision
11 verbose lock google-cloud/vision /home/johnreed/.npm/d5a09ed3-google-cloud-vision.lock
12 info maybeGithub Attempting google-cloud/vision from git://github.com/google-cloud/vision
13 silly lockFile 722b1f98-t-github-com-google-cloud-vision git://github.com/google-cloud/vision
14 verbose lock git://github.com/google-cloud/vision /home/johnreed/.npm/722b1f98-t-github-com-google-cloud-vision.lock
15 verbose addRemoteGit [ 'git://github.com/google-cloud/vision', 'master' ]
16 verbose git clone git://github.com/google-cloud/vision Cloning into bare repository '/home/johnreed/.npm/_git-remotes/git-github-com-google-cloud-vision-722b1f98'...
16 verbose git clone git://github.com/google-cloud/vision fatal: remote error:
16 verbose git clone git://github.com/google-cloud/vision Repository not found.
17 silly lockFile 722b1f98-t-github-com-google-cloud-vision git://github.com/google-cloud/vision
18 silly lockFile 722b1f98-t-github-com-google-cloud-vision git://github.com/google-cloud/vision
19 info maybeGithub Attempting google-cloud/vision from git+ssh://[email protected]:google-cloud/vision
20 silly lockFile 41bc45c9-t-github-com-google-cloud-vision [email protected]:google-cloud/vision
21 verbose lock [email protected]:google-cloud/vision /home/johnreed/.npm/41bc45c9-t-github-com-google-cloud-vision.lock
22 verbose addRemoteGit [ '[email protected]:google-cloud/vision', 'master' ]
23 error git clone [email protected]:google-cloud/vision Cloning into bare repository '/home/johnreed/.npm/_git-remotes/git-github-com-google-cloud-vision-41bc45c9'...
23 error git clone [email protected]:google-cloud/vision Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
23 error git clone [email protected]:google-cloud/vision Permission denied (publickey).
23 error git clone [email protected]:google-cloud/vision fatal: Could not read from remote repository.
23 error git clone [email protected]:google-cloud/vision
23 error git clone [email protected]:google-cloud/vision Please make sure you have the correct access rights
23 error git clone [email protected]:google-cloud/vision and the repository exists.
24 silly lockFile 41bc45c9-t-github-com-google-cloud-vision [email protected]:google-cloud/vision
25 silly lockFile 41bc45c9-t-github-com-google-cloud-vision [email protected]:google-cloud/vision
26 silly lockFile d5a09ed3-google-cloud-vision google-cloud/vision
27 silly lockFile d5a09ed3-google-cloud-vision google-cloud/vision
28 error addLocal Could not install google-cloud/vision
29 error Error: ENOENT, stat 'google-cloud/vision'
30 error If you need help, you may report this entire log,
30 error including the npm and node versions, at:
30 error http://github.com/npm/npm/issues
31 error System Linux 4.2.0-27-generic
32 error command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "@google-cloud/vision"
33 error cwd /home/johnreed/workspace/node-js-getting-started
34 error node -v v0.10.25
35 error npm -v 1.4.21
36 error path google-cloud/vision
37 error code ENOENT
38 error errno 34
39 verbose exit [ 34, true ]

If I do not have access to it, please put a note one the docs themselves.

Can't send an image to the API

When I use image: new vision.Image('/Users/richardbross/Downloads/card.jpg'),
or image: new vision.Image({url: 'https://scontent-nrt1-1.cdninstagram.com/hphotos-xap1/t51.2885-15/e35/12353236_1220803437936662_68557852_n.jpg'}),

I get: Uncaught (in promise) TypeError: fs.readFileSync is not a function(โ€ฆ)

Here is the complete file:

'use strict'
import * as vision from 'node-cloud-vision-api';

var init = function() {

  // init with auth
  vision.init({auth: 'AIzaSyDodo1J7GUtDTZlH7BjxiPPJpw7k58_nD0'})

  // construct parameters
  const req = new vision.Request({
    image: new vision.Image({
      url: 'https://scontent-nrt1-1.cdninstagram.com/hphotos-xap1/t51.2885-15/e35/12353236_1220803437936662_68557852_n.jpg'
    }),
    features: [
      new vision.Feature('FACE_DETECTION', 1),
      new vision.Feature('LABEL_DETECTION', 10),
    ]
  })

  // send single request
  vision.annotate(req).then((res) => {
    // handling response
    console.log(JSON.stringify(res.responses))
  }, (e) => {
    console.log('Error: ', e)
  })

}

export {init};

I am using https://github.com/sitepoint-editors/browserify-babel-demo as a boilerplate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.