
Draw a round of random segments for ground-truth annotation
Source:R/05b_groundtruth_sample.R
pam_recall_draw.RdSamples segments uniformly at random from the recordings, adds them to
<paths$validation>/ground_truth/recall_segments.csv, and never draws the
same segment twice. The ground truth belongs to the audio, not to a
detection run, so it can be reused to compare runs (for example filtered
against unfiltered audio).
Examples
ex <- pam_example_project()
# the later stages read the master table that the scan builds
res <- suppressMessages(pam_scan_audio(ex$cfg))
# run_id = NULL: sample all recordings (a real run would restrict to the files it processed)
new <- suppressMessages(pam_recall_draw(ex$cfg, n = 4, run_id = NULL))
as.data.frame(new)[, c("segment_id", "rel", "seg_start", "seg_end")]
#> segment_id rel seg_start seg_end
#> 1 1 G0059/G0059_20260405_183004.wav 0 1
#> 2 2 G0059/G0059_20260405_183004.wav 1 2
#> 3 3 G0110/G0110_20260406_060004.wav 0 1
#> 4 4 G0110/G0110_20260406_060000.wav 1 2