Skip to content

feat(app): unify into Bird Audio Analyzer — single Tauri app with Batch + Review modes - #2

Merged
heisenshtadt3 merged 80 commits into
mainfrom
leyang/pwa-prototype
Jun 23, 2026
Merged

feat(app): unify into Bird Audio Analyzer — single Tauri app with Batch + Review modes#2
heisenshtadt3 merged 80 commits into
mainfrom
leyang/pwa-prototype

Conversation

@leyangloh

@leyangloh leyangloh commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Pull Request: Unified Tauri Desktop App & Curation Pipeline (leyang/pwa-prototype)

🛠️ Overview

This Pull Request introduces the unified Tauri desktop application for the Bird Audio Analyzer. It consolidates the high-performance Python machine learning backend with an interactive desktop interface featuring two distinct workflow modes:

  1. Batch Mode (Analyze): Automates the ML inference pipeline over directories of field recordings.
  2. Review Mode (Curation): Provides visual spectrogram inspection, audio playback, time-frequency bounds adjustment, and manual annotation curation.

Here is the recorded walkthrough demonstrating the full end-to-end smoke test (starting the batch processing session, monitoring progress, viewing results, and curating detections in Review Mode):

Tauri App Smoke Run

Tip

You can also play or view the media files directly:


🚀 Setup & Execution Guide

Prerequisites

Ensure the following tools are installed on your environment:

  • uv: Python package resolver (astral-sh/uv)
  • Rust & Cargo: Tauri compiler toolchain (Rustup)
  • Node.js & npm: Frontend React/TypeScript compiler (NodeJS)

Installation

Execute these commands from the repository root (/Users/leyangloh/.warp/worktrees/bird-audio-pwa/cuesta-lechuguilla):

  1. Install React Frontend Dependencies:
    npm install
  2. Sync Python Virtual Environment & ML Engine:
    uv sync

Running the Desktop App (Development)

Launch the unified Tauri application in local developer mode:

npm run tauri dev

Note

The initial launch will compile Rust crate dependencies (this may take a few minutes). Subsequent launches are cached and start incrementally.


🧪 Feature Testing & Verification Guide

Follow these steps to manually verify the application features end-to-end:

Step 1: Verify System Health Panel & Initialization

  1. Launch the app (npm run tauri dev).
  2. Verify the Health Panel banner at the top of the Setup view:
    • It should query your environment and check for model weights (models/buzz_localizer.pt and models/classifier.pt).
    • If model weights are missing or the environment is not ready, the banner will display "Setup required before listening". Click Prepare System and confirm it runs setup successfully, changing the banner to green: "Instrument ready to listen".

Step 2: Test Batch Analysis Mode

  1. In the Select recording folder field, input or browse to a directory containing audio recordings (e.g., /tmp/smoke_data).
  2. Set the thresholds:
    • Detection sensitivity: Set to 0 (or your preferred test threshold).
    • Quality filter: Set to 0.53 (recommended default).
  3. Click the Begin Listening → button.
  4. Verification:
    • The UI should transition to the Run View.
    • A circular progress bar should fill up as files are processed.
    • The active file currently being scanned should display in real time (▸ /tmp/smoke_data/file.wav).
    • Stats blocks (Processed, Active, Remaining, Speed, ETA) should update.
    • Upon completion, the banner should change to "Analysis complete".

Step 3: Verify the Post-Run Dashboard & Charts

  1. Once the batch run is complete, verify that the Results Summary displays:
    • Count of detections found (with a smooth count-up animation).
    • Count of high-quality buzzes.
    • Count of retained records.
  2. In the charts panel below the summary, click through the tabs to verify data visualization:
    • Elevation: Displays box plots of detection duration across Low/Medium/High elevations. Hover over the boxes to verify statistics tooltips.
    • Timeline: Displays a chronological bar chart showing detection activity bins.
    • Sites: Displays a tabular overview of detections categorized by device/site ID.

Step 4: Test Interactive Spectrogram Curation (Review Mode)

  1. Navigate to the Review tab in the main navigation bar (it should now be enabled since a batch run finished).
  2. Select a file from the left sidebar list.
  3. Verification:
    • The spectrogram canvas should render the audio signal with frequency ranges on the Y-axis and time on the X-axis.
    • Golden bounding boxes should be drawn over detected events.
    • Below the spectrogram, the event table should list all detections.
  4. Test curation actions:
    • Click the Checkmark (Confirm) button on a row. The row highlight and box status should turn green (Confirmed).
    • Click the X (Reject) button on a row. The status should turn red (Rejected).
    • Adjust a box bounds: Click and drag the golden boundaries of an event box on the spectrogram canvas. Verify the duration and frequency bounds update in the table.
    • Add a manual box: Click and drag on an empty spectrogram area to draw a box. Verify a new row is added to the table marked as Manual source.
    • Click the Play button to listen to the audio selection.

Step 5: Test Data Export

  1. Go back to the Batch tab.
  2. Scroll to the Export Options section.
  3. Select an export format: CSV, JSON, or Raven format.
  4. Click Pick save destination and select a path (e.g. events.csv).
  5. Toggle Confirmed events only or Complete only and click Export.
  6. Verify the exported file contains the correct columns and rows matching your curated session.

💻 Running Automated Test Suites

For developer unit and integration verification, run the automated suites:


📖 Related Documentation

For full architectural details, consult:

  • USAGE.md: User guide and manual operations.
  • batch-app.md: Schema definitions, database columns, and Tauri channel structures.
  • architecture.md: YOLO window logic, spectrogram processing constants, and classification math.

