Skip to content

Vision 'detect' method doesn't return values when image is remote url #2087

@talkaboutdesign

Description

@talkaboutdesign

When passing in local image url API works great. When passing remote image url api does not provide any results. Here is my code for reference:

'use strict'

// Imports the Google Cloud client library
const Vision = require('@google-cloud/vision');

// Your Google Cloud Platform project ID
const projectId = 'my-id-is-here';

// Instantiates a client
const visionClient = Vision({
  projectId: projectId,
  keyFilename: 'service.json'
});

var img = 'https://d13yacurqjgara.cloudfront.net/users/995236/screenshots/3024565/day-36-normal.png';
var types = ['label','properties'];

visionClient.detect(img, types, function(err, detection, apiResponse) {
    // console.log(detection['labels']);
    // console.log(detection['properties']['colors']);

    if (err) throw err
    console.log(JSON.stringify(apiResponse, null, 2))
});

Metadata

Metadata

Labels

api: visionIssues related to the Cloud Vision API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions