Description Usage Arguments Value Examples
View source: R/get_google_vision_response.R
Given a list of images, a feature type and the maximum number of responses, this functions calls the Google Cloud Vision API, and returns the raw response from the API. For a friendlier response, refer to the 'gcv_get_image_annotations' function, which returns results in a data.table format (however, the information returned is limited compared to the raw response).
1 2 | gcv_get_raw_response(imagePaths, feature = "LABEL_DETECTION",
maxNumResults = NULL)
|
imagePaths |
character, file paths, URLs or Cloud Storage URIs of the images, can be a combination of all three |
feature |
character, one out of: "LABEL_DETECTION", "FACE_DETECTION", "TEXT_DETECTION", "DOCUMENT_TEXT_DETECTION", "LOGO_DETECTION", "LANDMARK_DETECTION" |
maxNumResults |
integer, the maximum number of results (per image) to be returned. |
a response object returned by the API. To get the image annotations, take the "content" element from the object
1 2 3 4 5 6 7 8 9 10 | ## Not run:
imagePath <- system.file(
"extdata", "golden_retriever_puppies.jpg", package = "googleCloudVisionR"
)
raw_response <- gcv_get_raw_response(imagePaths = imagePath, maxNumResults = 7)
str(raw_response)
raw_response[["content"]]
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.