Package facerec. May 14, 2018

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package messaging. May 27, 2018

Package calpassapi. August 25, 2018

Package fitbitscraper

Package dkanr. July 12, 2018

Package knitrprogressbar

Package oec. R topics documented: May 11, Type Package

Package SEMrushR. November 3, 2018

Package repec. August 31, 2018

Package statsdk. September 30, 2017

Package censusr. R topics documented: June 14, Type Package Title Collect Data from the Census API Version 0.0.

Package robotstxt. November 12, 2017

Package guardianapi. February 3, 2019

Package docxtools. July 6, 2018

Package opencage. January 16, 2018

Package canvasxpress

Package fastdummies. January 8, 2018

Package githubinstall

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package gtrendsr. October 19, 2017

Package tidylpa. March 28, 2018

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package jpmesh. December 4, 2017

Package rsppfp. November 20, 2018

Package bisect. April 16, 2018

Package rzeit2. January 7, 2019

Package cancensus. February 4, 2018

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package validara. October 19, 2017

Package censusapi. August 19, 2018

Package qualmap. R topics documented: September 12, Type Package

Package internetarchive

Package tidytransit. March 4, 2019

Package ECctmc. May 1, 2018

Package gtrendsr. August 4, 2018

Package virustotal. May 1, 2017

Package rgho. R topics documented: January 18, 2017

Package vinereg. August 10, 2018

Package condusco. November 8, 2017

Package TrafficBDE. March 1, 2018

Package geniusr. December 6, 2017

Package goodpractice

Package WordR. September 7, 2017

Package aws.transcribe

Package postal. July 27, 2018

Package dbx. July 5, 2018

Package omu. August 2, 2018

Package available. November 17, 2017

Package kdtools. April 26, 2018

Package meme. December 6, 2017

Package comparedf. February 11, 2019

Package genesysr. June 14, 2018

Package meme. November 2, 2017

Package crossword.r. January 19, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package data.world. April 5, 2018

Package tidyimpute. March 5, 2018

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package tidytree. June 13, 2018

Package datasets.load

Package loggit. April 9, 2018

Package wikitaxa. December 21, 2017

Package carbonate. R topics documented: October 14, 2018

Package patentsview. July 12, 2017

Package wrswor. R topics documented: February 2, Type Package

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package spelling. December 18, 2017

Package essurvey. August 23, 2018

Package AutoDeskR. July 10, 2017

Package modules. July 22, 2017

Package splithalf. March 17, 2018

Package bupar. March 21, 2018

Package liftr. R topics documented: May 14, Type Package

Package rcv. August 11, 2017

Package projector. February 27, 2018

Package lumberjack. R topics documented: July 20, 2018

Package triebeard. August 29, 2016

Package barcoder. October 26, 2018

Package semver. January 6, 2017

Package reval. May 26, 2015

Package httpcache. October 17, 2017

Package widyr. August 14, 2017

Package processanimater

Package skynet. December 12, 2018

Package rbgm. May 18, 2018

Package climber. R topics documented:

Package postgistools

Package keyholder. May 19, 2018

Package editdata. October 7, 2017

Package embed. November 19, 2018

Package ether. September 22, 2018

Package sigmanet. April 23, 2018

Package fastqcr. April 11, 2017

Package sfdct. August 29, 2017

Package vip. June 15, 2018

Package queuecomputer

Package fusionclust. September 19, 2017

Package zeallot. R topics documented: September 28, Type Package

Package ecoseries. R topics documented: September 27, 2017

Package algorithmia. September 13, 2016

Transcription:

Package facerec Type Package Title An Interface for Face Recognition Version 0.1.0 Date 2018-05-14 May 14, 2018 URL https://github.com/methodds/facerec BugReports https://github.com/methodds/facerec/issues Provides an interface to the 'Kairos' Face Recognition API <https://kairos.com/facerecognition-api>. The API detects faces in images and returns estimates for demographics like gender, ethnicity and age. License MIT + file LICENSE Encoding UTF-8 LazyData true RoxygenNote 6.0.1 Imports magrittr (>= 1.5.0), dplyr (>= 0.7.0), httr (>= 1.3.0), jsonlite (>= 1.5.0), knitr (>= 1.2.0), stringr (>= 1.2.0), snakecase (>= 0.9.0), rlang Suggests magick (>= 1.9.0), ggplot2 (>= 2.2.0), purrr (>= 0.2.0), rmarkdown (>= 1.9.0) VignetteBuilder knitr NeedsCompilation no Author Carsten Schwemmer [aut, cre] (<https://orcid.org/0000-0001-9084-946x>) Maintainer Carsten Schwemmer <c.schwem2er@gmail.com> Repository CRAN Date/Publication 2018-05-14 12:19:21 UTC R topics documented: detect............................................ 2 enroll............................................ 3 1

2 detect facerec_init......................................... 4 get_galleries......................................... 4 get subjects.................................... 5 prep_image......................................... 6 recognize.......................................... 6 remove_....................................... 7 remove_subject....................................... 8 verify............................................ 9 view_subject........................................ 10 Index 11 detect detect faces Detect faces in an input image and return annotations from the Kairos API. detect(image, min_head_scale = 0.015) image An image of file type JPG, PNG, or BMP. Can either be an url string or a local image processed with prep_image. min_head_scale Set the ratio of the smallest face to look for in the input image. Accepts a value between.015 (1:64 scale) and.5 (1:2 scale). A data frame with annotations for each detected face. # one image faces <- detect(image = finn_image) # multiple images sw_image <- 'https://upload.wikimedia.org/wikipedia/en/8/82/leiadeathstar.jpg' padme_image <- 'https://upload.wikimedia.org/wikipedia/en/e/ee/amidala.png' faces <- c(finn_image, sw_image, padme_image) %>%

