Construct YOLO network

ovml_yolo(version = 4, device = "cuda", weights_file = "auto", class_labels)

Arguments

version

integer or string: one of

  • 3 : YOLO v3

  • 4 : YOLO v4

  • 7 : YOLO v7

  • "4-tiny" : YOLO v4-tiny

  • "4-mvb" : an experimental network trained specifically to detect (only) volleyballs

  • "4-tiny-mvb" : the v4-tiny version of the same

device

string: "cpu" or "cuda"

weights_file

string: either the path to the weights file that already exists on your system or "auto". If "auto", the weights file will be downloaded if necessary and stored in the directory given by ovml_cache_dir()

class_labels

character: the class labels used for network training. If missing or NULL, these default to ovml_class_labels("coco") for all models except "mvb" models, which use ovml_class_labels("mvb")

Value

A YOLO network object

References

https://github.com/pjreddie/darknet, https://github.com/WongKinYiu/yolov7

Examples

if (FALSE) {
  dn <- ovml_yolo()
  img <- ovml_example_image()
  res <- ovml_yolo_detect(dn, img)
  ovml_ggplot(img, res)
}