Description Usage Arguments Examples
Function for recognizing the image using the model trained from the data.
1 |
x |
string input; image file input to be recognize. |
y |
model supervised on learning from the training dataset. |
rule |
string input; stopping rule for choosing number of principal components.
Options are: |
display |
displays the input image, and the corresponding output image – as recognized by the model. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | To reproduce this example, please refer to \code{https://github.com/alstat/rface}
# Call the Face Recognition package
library(rface)
# Import all images in the directory "data/jaffe/"
imgData <- importImages("~/Downloads/jaffe_training/", display = FALSE)
# Show imported images
showFace(imgData)
# Take the average of the faces
img_mean <- aveFace(imgData, display = FALSE)
# Show the average of the faces
showFace(img_mean)
# Train the algorithm for the images
model <- learn(imgData)
# Show the eigen faces
showFace(model)
# Input an image and recognize it
recognize("~/Downloads/jaffe_testing/KA.AN1.39.tiff", model, display = TRUE, rule = "simple f-share")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.