Learn R Programming

animl (version 3.2.0)

plot_box: Plot bounding boxes on image from md results

Description

Plot bounding boxes on image from md results

Usage

plot_box(
  rows,
  file_col = "filepath",
  min_conf = 0,
  label_col = NULL,
  show_confidence = FALSE,
  colors = NULL,
  detector_labels = NULL,
  return_img = FALSE
)

Value

no return value, produces bounding box in plot panel

Arguments

rows

row or rows of images in which the bounding box will be plotted

file_col

Column name containing file paths

min_conf

minimum confidence to plot box

label_col

Column name containing class to print above the box. If None, no label is printed.

show_confidence

If true, show confidence score above the box.

colors

Named list mapping class labels to BGR color tuples for the bounding boxes.

detector_labels

Named list mapping detector categories to human-readable labels.

return_img

If true, return the image array with boxes overlaid, otherwise display it

Examples

Run this code
if (FALSE) {
test_image <- classify(classifier_model, test_image, file_col='filepath')
plot_box(test_image, file_col='filepath', minconf = 0.5, prediction=TRUE)
}

Run the code above in your browser using DataLab