Learn R Programming

clarifai (version 0.4.2)

tag_images: Tag Images on the Computer

Description

Tag Images on the Computer

Usage

tag_images(file_paths = NULL, model = NULL, language = NULL,
  meta = FALSE, simplify = TRUE, ...)

Arguments

file_paths
a vactor of paths to image file(s) 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 list{get_langs} for the supported languages and their 2 digit codes.
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 clarifai_POST.

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: file_paths, 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

tag_image_urls

Examples

Run this code
## 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_images(file_paths="path_to_image")
## ---------------------------------------------

Run the code above in your browser using DataLab