cloudyr/RoogleVision

Request Status Code: 502

Opened this issue · 1 comments

Hey,
First of all, thank you for the package.
I try to classify landmarks with the google vision API on Flickr-data. I do not want to download the data but try to classify the files by passing URLs. But I get Request Status Code: 502. Some error with a JSON content? It says no JSON content found. I cannot find any help on this? Any idea how the error is produced?

On windows x86-64, R version 3.4.1 (2017-04-21)
In Detail i do:
require(RoogleVision)
require(googleAuthR)
require(magrittr)

options("googleAuthR.client_id" = ....)
options("googleAuthR.client_secret" = ....)
options("googleAuthR.scopes.selected" = c("https://www.googleapis.com/auth/cloud-platform"))
googleAuthR::gar_auth()

Then i load a datatable with URL's of Flickr images which I want to classifiy. For this, i first read the datatable with Flickr <- data.table::fread (Flickr_data.csv) and then go

getGoogleVisionResponse(imagePath = Flickr$URL[i], feature="LANDMARK_DETECTION")

with Flickr$URL[i] being characters

Request Status Code: 502
Error : lexical error: invalid char in json text.
smallerthansign!DOCTYPE html> <html lang=engreaterthansign
(right here) ------^

Trying again: 1 of 5
Trying again: 2 of 5
Trying again: 3 of 5
Trying again: 4 of 5
Trying again: 5 of 5
Warning message:
No JSON content found in request

opened an issue here already but got referred to this site :) <- MarkEdmondson1234/googleAuthR#80 (comment)

Thank you!

flovv commented

Hi,
it seems that your request url does not provide a path to an image.
Have you tried the call:
getGoogleVisionResponse("https://media-cdn.tripadvisor.com/media/photo-s/02/6b/c2/19/filename-48842881-jpg.jpg", feature="LANDMARK_DETECTION")

Does that one work?
Do you get a proper response by manually setting the path?
getGoogleVisionResponse(imagePath = "url.path", feature="LANDMARK_DETECTION")