Skip to contents

Performs real-time human pose estimation and 17 keypoint detection using YOLO26 (e.g., yolo26n-pose, yolo26s-pose, etc.) with bounding box regression and anatomical skeleton visualization.

Usage

image_pose_dl(
  img,
  model = "yolo26n-pose",
  conf_threshold = 0.25,
  iou_threshold = 0.45,
  kpt_threshold = 0.3,
  col = NULL,
  lwd = 2,
  cex = 1,
  pad = 1,
  show_text = TRUE,
  show_conf = TRUE,
  show_class = TRUE,
  show_id = FALSE,
  badge = TRUE,
  kpt_radius = 4,
  bbox = TRUE,
  skeleton = TRUE,
  threads = 0,
  engine = c("gpu", "cpu"),
  device_id = -1,
  verbose = TRUE,
  plot = TRUE,
  dir = pliman_model_dir(),
  imgsz = NULL,
  ...
)

Arguments

img

An Image object, a 2D/3D numeric array, a path to an image file, or a list of images.

model

Model name or path to a custom ONNX file. Defaults to "yolo26n-pose". Options include "yolo26n-pose", "yolo26s-pose", "yolo26m-pose", "yolo26l-pose", "yolo26x-pose".

conf_threshold

Minimum confidence score for candidate person detections (default 0.25).

iou_threshold

IoU threshold for Non-Maximum Suppression (default 0.45).

kpt_threshold

Minimum confidence threshold for rendering individual keypoints and skeleton limbs (default 0.3).

col

Optional color or palette for bounding boxes and keypoint markers.

lwd

Line width for bounding boxes and skeleton limbs (default 2).

cex

Size factor for bounding box label text (default 1.0).

pad

Padding multiplier controlling the background badge size around label text (default 1.0).

show_text

Logical. Whether to display text labels on bounding boxes (default TRUE).

show_conf

Logical. Whether to display confidence scores in labels (default TRUE).

show_class

Logical. Whether to display class names in labels (default TRUE).

show_id

Logical. Whether to display object IDs (#1, #2, ...) in labels (default FALSE).

badge

Logical. Whether to draw a solid background badge behind label text (default TRUE). If FALSE, only the text is drawn directly.

kpt_radius

Radius/size for keypoint markers (default 4).

bbox

Logical. Whether to draw bounding boxes around detected persons (default TRUE).

skeleton

Logical. Whether to render the 17-keypoint anatomical skeleton (default TRUE).

threads

Number of CPU threads (default 0 for auto-tuning).

engine

Execution engine: "cpu" or "gpu" (DirectML).

device_id

GPU device ID (default -1 for auto).

verbose

Logical. Whether to show progress messages.

plot

Logical. Whether to plot the image with pose overlays.

dir

Model directory (default pliman_model_dir()).

imgsz

Target input image resolution for YOLO pose inference (e.g., 640, 960, or 1024). If NULL (default), inferred automatically from the model or defaults to 640.

...

Additional arguments passed to graphics::plot().

Value

A list with class pliman_pose containing:

  • boxes: Data frame containing detected person bounding boxes (id, xmin, ymin, xmax, ymax, label, score).

  • keypoints: List of data frames (one per person) containing the 17 COCO keypoints (keypoint, x, y, conf).

  • summary: Human-readable detection summary string.

  • counts: Data frame of instance counts.

Examples

if (FALSE) { # interactive()
  library(pliman)
  img <- image_import("person.png")
  res <- image_pose_dl(img)
  res$boxes
  res$keypoints[[1]]
}