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 ascii logo to analyzer #500

Merged
merged 2 commits into from
Nov 19, 2024
Merged
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
32 changes: 31 additions & 1 deletion birdnet_analyzer/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@
)
CSV_HEADER = "Start (s),End (s),Scientific name,Common name,Confidence,File\n"
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
ASCII_LOGO = r'''
.
.-=-
.:=++++.
..-======#=:.
.-%%%#*+=-#+++:..
.-+***======++++++=..
.=====+==++++++++-.
.=+++====++++++++++=:.
.++++++++=======----===:
=+++++++====-----+++++++-.
.=++++==========-=++=====+=:.
-++======---:::::-=++++***+:.
..---::::::::::::::::-=*****+-.
..--------::::::::::::--+##-.:.
++++=::::::... ..-------------::::::-::.::.
..::-------:::.-=.:::::+-.... ....:--:..
..::-======--+::...... .:---:.
..:--==+++++==-.. .-+==-
......::----: **=--
..-=-:. *+=:=
..-==== +++ =+**
========+
**=====
***+==
****+
'''


def loadCodes():
Expand Down Expand Up @@ -561,7 +588,7 @@ def analyzeFile(item):
freeze_support()

# Parse arguments
parser = argparse.ArgumentParser(description="Analyze audio files with BirdNET")
parser = argparse.ArgumentParser(description=ASCII_LOGO, formatter_class=argparse.RawDescriptionHelpFormatter, usage="python -m birdnet_analyzer.analyze [options]")
parser.add_argument("--i", default=os.path.join(SCRIPT_DIR, "example/"), help="Path to input file or folder.")
parser.add_argument("--o", default=os.path.join(SCRIPT_DIR, "example/"), help="Path to output folder.")
parser.add_argument("--lat", type=float, default=-1, help="Recording location latitude. Set -1 to ignore.")
Expand Down Expand Up @@ -655,6 +682,9 @@ def __call__(self, parser, args, values, option_string=None):

args = parser.parse_args()

if os.get_terminal_size().columns >= 64:
print(ASCII_LOGO, flush=True)

# Set paths relative to script path (requested in #3)
cfg.MODEL_PATH = os.path.join(SCRIPT_DIR, cfg.MODEL_PATH)
cfg.LABELS_FILE = os.path.join(SCRIPT_DIR, cfg.LABELS_FILE)
Expand Down