tag_image_urls {clarifai} | R Documentation |
Tag Remote Images
Description
Tag Remote Images
Usage
tag_image_urls(img_urls = NULL, model = NULL, language = NULL,
meta = FALSE, simplify = TRUE, ...)
Arguments
img_urls |
A string or character vector of URLs of images for which you want tags |
model |
For topic specific answers. Optional. Can be one of the following: general-v1.3, nsfw-v1.0, weddings-v1.0, travel-v1.0, food-items-v0.1 Default is NULL |
language |
Return tag in another language than english. 2 digit code. Optional.
See |
meta |
Boolean that toggles whether or not you want the entire object. |
simplify |
Boolean that toggles whether or not you want a simplified data frame with each label and associated probability in a separate row. Default is TRUE. |
... |
Additional arguments passed to The entire object returned by the API contains a lot of meta data. By default a simplified data.frame with img_url, associated labels, and probabilities is returned. |
Value
If meta is TRUE, a named list of length 4 with following elements is returned:
status_code
OK or not
status_msg
Successful or not
meta
Named list of 1 containing another list named tag
Sublist tag
has three elements: timestamp
, model
and config
results
is a data.frame of length 6 and 1 row. Column names are:
docid
, status_code
, status_msg
, local_id
and
a data.frame named tag which has a data.frame result which contains two columns:
labels and probabilities
If meta
is FALSE and simplify
is TRUE,
a data.frame with three columns: img_urls
, labels
and probs
returned
If meta
is FALSE and simplify
is FALSE,
a data.frame with two columns carrying a vector of labels, vector of probs is returned
for each image
References
https://developer.clarifai.com/
See Also
Examples
## Not run:
# Before calling the function, set API secret and id via secret_id(c("client_id", "secret"))
# and get token via get_token()
tag_image_urls(img_urls="url_of_image")
tag_image_urls("https://samples.clarifai.com/metro-north.jpg")
tag_image_urls("https://samples.clarifai.com/metro-north.jpg", language="es")
tag_image_urls("https://samples.clarifai.com/nsfw.jpg", model="nsfw-v1.0")
## End(Not run)