The image.libfacedetection provides a pretrained convolutional neural network to detect faces in images.
library(magick)
library(image.libfacedetection)
<- system.file(package="image.libfacedetection", "images", "handshake.jpg")
path <- image_read(path)
x <- image_detect_faces(x)
faces
facesplot(faces, x, border = "red", lwd = 7, col = "white")
Need support in image recognition? Contact BNOSAC: http://www.bnosac.be