Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kahst committed Aug 28, 2024
2 parents 7de9b6c + 950839f commit 62379c7
Show file tree
Hide file tree
Showing 21 changed files with 637 additions and 415 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ foo*
installers/
desktop.ini
*.iss
*deploy*
*hook*

# Custom classifier
checkpoints/custom/
Expand All @@ -34,7 +36,7 @@ __pycache__/

# Distribution / packaging
.Python
build/
build*
develop-eggs/
dist/
downloads/
Expand All @@ -58,8 +60,6 @@ MANIFEST
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
!BirdNET-Analyzer-mac.spec
!BirdNET-Analyzer-win.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -161,4 +161,5 @@ train_data/
train_cache.npz
autotune/

gui-settings.json
gui-settings.json
state.json
65 changes: 0 additions & 65 deletions BirdNET-Analyzer-mac.spec

This file was deleted.

122 changes: 0 additions & 122 deletions BirdNET-Analyzer-win.spec

This file was deleted.

4 changes: 3 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ source venv-birdnet/bin/activate
python -m pip install -U pip
----

WARNING: :exclamation:**Make sure that you are using Python 3.10, if not install it from the https://www.python.org/downloads/release/python-3100/[Python website].**:exclamation:

The nexttime you want to use BirdNET, go to the BirdNET-Analyzer folder and run `source venv-birdnet/bin/activate` to activate the virtual environment.

==== Install dependencies
Expand Down Expand Up @@ -775,7 +777,7 @@ Due to these custom labels, the location filter and locale will be disabled.

== Segment review

Please read the excellent paper from Connor M. Woods: https://scholar.google.com/citations?view_op=view_citation&hl=en&user=Uwta4wYAAAAJ&sortby=pubdate&citation_for_view=Uwta4wYAAAAJ:j3f4tGmQtD8C[Guidelines for appropriate use of BirdNET scores and other detector outputs].
Please read the excellent paper from Connor M. Wood and Stefan Kahl: https://scholar.google.com/citations?view_op=view_citation&hl=en&user=Uwta4wYAAAAJ&sortby=pubdate&citation_for_view=Uwta4wYAAAAJ:j3f4tGmQtD8C[Guidelines for appropriate use of BirdNET scores and other detector outputs].


The *Review* tab in the GUI is an implementation of the workflow described in the paper. It allows you to review the segments that were detected by BirdNET and to label the segments manually. This can helb you to choose an appropriate threshold for your specific use case.
Expand Down
19 changes: 7 additions & 12 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ def generate_raven_table(timestamps: list[str], result: dict[str, list], afile_p
out_string += (
f"{selection_id}\tSpectrogram 1\t1\t0\t3\t{low_freq}\t{high_freq}\tnocall\tnocall\t1.0\t{afile_path}\t0\n"
)

with open(result_path, "w", encoding="utf-8") as rfile:
rfile.write(out_string)

utils.save_result_file(result_path, out_string)


def generate_audacity(timestamps: list[str], result: dict[str, list], result_path: str) -> str:
Expand All @@ -97,8 +96,7 @@ def generate_audacity(timestamps: list[str], result: dict[str, list], result_pat
# Write result string to file
out_string += rstring

with open(result_path, "w", encoding="utf-8") as rfile:
rfile.write(out_string)
utils.save_result_file(result_path, out_string)


def generate_rtable(timestamps: list[str], result: dict[str, list], afile_path: str, result_path: str) -> str:
Expand All @@ -111,7 +109,7 @@ def generate_rtable(timestamps: list[str], result: dict[str, list], afile_path:
for c in result[timestamp]:
if c[1] > cfg.MIN_CONFIDENCE and (not cfg.SPECIES_LIST or c[0] in cfg.SPECIES_LIST):
label = cfg.TRANSLATED_LABELS[cfg.LABELS.index(c[0])]
rstring += "\n{},{},{},{},{},{:.4f},{:.4f},{:.4f},{},{},{},{},{},{}".format(
rstring += "{},{},{},{},{},{:.4f},{:.4f},{:.4f},{},{},{},{},{},{}\n".format(
afile_path,
start,
end,
Expand All @@ -131,8 +129,7 @@ def generate_rtable(timestamps: list[str], result: dict[str, list], afile_path:
# Write result string to file
out_string += rstring

with open(result_path, "w", encoding="utf-8") as rfile:
rfile.write(out_string)
utils.save_result_file(result_path, out_string)


def generate_kaleidoscope(timestamps: list[str], result: dict[str, list], afile_path: str, result_path: str) -> str:
Expand Down Expand Up @@ -167,8 +164,7 @@ def generate_kaleidoscope(timestamps: list[str], result: dict[str, list], afile_
# Write result string to file
out_string += rstring

with open(result_path, "w", encoding="utf-8") as rfile:
rfile.write(out_string)
utils.save_result_file(result_path, out_string)


def generate_csv(timestamps: list[str], result: dict[str, list], afile_path: str, result_path: str) -> str:
Expand All @@ -187,8 +183,7 @@ def generate_csv(timestamps: list[str], result: dict[str, list], afile_path: str
# Write result string to file
out_string += rstring

with open(result_path, "w", encoding="utf-8") as rfile:
rfile.write(out_string)
utils.save_result_file(result_path, out_string)


def saveResultFiles(r: dict[str, list], result_files: dict[str, str], afile_path: str):
Expand Down
7 changes: 2 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# Misc settings #
#################

# GUI version
GUI_VERSION: str = "1.2.0"

# Random seed for gaussian noise
RANDOM_SEED: int = 42

Expand Down Expand Up @@ -112,8 +109,8 @@
# 'csv' denotes a generic CSV file with start, end, species and confidence.
RESULT_TYPES: set[str] | list[str] = {"table"}
OUTPUT_RAVEN_FILENAME: str = "BirdNET_SelectionTable.txt" # this is for combined Raven selection tables only
OUTPUT_RTABLE_FILENAME: str = "BirdNET_RTable.txt"
OUTPUT_KALEIDOSCOPE_FILENAME: str = "BirdNET_Kaleidoscope.txt"
OUTPUT_RTABLE_FILENAME: str = "BirdNET_RTable.csv"
OUTPUT_KALEIDOSCOPE_FILENAME: str = "BirdNET_Kaleidoscope.csv"
OUTPUT_CSV_FILENAME: str = "BirdNET_CombinedTable.csv"

# Whether to skip existing results in the output path
Expand Down
30 changes: 0 additions & 30 deletions deploy.py

This file was deleted.

3 changes: 0 additions & 3 deletions extra-hooks/hook-gradio.py

This file was deleted.

3 changes: 0 additions & 3 deletions extra-hooks/hook-gradio_client.py

This file was deleted.

3 changes: 0 additions & 3 deletions extra-hooks/hook-librosa.py

This file was deleted.

Loading

0 comments on commit 62379c7

Please sign in to comment.