Opens a 'shiny' app, in the browser, for stages 1 and 2 of the workflow. The tabs depend on the arguments:
Usage
run_app(
manifest = NULL,
clips_dir = NULL,
verdicts_file = NULL,
reviewer = NULL,
max_freq = 12,
selection_dir = NULL,
output_dir = NULL,
recordings = NULL,
audio_dir = NULL,
site_pattern = NULL,
blind = FALSE,
classifier = NULL,
launch.browser = interactive(),
...
)Arguments
- manifest
NULL, a data frame (or tibble) or a character scalar path toclip_manifest.csv: the clip manifest (fromselect_clips(),cut_clips()orassign_reviewers()), one row per clip. Withoutput_dir, by default<output_dir>/clip_manifest.csvwhen it exists.- clips_dir
NULLor a character scalar, folder of the cut clips, with one subfolder per species (<clips_dir>/<species_folder>/<clip_file>, as written bycut_clips()). Withoutput_dir,<output_dir>/clipsby default.- verdicts_file
NULLor a character scalar, path to the CSV (.csv) where the verdicts are written. By default,verdicts.csvinoutput_diror next tomanifestwhen it is a path.- reviewer
NULLor a character scalar, name of the reviewer, written with each verdict. With a manifest fromassign_reviewers(), only the clips assigned to this reviewer (as first or second reviewer) are shown.- max_freq
NULLor a numeric scalar, upper limit of the spectrogram, in kHz: 12 by default (e.g.8for most anuran calls).NULLshows the whole band. It can also be changed in the Review tab.- selection_dir
NULLor a character scalar, folder of the BirdNET selection tables (as inread_selection_tables()). Opens the Sampling and Export tabs.- output_dir
NULLor a character scalar, folder of the validation round: the clips, the manifest, the verdicts and the export (<output_dir>/occupancyby default) are written there.- recordings
NULL, a data frame (or tibble) of all recordings (columnssiteandsource_audio, one row per recording) or a character scalar path to its CSV: needed by"random_recordings"and, in the export, to keep the occasions without detections (seeexport_occupancy_data()).- audio_dir
NULLor a character scalar, folder of the recordings, subfolders included. Every recording is listed withlist_recordings()and written to therecordingsCSV when it is a path, or else to<output_dir>/recordings.csv; the list is used asrecordings. Can also be chosen in the app (Intro > Audio panel).- site_pattern
NULLor a character scalar, regular expression with one capture group that takes the site from the file names, when the recordings or the selection tables of several sites share a folder (seelist_recordings()andread_selection_tables()). Can also be set in the Audio panel.- blind
Logical scalar. If
TRUE, blind review: the Review tab hides the score, the sampling design and the clip file name (which starts with the score), and shows the clips in an order shuffled once per reviewer instead of the order of the manifest, so that the verdict does not lean on the score.- classifier
NULLor a character scalar, label of the classifier, recorded inextraction_info.csvandschema.json.- launch.browser
Logical scalar: open the app in the browser? Passed to
shiny::runApp().- ...
Further arguments to
shiny::runApp(), e.g.port.
Details
Intro: a graphical abstract of the sampling designs and an Audio panel to choose the audio folder, the BirdNET results and the validation folder (with a dialog of the system), with a summary of the recordings per site and night. Folders given to
run_app()are confirmed when the app opens. Without them, the app opens on this tab.Sampling (with
selection_dirandoutput_dir): a form for the sampling design ofselect_clips(). Draw shows the clips per site and species and their inclusion probabilities without touching the audio; Cut clips cuts them withcut_clips()and writesclip_manifest.csv,extraction_info.csvandclips/tooutput_dir, asextract_validation_clips()does (without the zip packages). The new clips go straight to the Review tab.Review: the clips of a manifest one at a time, with the spectrogram and a player for each clip, its site, night, hour, score and design, and buttons to mark it positive, negative or uncertain. An optional Identity field says what a negative or uncertain clip is: free text, or one or more suggestions (the species of the manifest and
identity_categories()), marked sure or probable. Fill it before clicking Negative or Uncertain; it is cleared at each verdict and ignored for positives. Each verdict is written at once toverdicts_file, so an interrupted session loses nothing and can be resumed. The tab replaces moving the clips intoPositiveandNegativefolders in the BirdNET GUI;app_verdicts()turnsverdicts_fileinto the table thatclassify_review()returns.Export (with
selection_dirandoutput_dir): callsexport_occupancy_data()with the detections ofselection_dir, the verdicts of the Review tab (combined byconsensus_verdicts()when a clip has several reviewers) and, optionally,recordings, and shows the summary ofschema.json. The score calibration is not in the app yet; callexport_occupancy_data()withfitfor it.
The app runs on the reviewer's computer and reads the clips from disk; nothing is uploaded.
Keyboard
In the Review tab: p positive, n negative, u uncertain, right
arrow next clip, left arrow previous clip, space play or pause.
Verdicts file
A CSV with one line per click: clip_file, species_folder,
reviewer, verdict ("positive", "negative" or "uncertain") and
time, then identity (several separated by |) and
identity_certainty ("sure" or "probable"), empty when no identity
was given. Lines are only appended; when a clip is marked again, the
last verdict of the reviewer counts. Several reviewers can share one
file or keep one each. A file of an earlier version, without the
identity columns, is rewritten once with them empty at its next verdict.
See also
app_verdicts(), vignette("review-app").
Examples
if (interactive()) {
# Review only
run_app("validation/clip_manifest.csv", "validation/clips",
reviewer = "liliana")
# Sample, cut, review and export
run_app(selection_dir = "N:/Arara", output_dir = "validation",
recordings = "recordings.csv", reviewer = "liliana",
max_freq = 8)
}