Skip to contents

Compares a run's detections with the ground-truth annotations and writes recall_by_species_threshold.csv to <detections>/<run_id>/validation/. Only annotated segments from recordings the run processed are used.

Usage

pam_recall_report(
  cfg,
  run_id = cfg$birdnet$run_id,
  thresholds = NULL,
  pool = NULL
)

Arguments

cfg

A pam_config object.

run_id

Detection run.

thresholds

Confidence thresholds. Default: the band edges of validation$bands except the last.

pool

Optional pool from pam_validation_pool().

Value

A list: metrics (see pam_recall_metrics()), n_segments, n_no_species, n_other_only.

Examples

ex <- pam_example_project()
# the later stages read the master table that the scan builds
res <- suppressMessages(pam_scan_audio(ex$cfg))
segments <- suppressMessages(pam_recall_draw(ex$cfg, n = 12, run_id = NULL))
gt_dir <- file.path(ex$cfg$paths$validation, "ground_truth")
# normally the annotation app writes this file; here the parakeet is "heard" everywhere
truth <- data.frame(segment_id = segments$segment_id,
                    present = "Psittacula longicauda_Long-tailed Parakeet",
                    possible = "", other = "", none_audible = FALSE, note = "",
                    reviewer = "example", reviewed_at = format(Sys.time()),
                    stringsAsFactors = FALSE)
utils::write.csv(truth, file.path(gt_dir, "recall_annotations.csv"), row.names = FALSE)
rep <- suppressMessages(pam_recall_report(ex$cfg))
rep$n_segments
#> [1] 12