leyangloh and others added 30 commits June 11, 2026 21:50
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
leyangloh and others added 11 commits June 15, 2026 16:47
Rebuild the Tauri frontend around a "bioacoustic field instrument" aesthetic:
the spectrogram color ramp (indigo→violet→magenta→coral→amber→gold) becomes the
brand, on a warm darkroom-at-dusk base. Replaces the generic dark+Inter+blue
look with a Fraunces / Hanken Grotesk / IBM Plex Mono type system.

- index.css: full design system (CSS vars, spectrogram ramp, grain + aurora
  atmosphere, animated equalizer mark, spectrogram-playhead progress bar,
  staggered reveals, reduced-motion guard)
- App.tsx: masthead shell + product name "Bird Audio Analyzer"
- SetupView/RunView/FileTable/ManageCache: restyled to the new language;
  count-up completion stats. All props, state, and API wiring unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- docs/architecture.md: source-grounded system design with three
  (render-verified) Mermaid diagrams — layered architecture, end-to-end
  sequence, and the ML pipeline — plus the worker protocol, SQLite schema,
  concurrency model, and a precise account of the theta_A (Detection
  Sensitivity) and theta_B (Quality Filter) thresholds.
- README.md: classifier.pt is a completeness curator (p("full")), not a
  species classifier; split Stage A / Stage B and link the new doc.

Force-added under docs/ (globally gitignored), matching existing tracked specs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Splits the two apps that shared this repo. The root "Acoustic Field
Station" Tauri/PWA frontend (src/, src-tauri/, root package.json/vite/
tsconfig, public/, *.ts scripts) is removed from this branch and now
lives on leyang/pwa-prototype.

Kept here: batch-app/ (Bird Batch Runner) and the shared Python ML
pipeline both apps used (birdpipe/, scripts/*.py, models/, tests/,
pyproject.toml, uv.lock, docs/).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"README (from backup).md" was the default create-vite boilerplate
tied to the removed root PWA; not the project README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add docs/batch-app.md: developer reference for the desktop app — repo
  layout, build/run, batch-core engine, NDJSON worker protocol, Tauri IPC
  surface, React frontend, CLI, config, testing, and packaging gotchas.
- Rewrite README.md to cover the Bird Audio Analyzer desktop app (GUI + CLI)
  alongside the Python pipeline; fix uv install URL and stale output section;
  link the docs.
- Add architecture.md $10 parameter reference (paper constants): audio/
  windowing, Stage A YOLO, consolidation Table A.6 gates, Stage B Table A.8.
Make architecture.md the conceptual front-door (diagrams, ML pipeline, theta
semantics, parameter reference) and defer protocol/schema/concurrency/export
detail to batch-app.md, the reference. Trim the four duplicated sections to
conceptual summaries that link into the reference; add a reciprocal link from
the reference's data-flow section back to the architecture diagram. Single
source of truth per topic; section numbers preserved.
…wrapper

Mirror the pwa-prototype layout for the existing batch app so the project has a
single root Cargo workspace and frontend, with no batch-app/ nesting.

- Move batch-app/{batch-core,src,src-tauri,Cargo.*,package*,index.html,
  vite.config.ts,tsconfig*} up to the repo root. Content-identical renames —
  every internal reference (batch-core path dep, frontendDist, npm scripts) was
  already relative, so the uniform shift preserves them.
- Remove the stray orphan src-tauri/Cargo.lock and the now-empty batch-app/.
- Merge batch-app/.gitignore into the root .gitignore; ignore the workspace
  /target, *.db sidecars, *.tsbuildinfo, and output/ export artifacts.
- Drop accidentally-committed artifacts: *.tsbuildinfo and the sample
  output/events.csv export.
- Fix stale batch-app/ path references in README and docs.

No behavior change; Review-mode features are not included. Verified: tsc -b,
cargo check --workspace, cargo test -p batch-core (6/6).
Rebased onto the restructured leyang/prototype (batch app promoted to the repo
root). The prior pwa-prototype history independently performed that same move, so
this collapses it into a single feature delta over the shared root layout — this
PR now shows only the Review-mode work, not the file moves (those are owned by
the prototype restructure).

- Review mode: curate ML events on the spectrogram (ReviewView, EventTable,
  AudioVisualizer event regions) — confirm / reject / reset, edit time-frequency
  bounds, add manual events, delete false positives.
- batch-core: curation columns + event review/edit Store methods.
- review/curation Tauri commands + asset-protocol audio access.
- confirmed-only export filter (+ UI toggle).
- Field Station design tokens; unified warm design language; motion/selection
  polish.
- docs/USAGE.md step-by-step usage tutorial.

Verified: tsc -b, cargo check --workspace.
@leyangloh
leyangloh force-pushed the leyang/pwa-prototype branch from 67ebaaa to d0220ab Compare June 20, 2026 14:19
The on-mount checkHealth().then() had no .catch, so a rejected invoke
(e.g. the frontend loaded outside the Tauri runtime) surfaced as an
unhandled promise rejection. Mirror the adjacent checkCache().catch()
pattern and fall back to a null health state.
…ird with waveform, and add loading spinners on waiting states
@leyangloh
leyangloh changed the base branch from leyang/prototype to main June 23, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread birdpipe/__init__.py
@@ -0,0 +1 @@
"""Paper-faithful HLW buzz pipeline core (pure logic, no Torch)."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the engine from Erik's original code - is the evaluation, preprocessor, etc in here all brand new? I'm guessing some of this has already been set up in Erik's code, I'll double check that it's fine for us to use a new version for now

@heisenshtadt3
heisenshtadt3 merged commit ced0b45 into main Jun 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants