Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Testing Code For TweetyNet / Documentation Updates #119

Merged
merged 9 commits into from
Jun 27, 2022
64 changes: 54 additions & 10 deletions PyHa_Testing.ipynb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"scrolled": true
},
@@ -23,23 +23,23 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"path = \"./TEST/\"\n",
"clip_path = \"./TEST/ScreamingPiha2.wav\"\n",
"manual_df = pd.read_csv(\"ScreamingPiha_Manual_Labels.csv\")\n",
"#path = \"./TEST/\"\n",
"#clip_path = \"./TEST/ScreamingPiha2.wav\"\n",
"#manual_df = pd.read_csv(\"ScreamingPiha_Manual_Labels.csv\")\n",
"\n",
"\n",
"#path = \"./mixed_bird/Mixed_Bird/\"\n",
"#clip_path = \"./mixed_bird/Mixed_Bird/Sporophila-lineola-408800.wav\"\n",
"#manual_df = pd.read_csv(\"./mixed_bird/mixed_bird_manual.csv\")"
"path = \"./mixed_bird/Mixed_Bird/\"\n",
"clip_path = \"./mixed_bird/Mixed_Bird/Sporophila-lineola-408800.wav\"\n",
"manual_df = pd.read_csv(\"./mixed_bird/mixed_bird_manual.csv\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -74,6 +74,16 @@
" \"threshold_min\" : 0.0,\n",
" \"window_size\" : 2.0,\n",
" \"chunk_size\" : 5.0\n",
" },\n",
" {\n",
" \"model\" : \"tweetynet\",\n",
" \"tweety_output\": False,\n",
" \"technique\" : \"chunk\",\n",
" \"threshold_type\" : \"median\",\n",
" \"threshold_const\" : 2.0,\n",
" \"threshold_min\" : 0.0,\n",
" \"window_size\" : 2.0,\n",
" \"chunk_size\" : 5.0\n",
" }\n",
"]"
]
@@ -91,7 +101,27 @@
"metadata": {
"scrolled": false
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"No handles with labels found to put in legend.\n",
"C:\\Users\\seanh\\OneDrive\\Desktop\\E4E\\PyHa\\PyHa\\microfaune_package\\microfaune\\audio.py:23: WavFileWarning: Reached EOF prematurely; finished at 1441792 bytes, expected 9202220 bytes from header.\n",
" fs, data = wavfile.read(path)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Error in detection, skipping Ardea-cocoi-414790.wav\n",
"integer division or modulo by zero\n",
"Error in detection, skipping Bartramia-longicauda-507855.wav\n",
"integer division or modulo by zero\n"
]
}
],
"source": [
"spectrogram_visualization(clip_path)\n",
"for i in isolation_parameters: \n",
@@ -154,6 +184,20 @@
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -477,6 +477,7 @@ Usage: `class_statistics(clip_statistics)`
This function produces graphs with the spectrogram of an audio clip. It is now integrated with Pandas so you can visualize human and automated annotations.

| Parameter | Type | Description |
| --- | --- | --- |
| `clip_name` | string | Directory of the clip. |
| `sample_rate` | int | Sample rate of the audio clip, usually 44100. |
| `samples` | list of ints | Each of the samples from the audio clip. |