R/icevision_metrics.R

Defines functions COCOMetricType COCOMetric

Documented in COCOMetric COCOMetricType

#' @title COCOMetric
#'
#' @description Wrapper around [cocoapi evaluator](https://github.com/cocodataset/cocoapi)
#'
#' @details Calculates average precision. # Arguments metric_type: Dependent on the task you're solving. print_summary: If `TRUE`, prints a table with statistics. show_pbar: If `TRUE` shows pbar when preparing the data for evaluation.
#'
#' @param metric_type Dependent on the task you're solving.
#' @param print_summary If `TRUE`, prints a table with statistics.
#' @param show_pbar If `TRUE` shows pbar when preparing the data for evaluation.
#' @return None
#' @export
COCOMetric <- function(metric_type = COCOMetricType()$bbox, print_summary = FALSE, show_pbar = FALSE) {

  args <- list(
    metric_type = metric_type,
    print_summary = print_summary,
    show_pbar = show_pbar
  )

  do.call(icevision()$COCOMetric, args)

}

#' @title COCOMetricType
#'
#' @description Available options for `COCOMetric`
#' @return None
#'
#' @export
COCOMetricType <- function() {

  icevision()$COCOMetricType

}

Try the fastai package in your browser

Any scripts or data that you put into this service are public.

fastai documentation built on June 22, 2024, 11:15 a.m.