Skip to content

Node Vision SDK underperforming in simple case when compared to the GCloud Vision demo #2490

@maephisto

Description

@maephisto

Environment details

  • OS: MacOS
  • Node.js version: 8.1.4
  • npm version: 5.0.3
  • @google-cloud/vision version: 0.11.4

Steps to reproduce

  1. download the sample image
    sample

As it is pretty clear, you'd expect it to return the capital letter "M" in the text detection field.

  1. Fire up a text editor and run the below node snippet in a env that already has GCloud authentification setup. You will also need the Vision API enabled
'use strict';

const vision = require('@google-cloud/vision')();

const options = {
  imagePath: __dirname + '/sample.png'
}

vision.detectText(options.imagePath).then((result) => {
  console.log('this is the result', JSON.stringify(result));
});

Now the result looks like this:

[
   [

   ],
   {
      "responses":[
         {
            "faceAnnotations":[],
            "landmarkAnnotations":[],
            "logoAnnotations":[],
            "labelAnnotations":[],
            "textAnnotations":[],
            "fullTextAnnotation":null,
            "safeSearchAnnotation":null,
            "imagePropertiesAnnotation":null,
            "cropHintsAnnotation":null,
            "webDetection":null,
            "error":null
         }
      ]
   }
]

If i test the same sample image on GCloud Vision landing page demo, the result is correct: the letter M
screenshot 2017-07-25 11 01 34

https://cloud.google.com/vision/

Since this is a pretty clear image and 1 single character, I'm having trouble understanding why does the accuracy differ.
I noticed this issue also on other sample images - they work in the demo but not using the Node SDK.

Metadata

Metadata

Labels

api: visionIssues related to the Cloud Vision API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions