draw_keypoints | R Documentation |
Draws Keypoints, an object describing a body part (like rightArm or leftShoulder), on given RGB tensor image.
draw_keypoints(
image,
keypoints,
connectivity = NULL,
colors = NULL,
radius = 2,
width = 3
)
image |
: Tensor of shape (3, H, W) and dtype uint8 |
keypoints |
: Tensor of shape (N, K, 2) the K keypoints location for each of the N detected poses instance, |
connectivity |
: Vector of pair of keypoints to be connected (currently unavailable) |
colors |
: character vector containing the colors of the boxes or single color for all boxes. The color can be represented as strings e.g. "red" or "#FF00FF". By default, viridis colors are generated for keypoints |
radius |
: radius of the plotted keypoint. |
width |
: width of line connecting keypoints. |
Image Tensor of dtype uint8 with keypoints drawn.
Other image display:
draw_bounding_boxes()
,
draw_segmentation_masks()
,
tensor_image_browse()
,
tensor_image_display()
,
vision_make_grid()
if (torch::torch_is_installed()) {
## Not run:
image <- torch::torch_randint(190, 255, size = c(3, 360, 360))$to(torch::torch_uint8())
keypoints <- torch::torch_randint(low = 60, high = 300, size = c(4, 5, 2))
keypoint_image <- draw_keypoints(image, keypoints)
tensor_image_browse(keypoint_image)
## End(Not run)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.