enroll 3 purrr::map(detect) %>% dplyr::bind_rows() enroll enroll faces Enroll face in an input image to a and assign a subject id. enroll(image, subject_id,, min_head_scale = 0.015) image subject_id An image of file type JPG, PNG, or BMP. Can either be an url string or a local image processed with prep_image. A string containing the id to assign for the person in the enrolled image. A string containing the name of the in which the image will be enrolled. min_head_scale Set the ratio of the smallest face to look for in the input image. Accepts a value between.015 (1:64 scale) and.5 (1:2 scale). A data frame with annotations for the enrolled image. finn_enroll <- enroll(image = finn_image, subject_id = 'finn', = 'starwars')

4 get_galleries facerec_init authorization Initializes the authorization credentials for the Kairos Face Recognition API. Needs to be called before using any other functions of facerec and requires kairos_id and kairos_key as environment variables. nothing. ## Not run: Sys.setenv(kairos_id = "Your Kairos API id") Sys.setenv(kairos_key = "Your Kairos API key") ## End(Not run) get_galleries list galleries Returns identifiers for all galleries associated with a Kairos application. get_galleries() A vector of id s.

get subjects 5 first_ <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') second_ <- enroll(image = finn_image, subject_id = 'finn', = 'more_starwars') # get_galleries get_galleries() get subjects get subjects Returns all subject id s associated with a. get subjects() The in which the subjects are enrolled. A vector of subject id s finn_enroll <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') # view subjects get subjects( = 'starwars')

6 recognize prep_image prepare local image Prepares a local image for an upload the Kairos API via detect, enroll, recognize and verify. prep_image(img_file) img_file Path to an image of file type JPG, PNG, or BMP. The prepared image object. # download example image temp_img_path <- tempfile(fileext = '.png') download.file(finn_image, temp_img_path, mode = 'wb', quiet = TRUE) # prepare image finn_local <- prep_image(temp_img_path) # use prepared image faces <- detect(image = finn_local) recognize recognize face Recognize faces in an image and return the most likely matches from a.

remove_ 7 recognize(image,, min_head_scale = 0.015, threshold = 0.6, max_num_results = 10, show_candidate_images = TRUE) image An image of file type JPG, PNG, or BMP. Can either be an url string or a local image processed with prep_image. A string containing the name of the in which the image will be enrolled. min_head_scale Set the ratio of the smallest face to look for in the input image. Accepts a value between.015 (1:64 scale) and.5 (1:2 scale). threshold Likelihood (between 0 and 1) used to determine a valid facial match. Defaults to 0.6. max_num_results The maximum number of potential matches that are returned. Defaults to 10. show_candidate_images Whether to return temporary URLs for each potential match. Defaults to TRUE. A dataframe with the potential matches for the input image. The likelihood of matches is given in column confidence. padme_image <- 'https://upload.wikimedia.org/wikipedia/en/e/ee/amidala.png' finn_face <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') padme_face <- enroll(image = padme_image, subject_id = 'padme', = 'starwars') # recognize finn_2 <- 'https://upload.wikimedia.org/wikipedia/commons/b/b6/john_boyega_by_gage_skidmore.jpg' finn_rec <- recognize(image = finn_2, = 'starwars') remove_ remove Removes a and all included subjects.

8 remove_subject remove_() The name of the to be removed. nothing. finn_enroll <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') # remove remove_( = 'starwars') remove_subject remove subject Removes a subject from a. remove_subject(subject_id, ) subject_id The subject id for the subject to be removed. The name of the in which the subject is enrolled. nothing.

verify 9 finn_enroll <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') # remove subject remove_subject(subject_id = 'finn', = 'starwars') verify verify face Verify whether face in an input image belongs to a subject in a. verify(image, subject_id, ) image subject_id An image of file type JPG, PNG, or BMP. Can either be an url string or a local image processed with prep_image. A string containing the id for the person in the to be verified. A string containing the name of the in which the subject will be verified. A data frame with the verification annotations for the input image. The likelihood of a match is given in column confidence. padme_image <- 'https://upload.wikimedia.org/wikipedia/en/e/ee/amidala.png' padme_face <- enroll(image = padme_image, subject_id = 'padme', = 'starwars')

10 view_subject # verify amidala_img <- 'https://upload.wikimedia.org/wikipedia/it/5/5e/padm%c3%a9_amidala.png' verified <- verify(image = amidala_img, subject_id = 'padme', = 'starwars') view_subject view subject Returns all face id s for each image enrolled for a given subject in a. view_subject(subject_id, ) subject_id The subject id for which to return all face id s. The in which the subject is enrolled. A dataframe with face id s and enrollment timestamps associated with the input subject. finn_enroll <- enroll(image = finn_image, subject_id = 'finn', = 'starwars') # view subject view_subject(subject_id = 'finn', = 'starwars')

Index detect, 2, 6 enroll, 3, 6 facerec_init, 4 get_galleries, 4 get subjects, 5 prep_image, 2, 3, 6, 7, 9 recognize, 6, 6 remove_, 7 remove_subject, 8 verify, 6, 9 view_subject, 10 11