Skip to content

Getting Started

brookie edited this page Nov 3, 2026 · 12 revisions

Getting Started


Install

Three ways, depending on how you work: pixi (recommended), pip, or the desktop app (no terminal).

pixi (recommended)

pixi builds a reproducible, cross-platform environment:

pixi init my-annotations
cd my-annotations
pixi add jupyterlab "python>=3.11"          # conda-forge
pixi add --pypi jupyter-bioacoustic          # PyPI
pixi run jupyter lab

Or declare it in pixi.toml / pyproject.toml:

[tool.pixi.dependencies]
python = ">=3.11"
jupyterlab = ">=4.0,<5"

[tool.pixi.pypi-dependencies]
jupyter-bioacoustic = ">=0.9,<1.0"

Python version: if a fresh solve picks a brand-new Python for which a dependency has no wheel yet (the install errors while building something like llvmlite), pin it: python = ">=3.11,<3.14".

pip

pip install jupyter-bioacoustic

Optional: pip install "jupyter-bioacoustic[gcs]" for gs:// audio and output sync, and pip install duckdb for SQL data sources.

Desktop app (no-code)

A double-click download (no terminal, no pip/pixi) for non-technical reviewers — a menu-bar / system-tray app that opens the annotator in the browser. If you use a terminal at all, prefer pixi or pip. Download it from Releases (macOS and Windows zips, unsigned).

Optional jba CLI — the app is self-contained, so add a shell function if you want jba in a terminal:

# macOS (zsh)
cat >> ~/.zshrc <<'EOF'
jba() {
  local d="$HOME/Library/Application Support/JupyterBioacoustic/env/.pixi/envs/default/bin"
  PATH="$d:$PATH" "$d/jba" "$@"
}
EOF
source ~/.zshrc
# Windows (PowerShell) — open a new terminal afterward
Add-Content $PROFILE @'
function jba {
  $e = "$env:LOCALAPPDATA\JupyterBioacoustic\env\.pixi\envs\default"
  $env:PATH = "$e;$e\Scripts;$e\Library\bin;$env:PATH"
  & "$e\Scripts\jba.exe" @args
}
'@

Uninstall — tray icon → Uninstall… (confirms first), or from a terminal (quit the app first):

# macOS
rm -rf ~/Library/Application\ Support/JupyterBioacoustic
rm -rf /Applications/JupyterBioacoustic.app ~/Applications/JupyterBioacoustic.app
rm -f  ~/Applications/"Set JupyterBioacoustic Folder.command" \
       /Applications/"Set JupyterBioacoustic Folder.command"
# Windows (PowerShell)
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\JupyterBioacoustic"
Remove-Item -Force "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Jupyter Bioacoustic.lnk"

Uninstalling removes only the app and the environment it downloaded — your notebooks, data, annotations, and configs in your own folders are left intact. (If you added the jba function, delete it from your ~/.zshrc / PowerShell $PROFILE.)

Troubleshooting — blank or crashed browser tab: if the page opens blank or shows a crashed/grey tab, the app is fine (the tray icon is still running) — it's the browser's renderer, which commonly breaks right after the browser auto-updates. Fully quit your browser and reopen it, then click the tray icon → Open in Browser again. If it persists, clear the browser's GPU cache (Chrome: quit, then remove ~/Library/Application Support/Google/Chrome/*/GPUCache) or use a different browser. The tray's "Page blank or crashed? — Help" item shows these steps.

Remote audio

Remote FLAC and WAV files (s3://, gs://, https://) are read with byte-range requests, so only the clip being played is downloaded and multi-hour recordings open in seconds. Other formats, or a range read that fails, fall back to downloading and caching the whole file. No ffmpeg is needed (earlier versions used it).


Quick Start

LAUNCH JUPYTER LAB

Spectrograms are sent as base64 images over the kernel's IOPub channel, which can exceed Jupyter's default 1 MB/s rate limit. Use jba lab which sets the rate limit automatically, or launch manually with jupyter lab --ServerApp.iopub_data_rate_limit=1e10 (or set c.ServerApp.iopub_data_rate_limit = 1e10 in jupyter_lab_config.py).

jba lab

LAUNCH APP

from jupyter_bioacoustic import BioacousticAnnotator

ba = BioacousticAnnotator(data='detections.csv', audio='recording.flac')

ba.open()       # open the application
ba.source       # the input data as a DataFrame
ba.output()     # the output file as a DataFrame (cached, reloads after each submit)

Running Demo Notebooks

This repo comes with a number of notebooks containing example use cases and configurations. To run the demos launch from the demo/ directory using the demo pixi environment:

cd demo
pixi run -e demo jba lab

Or with pip:

pip install -e ".[demo]"
cd demo
jba lab

Download Audio

JupyterBioacoustic works with both local and remote audio files. To test local files with the demo notebooks you will need to include a file (demo/audio/test-default.flac).

To download an example file run one of the commands below.

This is a large file. It will likely take multiple minutes to download.

With AWS CLI (faster)

mkdir -p audio
aws s3 cp s3://dse-soundhub/public/audio/dev/20230522_200000.flac audio/test-default.flac --no-sign-request
wait

With curl

mkdir -p audio
curl -o audio/test-default.flac https://dse-soundhub.s3.us-west-2.amazonaws.com/public/audio/dev/20230522_200000.flac

Next Steps

Clone this wiki locally