Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 34 additions & 11 deletions notebooks/load_birdclallclassifier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "148505fc",
"metadata": {},
"outputs": [],
"source": [
"import tensorflow as tf\n",
"from nightingale.model.bird_call_classifier import BirdCallClassifier\n",
"from nightingale.data_pipeline.wav_loader import load_wav_16k_mono"
"from nightingale.data_pipeline.audio_preprocessor import AudioPreprocessor\n",
"# convert data if necessary\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "594d6080",
"metadata": {},
"outputs": [],
"source": [
"wav1 = load_wav_16k_mono(\"../data/birdclef-2024/train_audio_16/cohcuc1/XC19645.wav\")\n",
"wav2 = load_wav_16k_mono(\"../data/birdclef-2024/train_audio_16/integr/XC810654.wav\")\n",
"wav3 = load_wav_16k_mono(\"../data/birdclef-2024/train_audio_16/tilwar1/XC191454.wav\")"
"preprocessor = AudioPreprocessor()\n",
"wav1,sr1 = preprocessor.load_audio(\"../data/birdclef-2024/train_audio_16/cohcuc1/XC19645.wav\")\n",
"wav2,sr2 = preprocessor.load_audio(\"../data/birdclef-2024/train_audio_16/integr/XC810654.wav\")\n",
"wav3,sr3 = preprocessor.load_audio(\"../data/birdclef-2024/train_audio_16/tilwar1/XC191454.wav\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "0855a68f",
"metadata": {},
"outputs": [],
Expand All @@ -36,10 +38,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "047543cf",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2025-11-25 14:19:39.536124: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:84] Allocation of 22413312 exceeds 10% of free system memory.\n",
"2025-11-25 14:19:39.539009: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:84] Allocation of 22413312 exceeds 10% of free system memory.\n",
"2025-11-25 14:19:39.615155: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:84] Allocation of 21037056 exceeds 10% of free system memory.\n",
"2025-11-25 14:19:39.618458: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:84] Allocation of 21037056 exceeds 10% of free system memory.\n",
"2025-11-25 14:19:39.623203: W external/local_xla/xla/tsl/framework/cpu_allocator_impl.cc:84] Allocation of 21037056 exceeds 10% of free system memory.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Common Hawk-Cuckoo\n",
"Common Hawk-Cuckoo\n",
"Common Hawk-Cuckoo\n"
]
}
],
"source": [
"print(model.predict(wav1))\n",
"print(model.predict(wav2))\n",
Expand All @@ -49,7 +72,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "nightingale",
"language": "python",
"name": "python3"
},
Expand All @@ -63,7 +86,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.12"
"version": "3.11.14"
}
},
"nbformat": 4,
Expand Down
Loading