parse_annotations: parse image annotations

Description Usage Arguments Value Examples

View source: R/parse_annotations.R

Description

Parses the annotations and converts most of the features to data frames. Also stores the corresponding image identifiers for each feature as 'img_id'

Usage

1
parse_annotations(annotations)

Arguments

annotations

An annotation object created with get_annotations.

Value

A list containing data frames for each feature:

labels

label annotations

web_labels

web label annotations

web_similar

similar web images

web_match_partial

partial matching web images

web_match_full

full matching web images

web_match_pages

matching web pages

faces

face annotations

objects

object annotations

logos

logo annotations

landmarks

landmark annotations

full_text

full text annotation

safe_serarch

safe search annotation

colors

dominant color annotations

crop_hints

crop hints for ratios 0.8/1.0/1.2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# initialize api credentials
gvision_init()

# annotate images
finn_image <- 'https://upload.wikimedia.org/wikipedia/en/2/2a/Finn-Force_Awakens_%282015%29.png'
sw_image <- 'https://upload.wikimedia.org/wikipedia/en/8/82/Leiadeathstar.jpg'
padme_image <- 'https://upload.wikimedia.org/wikipedia/en/e/ee/Amidala.png'

results <- get_annotations(images = c(finn_image, sw_image, padme_image),
                           features = 'all', max_res = 10, mode = 'url')
# parse annotations
img_data <- parse_annotations(results)

# available feature data frames
names(img_data)
  
## End(Not run)
  

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