| draw_faces | R Documentation |
Draws the box and a label for each face on its image or video frame, so you
can check what detect_faces found: which faces were
detected, how they are numbered, and which faces were recognised as the
same person. Faces of the same person share a colour. plot() on a
detect_faces result does the same.
draw_faces(faces, labels = NULL, max_images = 20, dir = tempdir(), plot = TRUE)
## S3 method for class 'te_faces'
plot(x, ...)
faces |
A data frame returned by |
labels |
Text drawn above each box: one per row of |
max_images |
Most images or video frames to draw. When there are more, they are picked evenly from the first to the last. |
dir |
Directory for the drawn images (PNG files). Default is a temporary directory. |
plot |
Logical. Show the drawn images in the plot window, or below
the cell in a notebook. Default is |
x |
A data frame returned by |
... |
Passed to |
Only images and frames with a face in faces are drawn. The
"media" attribute of a detect_faces result lists every
image or frame with its number of faces, including those without any.
For a video, the frames are extracted again (as in
face_scores), unless detect_faces kept them
with save_frames = TRUE.
The paths of the drawn images, invisibly.
detect_faces, select_faces
## Not run:
image <- system.file("extdata", "two-people.jpg", package = "transforEmotion")
faces <- detect_faces(image)
draw_faces(faces)
# A video: a few frames, with each face's track and person
video <- system.file("extdata", "two-people.mp4", package = "transforEmotion")
plot(detect_faces(video, nframes = 20), max_images = 4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.