save_json: save annotation data as JSON

Description Usage Arguments Value Examples

View source: R/save_json.R

Description

Writes raw JSON data as returned by the Google Vision API to a UTF-8 encoded local file.

Usage

1
save_json(annotations, file)

Arguments

annotations

An annotation object created with get_annotations.

file

Local path where the JSON data should be stored.

Value

nothing.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
 gvision_init()

 finn_image <- 'https://upload.wikimedia.org/wikipedia/en/2/2a/Finn-Force_Awakens_%282015%29.png'
 results <- get_annotations(images = finn_image, features = 'all',
                            max_res = 10, mode = 'url')
 temp_file_path <- tempfile(fileext = '.json')
 save_json(results, temp_file_path)
  
## End(Not run)

cschwem2er/imgrec documentation built on Dec. 10, 2019, 3:32 a.m.