Package 'ovmlpy'

Title: Machine Learning Tools for Volleyball
Description: Image and video machine learning tools, for application to volleyball analytics.
Authors: Ben Raymond [aut, cre], Adrien Ickowicz [aut], openvolley.org [org]
Maintainer: Ben Raymond <[email protected]>
License: MIT + file LICENSE
Version: 0.1.5
Built: 2024-11-13 05:29:53 UTC
Source: https://github.com/openvolley/ovmlpy

Help Index


Construct YOLO network

Description

Models are implemented in Python and accessed via reticulate.

Usage

ovml_yolo(version = "7", device = 0, weights_file = "auto", ...)

Arguments

version

integer or string: one of

  • 7 or "7-tiny" : YOLO v7 or v7-tiny

device

string or numeric: "cpu" or 0, 1, 2 etc for GPU devices. Defaults to 0 but will silently fall back to "cpu" if torch reports that CUDA is not available

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()

...

: currently ignored

Value

A YOLO network object

References

https://github.com/WongKinYiu/yolov7

Examples

## Not run: 
  dn <- ovml_yolo()
  img <- ovml_example_image()
  res <- ovml_yolo_detect(dn, img)
  ovml_ggplot(img, res)

## End(Not run)

Detect objects in image using a YOLO network

Description

Works on a single input image only, at the moment.

Usage

ovml_yolo_detect(
  net,
  image_file,
  conf = 0.25,
  nms_conf = 0.45,
  classes,
  as,
  ...
)

Arguments

net

yolo: as returned by ovml_yolo()

image_file

character: path to one or more image files, or a single video file (mp4, m4v, or mov extension)

conf

scalar: confidence level

nms_conf

scalar: non-max suppression confidence level

classes

character: vector of class names, only detections of these classes will be returned

as

string: for object detection networks, "boxes" (default and only option); for pose detection "segments" (default) or "keypoints"

...

: currently ignored

Value

A data.frame with columns "image_number", "image_file", "class", "score", "xmin", "xmax", "ymin", "ymax", "frame"

See Also

ovml_yolo()

Examples

## Not run: 
  dn <- ovml_yolo()
  img <- ovml_example_image()
  res <- ovml_yolo_detect(dn, img)
  ovml_ggplot(img, res)

## End(Not run)

Install system requirements for using YOLO v7 via Python

Description

Python and its required packages are installed into a virtual environment. ovml_yolo7_python_envname() returns the name of the virtual environment used, and ovml_yolo7_python_envpath() its path on the file system.

Usage

ovml_yolo7_python_setup()

ovml_yolo7_python_envname()

ovml_yolo7_python_envpath()

Value

TRUE (invisibly) on success


ovmlpy

Description

Image and video machine learning tools, for application to volleyball analytics.