Skip to content

CLI Reference

The full bioamla command tree, generated from the CLI itself (--help), so it always matches the installed version.

bioamla

BioAMLA - Bioacoustic & Machine Learning Applications

Use 'bioamla COMMAND --help' for more information on a command.

Usage:

bioamla [OPTIONS] COMMAND [ARGS]...

Options:

  --version  Show the version and exit.
  --help     Show this message and exit.

annotation

Annotation management commands for audio datasets.

Usage:

bioamla annotation [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

convert

Convert annotation files between formats.

Usage:

bioamla annotation convert [OPTIONS] INPUT_FILE OUTPUT_FILE

Options:

  --from [raven|csv|bioamla]  Input format (auto-detected from extension if
                              not specified)
  --to [raven|csv|bioamla]    Output format (auto-detected from extension if
                              not specified)
  --label-column TEXT         Column name for labels in input file
  -q, --quiet                 Suppress progress output
  --help                      Show this message and exit.

filter

Filter annotations by label or duration.

Usage:

bioamla annotation filter [OPTIONS] INPUT_FILE OUTPUT_FILE

Options:

  -i, --include TEXT    Labels to include (can specify multiple)
  -e, --exclude TEXT    Labels to exclude (can specify multiple)
  --min-duration FLOAT  Minimum duration in seconds
  --max-duration FLOAT  Maximum duration in seconds
  -q, --quiet           Suppress progress output
  --help                Show this message and exit.

generate-frame-labels

Generate frame-level multi-hot labels from annotations (for SED-style models).

Usage:

bioamla annotation generate-frame-labels [OPTIONS] ANNOTATION_FILE OUTPUT_FILE

Options:

  --frame-size FLOAT      Frame size in seconds  [required]
  --hop-length FLOAT      Hop length between frames in seconds (default: same
                          as frame size)
  --audio-duration FLOAT  Total audio duration in seconds (inferred from
                          bioamla metadata if omitted)
  --format [csv|numpy]    Output format for labels
  -q, --quiet             Suppress progress output
  --help                  Show this message and exit.

generate-labels

Generate clip-level labels from annotations.

Usage:

bioamla annotation generate-labels [OPTIONS] ANNOTATION_FILE OUTPUT_FILE

Options:

  --audio-duration FLOAT          Total audio duration in seconds (inferred
                                  from bioamla metadata if omitted)
  --clip-duration FLOAT           Duration of each clip in seconds  [required]
  --hop-length FLOAT              Hop length between clips (default: same as
                                  clip duration)
  --min-overlap FLOAT             Minimum overlap ratio to assign label
                                  (0.0-1.0)
  --multi-label / --single-label  Generate multi-label or single-label output
  --format [csv|numpy]            Output format for labels
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

remap

Remap annotation labels using a mapping file.

Usage:

bioamla annotation remap [OPTIONS] INPUT_FILE OUTPUT_FILE

Options:

  -m, --mapping TEXT              Path to label mapping CSV (columns: source,
                                  target)  [required]
  --keep-unmapped / --drop-unmapped
                                  Keep or drop annotations with unmapped
                                  labels
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

summary

Display summary statistics for an annotation file.

Usage:

bioamla annotation summary [OPTIONS] PATH

Options:

  --format [raven|csv|bioamla]  Annotation format (auto-detected from
                                extension if not specified)
  --json                        Output as JSON
  --help                        Show this message and exit.

template

Generate a starter annotation file from an audio file.

Reads the recording's duration and sample rate and writes a skeleton annotation file pre-filled with that metadata plus (unless --empty) a single placeholder row spanning the whole file, ready to edit. The bioamla (.json) format stores the audio metadata in the file; raven/csv hold the rows only.

Usage:

bioamla annotation template [OPTIONS] AUDIO_FILE OUTPUT_FILE

Options:

  --format [raven|csv|bioamla]  Output format (auto-detected from extension if
                                not specified)
  --label TEXT                  Label for the placeholder full-file row
  --empty                       Write metadata only, with no placeholder row
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.

audio

Audio file operations (info, convert, segment, visualize).

Usage:

bioamla audio [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

add-noise

Add Gaussian white noise at a target SNR.

Usage:

bioamla audio add-noise [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  --snr-db FLOAT  Target SNR in dB (lower = more noise)  [required]
  --seed INTEGER  RNG seed for reproducible noise
  --help          Show this message and exit.

convert

Convert audio file format or properties.

Usage:

bioamla audio convert [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -r, --sample-rate INTEGER       Target sample rate
  -c, --channels INTEGER          Target number of channels
  -b, --bit-depth INTEGER         Target bit depth
  -f, --format [wav|mp3|flac|ogg]
                                  Output format
  --help                          Show this message and exit.

denoise

Apply spectral noise reduction to audio file.

Usage:

bioamla audio denoise [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  --strength FLOAT  Noise reduction strength (0-2, default: 1.0)
  --help            Show this message and exit.

filter

Apply frequency filter to audio file.

Usage:

bioamla audio filter [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  --lowpass FLOAT        Lowpass cutoff frequency in Hz
  --highpass FLOAT       Highpass cutoff frequency in Hz
  --bandpass-low FLOAT   Bandpass low frequency in Hz
  --bandpass-high FLOAT  Bandpass high frequency in Hz
  --order INTEGER        Filter order (default: 5)
  --help                 Show this message and exit.

gain

Apply a fixed gain (dB) to audio.

Usage:

bioamla audio gain [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  --gain-db FLOAT  Gain in dB (positive amplifies)  [required]
  --help           Show this message and exit.

info

Display audio file information.

Usage:

bioamla audio info [OPTIONS] PATH

Options:

  --help  Show this message and exit.

list

List audio files in a directory.

Usage:

bioamla audio list [OPTIONS] PATH

Options:

  -r, --recursive / --no-recursive
                                  Search subdirectories (default: recursive)
  --help                          Show this message and exit.

normalize

Normalize audio amplitude.

Usage:

bioamla audio normalize [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -t, --target-db FLOAT    Target peak level in dB
  -m, --method [peak|rms]  Method
  --help                   Show this message and exit.

pitch-shift

Shift pitch up/down without changing duration.

Usage:

bioamla audio pitch-shift [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -n, --steps FLOAT  Semitones to shift (positive raises pitch)  [required]
  --help             Show this message and exit.

play

Play an audio file through the default output device.

Blocks until playback finishes; press Ctrl-C to stop.

Usage:

bioamla audio play [OPTIONS] PATH

Options:

  -l, --loop  Loop continuously until interrupted
  --help      Show this message and exit.

resample

Resample audio to a different sample rate.

Usage:

bioamla audio resample [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -r, --sample-rate INTEGER  Target sample rate in Hz  [required]
  --help                     Show this message and exit.

segment

Segment audio file into fixed-duration clips.

Usage:

bioamla audio segment [OPTIONS] INPUT_PATH OUTPUT_DIR

Options:

  -d, --duration-seconds FLOAT    Segment duration in seconds (default: 3.0)
  -o, --overlap FLOAT             Overlap between segments in seconds
                                  (default: 0.0)
  -f, --format [wav|mp3|flac|ogg]
                                  Output format (default: wav)
  -p, --prefix TEXT               Prefix for output filenames (default: input
                                  filename)
  --help                          Show this message and exit.

time-stretch

Time-stretch audio without changing pitch.

Usage:

bioamla audio time-stretch [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -r, --rate FLOAT  Stretch factor (>1 faster, <1 slower)  [required]
  --help            Show this message and exit.

trim

Trim audio file to specified time range.

Usage:

bioamla audio trim [OPTIONS] INPUT_PATH OUTPUT_PATH

Options:

  -s, --start FLOAT             Start time in seconds
  -e, --end FLOAT               End time in seconds
  -d, --duration-seconds FLOAT  Duration in seconds
  --help                        Show this message and exit.

visualize

Generate audio visualization (spectrogram, waveform, MFCC) for a single file.

Examples: # Mel spectrogram (default), auto-named _mel.png bioamla audio visualize rec.wav # Linear STFT spectrogram to a chosen path bioamla audio visualize rec.wav --type stft -o spec.png # Waveform plot bioamla audio visualize rec.wav --type waveform -o wave.png

Usage:

bioamla audio visualize [OPTIONS] PATH

Options:

  -o, --output TEXT               Output image file path
  -t, --type [mel|stft|mfcc|waveform]
                                  Visualization type
  --n-fft INTEGER                 FFT window size
  --hop-length INTEGER            Hop length
  --n-mels INTEGER                Number of mel bands
  --n-mfcc INTEGER                Number of MFCCs
  --cmap TEXT                     Colormap name
  --dpi INTEGER                   Output DPI
  --legend / --no-legend          Show axes, title, and colorbar (default:
                                  True)
  --help                          Show this message and exit.

batch

Batch processing operations for multiple files.

Usage:

bioamla batch [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

audio

Batch audio processing operations.

Usage:

bioamla batch audio [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
convert

Batch convert audio files to a target format (optionally resample/re-channel).

Usage:

bioamla batch audio convert [OPTIONS]

Options:

  --input-dir DIRECTORY           Input directory for batch processing
  --input-file FILE               Input metadata CSV file (must have file_name
                                  column)
  --output-dir PATH               Output directory
  -r, --sample-rate INTEGER       Target sample rate
  -c, --channels INTEGER          Target number of channels
  -f, --format [wav|mp3|flac|ogg]
                                  Output format
  --delete-original               Delete original files after successful
                                  conversion
  -w, --max-workers INTEGER       Number of parallel workers
  --recursive / --no-recursive    Search subdirectories
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.
denoise

Batch apply spectral noise reduction to audio files.

Usage:

bioamla batch audio denoise [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --strength FLOAT              Noise reduction strength (0-2)
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
filter

Batch apply frequency filters to audio files.

Usage:

bioamla batch audio filter [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --lowpass FLOAT               Lowpass cutoff frequency in Hz
  --highpass FLOAT              Highpass cutoff frequency in Hz
  --bandpass-low FLOAT          Bandpass low frequency in Hz
  --bandpass-high FLOAT         Bandpass high frequency in Hz
  --order INTEGER               Filter order (default: 5)
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
info

Extract audio file metadata (duration, sample rate, channels, format, etc.).

Usage:

bioamla batch audio info [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
normalize

Batch normalize audio levels.

Usage:

bioamla batch audio normalize [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  -d, --target-db FLOAT         Target loudness in dB
  --peak                        Use peak normalization instead of RMS
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
resample

Batch resample audio files to a target sample rate.

Usage:

bioamla batch audio resample [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  -r, --sample-rate INTEGER     Target sample rate in Hz  [required]
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
segment

Batch segment audio files into fixed-duration chunks.

Usage:

bioamla batch audio segment [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  -d, --duration-seconds FLOAT  Segment duration in seconds  [required]
  -o, --overlap FLOAT           Overlap between segments in seconds
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
trim

Batch trim audio files by time range or remove silence.

Usage:

bioamla batch audio trim [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  -s, --start FLOAT             Start time in seconds
  -e, --end FLOAT               End time in seconds
  --trim-silence                Trim silence from start/end instead of time
                                range
  --silence-threshold-db FLOAT  Silence threshold in dB (with --trim-silence)
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
visualize

Batch generate audio visualizations.

Usage:

bioamla batch audio visualize [OPTIONS]

Options:

  --input-dir DIRECTORY           Input directory for batch processing
  --input-file FILE               Input metadata CSV file (must have file_name
                                  column)
  --output-dir PATH               Output directory
  -t, --plot-type [mel|stft|mfcc|waveform]
                                  Visualization type
  --legend / --no-legend          Show axes, title, and colorbar
  -w, --max-workers INTEGER       Number of parallel workers
  --recursive / --no-recursive    Search subdirectories
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

cluster

Batch cluster embedding files from a directory or a metadata CSV.

Usage:

bioamla batch cluster [OPTIONS]

Options:

  --input-dir DIRECTORY           Input directory for batch processing
  --input-file FILE               Input metadata CSV file (must have file_name
                                  column)
  --output-dir PATH               Output directory
  --method [hdbscan|kmeans|dbscan|agglomerative]
                                  Clustering method
  --n-clusters INTEGER            Number of clusters (k-means/agglomerative)
  --min-cluster-size INTEGER      Minimum cluster size (HDBSCAN)
  --min-samples INTEGER           Minimum samples per cluster
  -w, --max-workers INTEGER       Number of parallel workers
  --recursive / --no-recursive    Search subdirectories
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

detect

Batch detection operations.

Usage:

bioamla batch detect [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
accelerating

Batch detect accelerating or decelerating call patterns.

Usage:

bioamla batch detect accelerating [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --min-pulses INTEGER          Minimum pulses to detect pattern
  --accel-threshold FLOAT       Acceleration threshold
  --decel-threshold FLOAT       Deceleration threshold
  --low-freq FLOAT              Low frequency bound (Hz)
  --high-freq FLOAT             High frequency bound (Hz)
  --window-seconds FLOAT        Analysis window in seconds
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
energy

Batch detect sounds using band-limited energy detection.

Usage:

bioamla batch detect energy [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --low-freq FLOAT              Low frequency bound (Hz)
  --high-freq FLOAT             High frequency bound (Hz)
  --threshold-db FLOAT          Detection threshold (dB)
  --min-duration FLOAT          Minimum detection duration (s)
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
peaks

Batch detect peaks using Continuous Wavelet Transform.

Usage:

bioamla batch detect peaks [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --snr-threshold FLOAT         Signal-to-noise ratio threshold
  --min-peak-distance FLOAT     Minimum peak distance (s)
  --low-freq FLOAT              Low frequency bound (Hz)
  --high-freq FLOAT             High frequency bound (Hz)
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.
ribbit

Batch detect periodic calls using RIBBIT algorithm.

Usage:

bioamla batch detect ribbit [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --pulse-rate FLOAT            Expected pulse rate (Hz)
  --pulse-tolerance FLOAT       Pulse rate tolerance
  --low-freq FLOAT              Low frequency bound (Hz)
  --high-freq FLOAT             High frequency bound (Hz)
  --window-seconds FLOAT        Analysis window in seconds
  --min-score FLOAT             Minimum detection score
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.

index

Batch calculate acoustic indices for audio files.

Usage:

bioamla batch index [OPTIONS]

Options:

  --input-dir DIRECTORY         Input directory for batch processing
  --input-file FILE             Input metadata CSV file (must have file_name
                                column)
  --output-dir PATH             Output directory
  --indices TEXT                Comma-separated indices
  -w, --max-workers INTEGER     Number of parallel workers
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.

models

Batch model operations (AST-only).

Usage:

bioamla batch models [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
embed

Batch extract embeddings from audio files.

Usage:

bioamla batch models embed [OPTIONS]

Options:

  --input-dir DIRECTORY           Input directory for batch processing
  --input-file FILE               Input metadata CSV file (must have file_name
                                  column)
  --output-dir PATH               Output directory
  -m, --model, --model-path TEXT  Model path (HuggingFace ID or local path)
                                  [required]
  -w, --max-workers INTEGER       Number of parallel workers
  --recursive / --no-recursive    Search subdirectories
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.
predict

Batch run AST model predictions on audio files (whole file or in segments).

With --segment-duration each file is split into fixed-length (optionally overlapping) segments and classified per segment: directory mode writes a flat predictions.csv (one row per segment) to --output-dir; CSV-metadata mode expands each input row into one row per segment.

Usage:

bioamla batch models predict [OPTIONS]

Options:

  --input-dir DIRECTORY           Input directory for batch processing
  --input-file FILE               Input metadata CSV file (must have file_name
                                  column)
  --output-dir PATH               Output directory
  -m, --model, --model-path TEXT  Model path (HuggingFace ID or local path)
                                  [required]
  --top-k INTEGER                 Number of top predictions to return
  --min-confidence FLOAT          Minimum confidence threshold
  --segment-seconds INTEGER       Split each file into N-second segments and
                                  classify each (0 = whole file)
  --overlap INTEGER               Overlap between segments (seconds)
  -w, --max-workers INTEGER       Number of parallel workers
  --recursive / --no-recursive    Search subdirectories
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

catalogs

Access bioacoustic data catalogs and external services.

Usage:

bioamla catalogs [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

ebird

eBird bird observation data and taxonomy.

Usage:

bioamla catalogs ebird [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
nearby

Get recent eBird observations near a location.

Usage:

bioamla catalogs ebird nearby [OPTIONS]

Options:

  --lat FLOAT        Latitude  [required]
  --lng FLOAT        Longitude  [required]
  --api-key TEXT     eBird API key (or set EBIRD_API_KEY)  [required]
  --distance FLOAT   Search radius in km
  --days INTEGER     Days back to search
  --limit INTEGER    Maximum results
  -o, --output TEXT  Output CSV file
  --help             Show this message and exit.

Fuzzy search eBird taxonomy for species.

Usage:

bioamla catalogs ebird search [OPTIONS] QUERY

Options:

  -n, --limit INTEGER  Maximum results
  --help               Show this message and exit.
species

Look up species in eBird taxonomy.

NAME can be a common name, scientific name, or species code.

Usage:

bioamla catalogs ebird species [OPTIONS] NAME

Options:

  --help  Show this message and exit.
validate

Validate if a species is expected at a location.

Usage:

bioamla catalogs ebird validate [OPTIONS] SPECIES_CODE

Options:

  --lat FLOAT       Latitude  [required]
  --lng FLOAT       Longitude  [required]
  --api-key TEXT    eBird API key (or set EBIRD_API_KEY)  [required]
  --distance FLOAT  Search radius in km
  --help            Show this message and exit.

hf

HuggingFace Hub model and dataset management.

Usage:

bioamla catalogs hf [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
cache

Inspect or purge the local HuggingFace cache (datasets/models).

Datasets and models pulled/loaded from the Hub are cached so repeat grabs are fast. Lists the cache by default; pass --purge to reclaim the space.

Examples: bioamla catalogs hf cache # list everything cached bioamla catalogs hf cache --datasets --purge -y # free dataset cache

Usage:

bioamla catalogs hf cache [OPTIONS]

Options:

  --models    Target cached models
  --datasets  Target cached datasets
  --all       Target both models and datasets
  --purge     Delete the matched cache (default: list)
  -y, --yes   Skip the confirmation prompt when purging
  --help      Show this message and exit.
pull-dataset

Pull a HuggingFace audio dataset into the local labeled-folder layout.

Materializes REPO_ID (e.g. ashraq/esc-50) under DEST as label subdirs and a metadata.csv, ready for dataset partition / models ast train.

Usage:

bioamla catalogs hf pull-dataset [OPTIONS] REPO_ID DEST

Options:

  --split TEXT                    Single split to pull (default: all splits)
  --config TEXT                   Dataset config/subset name (e.g. HSN for
                                  BirdSet)
  --audio-column TEXT             Override the auto-detected audio column
  --label-column TEXT             Override the auto-detected label column
  --sample-rate INTEGER           Resample clips to this rate (0 to keep
                                  source)
  --layout [both|audiofolder|flat]
                                  Output layout: label subdirs + metadata.csv
                                  (both), subdirs only, or flat
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.
push-dataset

Push a dataset folder to the HuggingFace Hub.

When --card is set (default) and the folder has a dataset.json manifest or a metadata.csv, a README.md dataset card is generated first; folders without either are pushed as-is.

Usage:

bioamla catalogs hf push-dataset [OPTIONS] PATH REPO_ID

Options:

  --private / --public   Make the repository private (default: public)
  --commit-message TEXT  Custom commit message for the push
  --card / --no-card     Write a README.md dataset card from the
                         manifest/metadata before pushing
  --help                 Show this message and exit.
push-model

Push a model folder to the HuggingFace Hub.

Usage:

bioamla catalogs hf push-model [OPTIONS] PATH REPO_ID

Options:

  --private / --public   Make the repository private (default: public)
  --commit-message TEXT  Custom commit message for the push
  --help                 Show this message and exit.

inat

iNaturalist observation database.

Usage:

bioamla catalogs inat [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
download

Download audio observations from iNaturalist.

Usage:

bioamla catalogs inat download [OPTIONS] OUTPUT_DIR

Options:

  -t, --taxon-ids TEXT            Comma-separated taxon IDs
  -n, --taxon-name TEXT           Taxon name to search for
  -p, --place-id INTEGER          iNaturalist place ID
  --project-id TEXT               iNaturalist project slug or ID
  -q, --quality-grade [research|needs_id|casual|any]
                                  Quality grade filter
  -l, --license TEXT              Filter by sound license(s) (comma-separated:
                                  cc0, cc-by, cc-by-nc, cc-by-sa, cc-by-nd,
                                  cc-by-nc-sa, cc-by-nc-nd)
  -d1, --start-date TEXT          Start date for observations (YYYY-MM-DD)
  -d2, --end-date TEXT            End date for observations (YYYY-MM-DD)
  --obs-per-taxon INTEGER         Max observations per taxon
  --quiet                         Suppress progress output
  --help                          Show this message and exit.
search

Search for iNaturalist observations.

Usage:

bioamla catalogs inat search [OPTIONS]

Options:

  -s, --species TEXT      Species scientific name to filter by
  -t, --taxon-id INTEGER  iNaturalist taxon ID
  -p, --place-id INTEGER  iNaturalist place ID
  --project-id TEXT       iNaturalist project slug or ID
  --quality-grade TEXT    Quality grade: research, needs_id, or casual
  --has-sounds            Only show observations with sounds
  --limit INTEGER         Maximum number of results
  -o, --output TEXT       Output file path for CSV (optional)
  -q, --quiet             Suppress progress output
  --help                  Show this message and exit.
stats

Get statistics for an iNaturalist project.

Usage:

bioamla catalogs inat stats [OPTIONS] PROJECT_ID

Options:

  -o, --output TEXT  Output file path for JSON (optional)
  -q, --quiet        Suppress progress output, print only JSON
  --help             Show this message and exit.

ml

Macaulay Library audio recordings database.

Use 'catalogs ebird species' or 'catalogs ebird search' to look up species codes.

Usage:

bioamla catalogs ml [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
download

Download recordings from Macaulay Library.

Requires at least one filter: species-code, scientific-name, common-name, region, taxon-code, or hotspot-code.

Use 'catalogs ebird species ' to look up species codes.

Usage:

bioamla catalogs ml download [OPTIONS]

Options:

  -s, --species-code TEXT       eBird species code (e.g., amerob)
  --scientific-name TEXT        Scientific name
  --common-name TEXT            Common name
  -r, --region TEXT             Region code (e.g., US-NY)
  --country TEXT                Country code (e.g., US)
  --taxon-code TEXT             eBird taxon code for broader searches
  --hotspot-code TEXT           eBird hotspot code
  --min-rating INTEGER          Minimum quality rating (default: 3)
  -n, --max-recordings INTEGER  Maximum recordings to download
  -o, --output-dir TEXT         Output directory
  --help                        Show this message and exit.
search

Search Macaulay Library for audio recordings.

Requires at least one filter: species-code, scientific-name, common-name, region, taxon-code, or hotspot-code.

Use 'catalogs ebird species ' to look up species codes.

Usage:

bioamla catalogs ml search [OPTIONS]

Options:

  -s, --species-code TEXT    eBird species code (e.g., amerob)
  --scientific-name TEXT     Scientific name
  --common-name TEXT         Common name
  -r, --region TEXT          Region code (e.g., US-NY)
  --country TEXT             Country code (e.g., US)
  --taxon-code TEXT          eBird taxon code for broader searches
  --hotspot-code TEXT        eBird hotspot code
  --min-rating INTEGER       Minimum quality rating (1-5)
  -n, --max-results INTEGER  Maximum results
  --format [table|json]      Output format
  --help                     Show this message and exit.

xc

Xeno-canto bird recording database.

Usage:

bioamla catalogs xc [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
download

Download recordings from Xeno-canto.

Usage:

bioamla catalogs xc download [OPTIONS]

Options:

  -s, --species TEXT            Species name (scientific or common)
  -g, --genus TEXT              Genus name
  -c, --country TEXT            Country name
  -q, --quality TEXT            Recording quality filter (default: A)
  -n, --max-recordings INTEGER  Maximum recordings to download
  -o, --output-dir TEXT         Output directory
  --delay FLOAT                 Delay between downloads in seconds
  --help                        Show this message and exit.
search

Search Xeno-canto for bird recordings.

Examples: # Songs of a species in the US, top 20 bioamla catalogs xc search --species "Turdus migratorius" \ --country "United States" --type song --max-results 20 # By genus, JSON output for scripting bioamla catalogs xc search --genus Turdus --quality A --format json

Usage:

bioamla catalogs xc search [OPTIONS]

Options:

  -s, --species TEXT         Species name (scientific or common)
  -g, --genus TEXT           Genus name
  -c, --country TEXT         Country name
  -q, --quality TEXT         Recording quality (A, B, C, D, E)
  --type TEXT                Sound type (song, call, etc.)
  -n, --max-results INTEGER  Maximum results
  --format [table|json|csv]  Output format
  --help                     Show this message and exit.

cluster

Clustering and dimensionality reduction commands.

Usage:

bioamla cluster [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

analyze

Analyze cluster quality.

Usage:

bioamla cluster analyze [OPTIONS] EMBEDDINGS_FILE LABELS_FILE

Options:

  -o, --output TEXT  Output JSON file for analysis results
  -q, --quiet        Suppress output
  --help             Show this message and exit.

fit

Cluster embeddings.

Usage:

bioamla cluster fit [OPTIONS] EMBEDDINGS_FILE

Options:

  -o, --output TEXT               Output file for cluster labels  [required]
  -m, --method [hdbscan|kmeans|dbscan|agglomerative]
                                  Clustering method (hdbscan finds clusters
                                  without a preset count)
  -k, --n-clusters INTEGER        Number of clusters (for
                                  k-means/agglomerative)
  --min-cluster-size INTEGER      Minimum cluster size (HDBSCAN)
  --eps FLOAT                     DBSCAN epsilon
  --min-samples INTEGER           Minimum samples per cluster
  -q, --quiet                     Suppress output
  --help                          Show this message and exit.

novelty

Detect novel sounds in embeddings.

Usage:

bioamla cluster novelty [OPTIONS] EMBEDDINGS_FILE

Options:

  -o, --output TEXT               Output file for novelty results  [required]
  -m, --method [distance|isolation_forest|lof]
                                  Novelty detection method
  --threshold FLOAT               Novelty threshold
  --labels TEXT                   Optional cluster labels file
  -q, --quiet                     Suppress output
  --help                          Show this message and exit.

reduce

Reduce dimensionality of embeddings.

Usage:

bioamla cluster reduce [OPTIONS] EMBEDDINGS_FILE

Options:

  -o, --output TEXT             Output file for reduced embeddings  [required]
  -m, --method [umap|tsne|pca]  Reduction method
  -n, --n-components INTEGER    Number of output dimensions
  -q, --quiet                   Suppress output
  --help                        Show this message and exit.

dataset

Dataset management commands.

Usage:

bioamla dataset [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

augment

Augment audio files to expand training datasets.

Each enabled transform takes a range; ranges are sampled per output copy. This writes new augmented files (offline) — distinct from models ast train's on-the-fly augmentation.

Examples: # Two noisy + pitch-shifted copies per file bioamla dataset augment ./clips -o ./aug \ --add-noise 3-30 --pitch-shift -2,2 --multiply 2 # Time-stretch only bioamla dataset augment ./clips -o ./aug --time-stretch 0.9-1.1

Usage:

bioamla dataset augment [OPTIONS] INPUT_DIR

Options:

  -o, --output TEXT             Output directory for augmented files
                                [required]
  --add-noise TEXT              Add Gaussian noise with SNR range (e.g.,
                                "3-30" dB)
  --time-stretch TEXT           Time stretch range (e.g., "0.8-1.2")
  --pitch-shift TEXT            Pitch shift range in semitones (e.g., "-2,2")
  --gain TEXT                   Gain range in dB (e.g., "-12,12")
  --multiply INTEGER            Number of augmented copies to create per file
  --sample-rate INTEGER         Target sample rate for output
  --recursive / --no-recursive  Search subdirectories
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.

build

Build a training-ready dataset: extract clips, partition, and write a manifest.

Chains extract-clips (layout=both) -> partition (subdirs) -> manifest, producing a dataset directory + dataset.json consumable by models ast train. License/attribution joined from the source catalog metadata is written to ATTRIBUTIONS.md (unless --no-attributions).

Examples: # Annotated recordings dir -> train-ready dataset bioamla dataset build ./recordings ./dataset --sample-rate 16000 # Keep two labels and set an 80/10/10 train/val/test split bioamla dataset build ./recordings ./dataset \ --include frog --include bird --train 0.8 --val 0.1 --test 0.1

Usage:

bioamla dataset build [OPTIONS] SOURCE OUTPUT_DIR

Options:

  --annotations TEXT              Annotation file when SOURCE is a single
                                  audio file (else a sibling file is used)
  --padding-ms FLOAT              Padding before/after each clip (ms)
  --bandpass / --no-bandpass      Bandpass-filter clips to each annotation's
                                  frequency band
  --sample-rate INTEGER           Resample clips to this rate (e.g. 16000 for
                                  AST)
  -i, --include TEXT              Labels to include (repeatable)
  -e, --exclude TEXT              Labels to exclude (repeatable)
  --min-duration FLOAT            Drop clips shorter than this (s)
  --train FLOAT                   Train fraction
  --val FLOAT                     Validation fraction
  --test FLOAT                    Test fraction
  --seed INTEGER                  Reproducible shuffle seed
  --no-partition                  Extract clips but skip train/val/test split
  --name TEXT                     Dataset name for the manifest (defaults to
                                  dir name)
  --source-metadata TEXT          Catalog metadata.csv to join
                                  license/attribution onto clips (auto-
                                  detected as a metadata.csv sibling of SOURCE
                                  when omitted)
  --attributions / --no-attributions
                                  Write ATTRIBUTIONS.md from joined clip
                                  provenance (skipped if none)
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

extract-clips

Extract annotated regions into a labeled clip dataset (training-ready).

SOURCE is an audio file (with --annotations or a sibling annotation file) or a directory of audio files each paired with a sibling annotation. The output is consumable by bioamla models ast train directly (label subdirs and/or a metadata.csv). License/attribution is joined from the source catalog metadata.csv (auto-detected, or via --source-metadata) so clips stay traceable to their original recordings.

Usage:

bioamla dataset extract-clips [OPTIONS] SOURCE OUTPUT_DIR

Options:

  --annotations TEXT              Annotation file when SOURCE is a single
                                  audio file (else a sibling file is used)
  --layout [both|audiofolder|flat]
                                  Output layout: label subdirs + metadata.csv
                                  (both), subdirs only, or flat + metadata.csv
  --padding-ms FLOAT              Padding before/after each clip (ms)
  --bandpass / --no-bandpass      Bandpass-filter clips to each annotation's
                                  frequency band
  --format TEXT                   Output audio format
  --sample-rate INTEGER           Resample clips to this rate (e.g. 16000 for
                                  AST)
  -i, --include TEXT              Labels to include (repeatable)
  -e, --exclude TEXT              Labels to exclude (repeatable)
  --min-duration FLOAT            Drop clips shorter than this (s)
  --source-metadata TEXT          Catalog metadata.csv to join
                                  license/attribution onto clips (auto-
                                  detected as a metadata.csv sibling of SOURCE
                                  when omitted)
  -q, --quiet                     Suppress progress output
  --help                          Show this message and exit.

license

Generate license/attribution file from dataset metadata.

Usage:

bioamla dataset license [OPTIONS] PATH

Options:

  -t, --template TEXT       Template file to prepend to the license file
  -o, --output TEXT         Output filename (default: LICENSE for text,
                            ATTRIBUTIONS.md for md)
  --format [text|md]        Output format: plain-text LICENSE or Markdown
                            ATTRIBUTIONS
  --metadata-filename TEXT  Name of metadata CSV file
  --batch                   Process all datasets in directory (each
                            subdirectory with metadata.csv)
  -q, --quiet               Suppress progress output
  --help                    Show this message and exit.

manifest

Build a dataset.json manifest (label vocabulary, counts, splits) from metadata.csv.

Usage:

bioamla dataset manifest [OPTIONS] DATASET_DIR

Options:

  --name TEXT                   Dataset name recorded in the manifest
                                (defaults to dir name)
  --kind [labeled|partitioned]  Dataset kind
  -o, --output TEXT             Output manifest path (default:
                                DATASET_DIR/dataset.json)
  --metadata-filename TEXT      Name of the metadata CSV in the dataset
  --sample-rate INTEGER         Sample rate to record in the manifest
  -q, --quiet                   Suppress progress output
  --help                        Show this message and exit.

merge

Merge multiple audio datasets into a single dataset.

Usage:

bioamla dataset merge [OPTIONS] OUTPUT_DIR DATASET_PATHS...

Options:

  --metadata-filename TEXT  Name of metadata CSV file in each dataset
  --overwrite               Overwrite existing files instead of skipping
  --no-organize             Preserve original directory structure instead of
                            organizing by category
  --target-format TEXT      Convert all audio files to this format (wav, mp3,
                            flac, etc.)
  -q, --quiet               Suppress progress output
  --help                    Show this message and exit.

partition

Partition a dataset into train/val/test (stratified, grouped, reproducible).

Examples: # Default 80/10/10 split, writing a split column into metadata.csv bioamla dataset partition ./dataset # Reorganize into train/val/test/

Usage:

bioamla dataset partition [OPTIONS] DATASET_DIR

Options:

  --train FLOAT               Train fraction
  --val FLOAT                 Validation fraction
  --test FLOAT                Test fraction
  --seed INTEGER              Reproducible shuffle seed
  --stratify / --no-stratify  Balance labels across splits
  --mode [subdirs|column]     Reorganize into train/val/test/<label>/
                              (subdirs) or populate a split column
  --group-by TEXT             Keep rows sharing this column's value in one
                              split (prevents clip leakage)
  --background-label TEXT     Partition this label as its own stratum so it
                              appears in every split
  --metadata-filename TEXT    Name of the metadata CSV in the dataset
  -q, --quiet                 Suppress progress output
  --help                      Show this message and exit.

stats

Show summary statistics for a dataset's metadata.csv.

Usage:

bioamla dataset stats [OPTIONS] DATASET_DIR

Options:

  --metadata-filename TEXT  Name of the metadata CSV in the dataset
  --json                    Output as JSON
  --help                    Show this message and exit.

detect

Advanced acoustic detection algorithms.

Usage:

bioamla detect [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

accelerating

Detect accelerating or decelerating call patterns (single file).

Usage:

bioamla detect accelerating [OPTIONS] FILE

Options:

  --min-pulses INTEGER        Minimum pulses to detect pattern
  -a, --acceleration FLOAT    Acceleration threshold (final_rate/initial_rate)
  -d, --deceleration FLOAT    Deceleration threshold (optional)
  -l, --low-freq FLOAT        Low frequency bound (Hz)
  -h, --high-freq FLOAT       High frequency bound (Hz)
  -w, --window-seconds FLOAT  Analysis window in seconds
  -o, --output PATH           Output file for detections
  --format [table|json|csv]   Output format
  --help                      Show this message and exit.

energy

Detect sounds using band-limited energy detection (single file).

Usage:

bioamla detect energy [OPTIONS] FILE

Options:

  -l, --low-freq FLOAT       Low frequency bound (Hz)
  -h, --high-freq FLOAT      High frequency bound (Hz)
  -t, --threshold-db FLOAT   Detection threshold (dB)
  --min-duration FLOAT       Minimum detection duration (s)
  -o, --output PATH          Output file for detections
  --format [table|json|csv]  Output format
  --help                     Show this message and exit.

peaks

Detect peaks using Continuous Wavelet Transform (CWT) (single file).

Usage:

bioamla detect peaks [OPTIONS] FILE

Options:

  --snr-threshold FLOAT      Signal-to-noise ratio threshold
  --min-distance FLOAT       Minimum peak distance (s)
  -l, --low-freq FLOAT       Low frequency bound (Hz)
  -h, --high-freq FLOAT      High frequency bound (Hz)
  -o, --output PATH          Output file for detections
  --format [table|json|csv]  Output format
  --help                     Show this message and exit.

ribbit

Detect periodic calls using RIBBIT algorithm (single file).

Usage:

bioamla detect ribbit [OPTIONS] FILE

Options:

  -p, --pulse-rate FLOAT      Expected pulse rate in Hz (pulses per second)
  --tolerance FLOAT           Tolerance around expected pulse rate (fraction)
  -l, --low-freq FLOAT        Low frequency bound (Hz)
  -h, --high-freq FLOAT       High frequency bound (Hz)
  -w, --window-seconds FLOAT  Analysis window in seconds
  --min-score FLOAT           Minimum detection score
  -o, --output PATH           Output file for detections
  --format [table|json|csv]   Output format
  --help                      Show this message and exit.

indices

Acoustic indices for soundscape ecology analysis.

Usage:

bioamla indices [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

aci

Compute Acoustic Complexity Index (ACI) only.

Usage:

bioamla indices aci [OPTIONS] FILE

Options:

  --low-freq FLOAT   Low-frequency bound (Hz)
  --high-freq FLOAT  High-frequency bound (Hz)
  --n-fft INTEGER    FFT window size
  --help             Show this message and exit.

adi

Compute Acoustic Diversity Index (ADI) only.

Usage:

bioamla indices adi [OPTIONS] FILE

Options:

  --threshold-db FLOAT  dB threshold
  --n-fft INTEGER       FFT window size
  --help                Show this message and exit.

aei

Compute Acoustic Evenness Index (AEI) only.

Usage:

bioamla indices aei [OPTIONS] FILE

Options:

  --threshold-db FLOAT  dB threshold
  --n-fft INTEGER       FFT window size
  --help                Show this message and exit.

bio

Compute Bioacoustic Index (BIO) only.

Usage:

bioamla indices bio [OPTIONS] FILE

Options:

  --low-freq FLOAT   Low-frequency bound (Hz)
  --high-freq FLOAT  High-frequency bound (Hz)
  --n-fft INTEGER    FFT window size
  --help             Show this message and exit.

compute

Compute all acoustic indices for a single audio file.

Usage:

bioamla indices compute [OPTIONS] FILE

Options:

  -o, --output PATH          Output JSON file for results
  --format [table|json|csv]  Output format
  --n-fft INTEGER            FFT window size
  --aci-low-freq FLOAT       ACI low-frequency bound (Hz)
  --aci-high-freq FLOAT      ACI high-frequency bound (Hz)
  --bio-low-freq FLOAT       BIO low-frequency bound (Hz)
  --bio-high-freq FLOAT      BIO high-frequency bound (Hz)
  --threshold-db FLOAT       dB threshold for ADI/AEI
  --help                     Show this message and exit.

entropy

Compute spectral and temporal entropy indices only.

Usage:

bioamla indices entropy [OPTIONS] FILE

Options:

  --n-fft INTEGER  FFT window size
  --help           Show this message and exit.

ndsi

Compute Normalized Difference Soundscape Index (NDSI) only.

Usage:

bioamla indices ndsi [OPTIONS] FILE

Options:

  --n-fft INTEGER  FFT window size
  --help           Show this message and exit.

temporal

Compute temporal acoustic indices (indices over time segments).

Usage:

bioamla indices temporal [OPTIONS] FILE

Options:

  --window-seconds FLOAT  Analysis window in seconds
  -o, --output PATH       Output JSON file for results
  --n-fft INTEGER         FFT window size
  --help                  Show this message and exit.

models

ML model operations - AST models.

Usage:

bioamla models [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

ast

Audio Spectrogram Transformer (AST) model operations.

Usage:

bioamla models ast [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.
embed

Extract embeddings from audio using AST model.

Example: bioamla models ast embed audio.wav --model-path my_model -o embeddings.npy

Usage:

bioamla models ast embed [OPTIONS] FILE

Options:

  --model-path TEXT      Path to AST model or HuggingFace identifier
                         [required]
  -o, --output TEXT      Output file (.npy)  [required]
  --layer TEXT           Layer to extract embeddings from
  --sample-rate INTEGER  Target sample rate
  --help                 Show this message and exit.
evaluate

Evaluate an AST model on a directory of audio files.

Examples: # Accuracy/precision/recall against a ground-truth CSV bioamla models ast evaluate ./audio_dir --model-path my_model -g labels.csv # Write a JSON report bioamla models ast evaluate ./audio_dir -g labels.csv \ --format json -o eval.json

Usage:

bioamla models ast evaluate [OPTIONS] PATH

Options:

  --model-path TEXT        AST model to use for evaluation
  -g, --ground-truth TEXT  Path to CSV file with ground truth labels
                           [required]
  -o, --output TEXT        Output file for evaluation results
  --format [json|csv|txt]  Output format
  --file-column TEXT       Column name for file names in ground truth CSV
  --label-column TEXT      Column name for labels in ground truth CSV
  --resample-freq INTEGER  Resampling frequency
  --batch-size INTEGER     Batch size for inference
  --fp16 / --no-fp16       Use half-precision inference
  -q, --quiet              Only output metrics, suppress progress
  --help                   Show this message and exit.
info

Display information about an AST model.

Example: bioamla models ast info bioamla/scp-frogs

Usage:

bioamla models ast info [OPTIONS] MODEL_PATH

Options:

  --help  Show this message and exit.
init-config

Write a documented AST training-config file for use with train --config.

The file holds the [models], [training], and [augmentation] settings that ast train reads; edit it, then pass it via --config. Command-line flags still override any value in the file.

Usage:

bioamla models ast init-config [OPTIONS]

Options:

  -o, --output TEXT  Output file path
  -f, --force        Overwrite an existing file
  --help             Show this message and exit.
predict

Run AST prediction on a single audio file — whole file or in segments.

With --segment-seconds the file is split into fixed-length (optionally overlapping) segments and each is classified, yielding one prediction per segment; otherwise the whole file gets a single prediction.

Examples: bioamla models ast predict audio.wav --model-path my_model bioamla models ast predict rec.wav --segment-seconds 3 --overlap 1 -o rec.csv

Usage:

bioamla models ast predict [OPTIONS] FILE

Options:

  --model-path TEXT          AST model to use for inference
  --segment-seconds INTEGER  Split into N-second segments and classify each (0
                             = classify the whole file)
  --overlap INTEGER          Overlap between segments (seconds)
  --min-confidence FLOAT     Drop predictions below this confidence
  -o, --output TEXT          Write predictions to this CSV
                             (filepath,start,stop,prediction,confidence).
                             Default: print to stdout.
  --resample-freq INTEGER    Resampling frequency
  --help                     Show this message and exit.
train

Fine-tune an AST model on a custom dataset.

The --train-dataset option accepts three formats:

  1. HuggingFace dataset: bioamla/scp-frogs or samuelstevens/BirdSet:HSN
  2. Metadata CSV: ./data/metadata.csv (must have file and label columns)
  3. Directory with class subdirs: ./data/ containing bird/, frog/, etc.

Examples: bioamla models ast train --train-dataset bioamla/scp-frogs bioamla models ast train --train-dataset ./metadata.csv bioamla models ast train --train-dataset ./audio_by_class/

Usage:

bioamla models ast train [OPTIONS]

Options:

  --config FILE                   TOML config file (e.g. from 'bioamla config
                                  init'). Explicit flags override its values;
                                  its values override defaults. Reads
                                  [training] and [models].
  --training-dir TEXT             Directory to save training outputs
  --base-model TEXT               Base model to fine-tune
  --train-dataset TEXT            Training data source: HuggingFace dataset
                                  (e.g. 'bioamla/scp-frogs'), local metadata
                                  CSV (with 'file' and 'label' columns), or
                                  directory with class subdirectories (e.g.
                                  ./data/bird/, ./data/frog/)  [required]
  --split TEXT                    Dataset split to use (for HuggingFace
                                  datasets)
  --id-column TEXT                Column name for category/target IDs
  --label-column TEXT             Column name for labels
  --report-to TEXT                Where to report metrics: tensorboard
                                  (default, bundled), mlflow, none, ...
                                  (comma-separated).
  --learning-rate FLOAT           Learning rate for training
  --push-to-hub / --no-push-to-hub
                                  Whether to push model to HuggingFace Hub
  --num-train-epochs INTEGER      Number of training epochs
  --per-device-train-batch-size INTEGER
                                  Training batch size per device
  --eval-strategy TEXT            Evaluation strategy
  --save-strategy TEXT            Model save strategy
  --eval-steps INTEGER            Number of steps between evaluations
  --save-steps INTEGER            Number of steps between saves
  --load-best-model-at-end / --no-load-best-model-at-end
                                  Load best model at end of training
  --metric-for-best-model TEXT    Metric to use for best model selection
  --logging-strategy TEXT         Logging strategy
  --logging-steps INTEGER         Number of steps between logging
  --fp16 / --no-fp16              Use FP16 mixed precision training (for
                                  NVIDIA GPUs)
  --bf16 / --no-bf16              Use BF16 mixed precision training (for
                                  Ampere+ GPUs)
  --gradient-accumulation-steps INTEGER
                                  Number of gradient accumulation steps
  --dataloader-num-workers INTEGER
                                  Number of dataloader workers
  --torch-compile / --no-torch-compile
                                  Use torch.compile for faster training
                                  (PyTorch 2.0+)
  --finetune-mode [full|feature-extraction]
                                  Training mode: full (all layers) or feature-
                                  extraction (freeze base, train classifier
                                  only)
  --mlflow-tracking-uri TEXT      MLflow tracking server URI (e.g.,
                                  http://localhost:5000)
  --mlflow-experiment-name TEXT   MLflow experiment name
  --mlflow-run-name TEXT          MLflow run name
  --add-noise / --no-add-noise    Augmentation layer: add Gaussian noise (off
                                  by default)
  --time-stretch / --no-time-stretch
                                  Augmentation layer: time-stretch (off by
                                  default)
  --pitch-shift / --no-pitch-shift
                                  Augmentation layer: pitch-shift (off by
                                  default)
  --gain / --no-gain              Augmentation layer: random gain (off by
                                  default)
  --gain-transition / --no-gain-transition
                                  Augmentation layer: smooth gain ramp (off by
                                  default)
  --clipping-distortion / --no-clipping-distortion
                                  Augmentation layer: clipping distortion (off
                                  by default)
  --augment-multiplier INTEGER    Create N augmented copies of each training
                                  sample (1=no copies, 2=double dataset, etc.)
  --augment-probability FLOAT RANGE
                                  Probability the whole augmentation pipeline
                                  is applied to a sample (0-1)  [0.0<=x<=1.0]
  --min-snr-db FLOAT              Minimum SNR for Gaussian noise (dB)
  --max-snr-db FLOAT              Maximum SNR for Gaussian noise (dB)
  --noise-probability FLOAT RANGE
                                  Per-sample probability of the noise layer
                                  (0-1)  [0.0<=x<=1.0]
  --min-gain-db FLOAT             Minimum gain adjustment (dB)
  --max-gain-db FLOAT             Maximum gain adjustment (dB)
  --gain-probability FLOAT RANGE  Per-sample probability of the gain layer
                                  (0-1)  [0.0<=x<=1.0]
  --gain-transition-probability FLOAT RANGE
                                  Per-sample probability of the gain-
                                  transition layer (0-1)  [0.0<=x<=1.0]
  --clipping-probability FLOAT RANGE
                                  Per-sample probability of the clipping-
                                  distortion layer (0-1)  [0.0<=x<=1.0]
  --min-percentile-threshold INTEGER
                                  Min percentile for clipping
  --max-percentile-threshold INTEGER
                                  Max percentile for clipping
  --min-time-stretch FLOAT        Minimum time stretch rate
  --max-time-stretch FLOAT        Maximum time stretch rate
  --time-stretch-probability FLOAT RANGE
                                  Per-sample probability of the time-stretch
                                  layer (0-1)  [0.0<=x<=1.0]
  --min-pitch-shift INTEGER       Minimum pitch shift (semitones)
  --max-pitch-shift INTEGER       Maximum pitch shift (semitones)
  --pitch-shift-probability FLOAT RANGE
                                  Per-sample probability of the pitch-shift
                                  layer (0-1)  [0.0<=x<=1.0]
  --help                          Show this message and exit.

system

System information commands (version, devices, dependencies).

Usage:

bioamla system [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

deps

Check or install system dependencies (FFmpeg, libsndfile, PortAudio).

These system libraries are required for full bioamla functionality:

  • FFmpeg: Audio format conversion (MP3, FLAC, etc.)
  • libsndfile: Audio file I/O
  • PortAudio: Real-time audio recording

Examples: bioamla config deps # Check dependencies bioamla config deps --install # Install missing dependencies bioamla config deps --install -y # Install without confirmation

Usage:

bioamla system deps [OPTIONS]

Options:

  --install  Install missing system dependencies
  -y, --yes  Skip confirmation prompt
  --help     Show this message and exit.

devices

Show available compute devices (GPU, MPS, CPU).

Usage:

bioamla system devices [OPTIONS]

Options:

  --help  Show this message and exit.

version

Show bioamla version and environment information.

Usage:

bioamla system version [OPTIONS]

Options:

  --help  Show this message and exit.

util

General file utilities (download, unzip, zip).

Usage:

bioamla util [OPTIONS] COMMAND [ARGS]...

Options:

  --help  Show this message and exit.

download

Download a file from the specified URL to the target directory.

Usage:

bioamla util download [OPTIONS] URL [OUTPUT_DIR]

Options:

  --help  Show this message and exit.

unzip

Extract a ZIP archive to the specified output directory.

Usage:

bioamla util unzip [OPTIONS] FILE_PATH [OUTPUT_PATH]

Options:

  --help  Show this message and exit.

zip

Create a ZIP archive from a file or directory.

Usage:

bioamla util zip [OPTIONS] SOURCE_PATH OUTPUT_FILE

Options:

  --help  Show this message and exit.