sammlapp/Alberta_SBT_2016_REVI_Localized
Red-eyed Vireo localized songs Creators: Sam Lapp (sam.lapp@pitt.edu) [1], Scott J. Wilson [2], Erin Bayne [3], and Justin Kitzes [1] Affiliations: [1] University of Pittsburgh, [2] Government of Alberta, [3] University of Alberta Version 1.1 Date Updated: 2026-09-22 DOI: not yet assigned General characteristics audio format: 10 second .FLAC clips starting 4 seconds before localized events dimensions localized: 2number of localization arrays: 13array geometry:… See the full description on the dataset page: https://huggingface.co/datasets/sammlapp/Alberta_SBT_2016_REVI_Localized.
097
1"""run hawkears inference on 14 SBT localization arrays, ~50 recorders each2 31.7Tb of audio across all the arrays4"""5 6from bioacoustics_model_zoo import HawkEars_v0107from glob import glob8from pathlib import Path9from tqdm.autonotebook import tqdm10 11try:12 from redacted_paths import REDACTED_OUTPUT_DIR, REDACTED_DATA_ROOT13except ImportError:14 print("redacted paths not available")15 REDACTED_OUTPUT_DIR = ""16 REDACTED_DATA_ROOT = ""17 18data_root = f"{REDACTED_DATA_ROOT}"19out_dir = f"{REDACTED_OUTPUT_DIR}/1_detect_hawkears/"20 21arrays = glob(f"{data_root}/SBT-*")22m = HawkEars_v010()23m.device = "cuda:0"24 25print(f"Found {len(arrays)} arrays from SBT dataset")26for audio_dir in tqdm(arrays):27 folders = glob(f"{audio_dir}/SBT*")28 if len(folders) < 1:29 continue30 array_name = Path(audio_dir).name31 preds_save_dir = f"{out_dir}/{array_name}/"32 Path(preds_save_dir).mkdir(exist_ok=True)33 34 folders = glob(f"{audio_dir}/SBT*")35 print(f"Found {len(folders)} audio folders for array {Path(audio_dir).name}")36 37 for f in tqdm(folders):38 files = glob(f"{f}/*.wav")39 if len(files) < 1:40 continue41 audio_folder_name = Path(f).name42 # print(f"Running hawkears on f{audio_folder_name}")43 44 save_dir = f"{preds_save_dir}/{audio_folder_name}"45 Path(save_dir).mkdir(exist_ok=True)46 47 preds_save_path = f"{save_dir}/{audio_folder_name}_hawkears_preds.csv"48 if Path(preds_save_path).exists():49 # already done50 continue51 print(f"running HawkEars prediction on {len(files)} files from {f}")52 53 preds = m.predict(files, num_workers=8, batch_size=256)54 55 # change from full path to just file name (much smaller file results)56 preds = preds.reset_index()57 preds["file"] = preds["file"].apply(lambda x: Path(x).name)58 # save smaller float format, 3 decimals59 preds.to_csv(60 f"{save_dir}/{Path(f).name}_hawkears_preds.csv",61 float_format="%.3f",62 index=False,63 )64 