Applies a trained yolo_fewshot_model to detect and segment instances in a new image.
Usage
yolo_fewshot_predict(
model,
img,
task = model$task,
conf_threshold = NULL,
max_objects = NULL,
engine = "gpu",
device_id = -1,
plot = FALSE,
rainbow = TRUE,
show_class = if (!is.null(model$show_class)) model$show_class else TRUE,
show_conf = if (!is.null(model$show_conf)) model$show_conf else TRUE,
badge = if (!is.null(model$badge)) model$badge else TRUE,
lower_size = NULL,
upper_size = NULL,
size_mode = c("relative", "absolute"),
...
)Arguments
- model
A
yolo_fewshot_modelfitted viayolo_fewshot_fit().- img
An
imageobject or file path to evaluate.- task
Task override:
"segment"(polygons) or"detect"(bounding boxes). Defaults tomodel$task.- conf_threshold
Numeric scalar override for detection confidence. Defaults to model threshold.
- max_objects
Maximum number of instances to detect.
- engine
Execution engine:
"cpu"or"gpu". IfNULL, usesmodel$engine.- device_id
GPU device ID if
engine = "gpu". Defaults to-1.- plot
Logical. Display detection results. Defaults to
FALSE.- rainbow
Logical. If
TRUE, plots instances in distinct rainbow colors. Defaults toFALSE.- show_class
Logical. Whether to display class name on labels/badges. Defaults to
TRUE.- show_conf
Logical. Whether to display confidence score on labels/badges. Defaults to
TRUE.- badge
Logical. Whether to draw a filled background badge behind labels. Defaults to
TRUE.- lower_size
Numeric scalar or
NULL. Minimum bounding-box area threshold for keeping detections. Interpreted according tosize_mode. Defaults toNULL(no lower filter).- upper_size
Numeric scalar or
NULL. Maximum bounding-box area threshold for keeping detections. Interpreted according tosize_mode. Defaults toNULL(no upper filter).- size_mode
Character string. Controls how
lower_sizeandupper_sizeare interpreted:"relative"(default, multiplier of mean detected bounding-box area) or"absolute"(pixel area).- ...
Additional arguments passed to plotting methods or aliases (e.g.
show_labels,show_scores,label_box).
