AI-powered concert audio analysis using PyTorch Audio Spectrogram Transformer (AST) for automatic classification and segmentation of philharmonic concert recordings.
docker-compose upDocker handles everything automatically.
-
Install Prerequisites:
- Python 3.11 β Check "Add Python to PATH"
- Node.js 18+
-
Run Setup (one time):
Double-click: setup.batSetup auto-detects GPU vs CPU, downloads the pre-trained model from HuggingFace, and creates the data directory structure.
-
Start App:
Double-click: start.batOpens http://localhost:5173 automatically.
No manual prerequisite installation needed β setup.sh handles everything automatically.
chmod +x setup.sh
./setup.sh
./start.shThe setup script will:
- Auto-detect your OS (Debian/Fedora/Arch/macOS) and install system packages (Python 3.11, Node.js, pnpm, ffmpeg, etc.)
- Install Python 3.11 via pyenv if not available from system packages
- Create a Python virtual environment and install all dependencies
- Auto-detect GPU and install the correct PyTorch version (CUDA 12.4 β 12.1 β CPU fallback)
- Download the pre-trained AST model (~1GB) from HuggingFace
- Create the data directory structure
- Install frontend dependencies and build
Opens http://localhost:5173 automatically.
Automatically classifies audio into 5 categories:
- π΅ MUSIC - orchestral music
- π APPLAUSE - audience applause
- π£οΈ SPEECH - announcements, speeches
- π₯ PUBLIC - audience noise, intermission
- π» TUNING - instrument tuning
DAW-style interface for reviewing and correcting predictions with color-coded segments.
Export corrected segments β retrain model β improved accuracy over time.
- GPU Acceleration: torch.compile for NVIDIA CUDA (~2x speedup)
- CPU Optimization: ONNX INT8 quantization (3x+ speedup vs PyTorch)
- AMD GPU Support: ROCm 6.4 with silent fallback detection
- Auto-Detection: No manual configuration needed
- Keyboard Shortcuts: Spacebar (play/pause), 1-5 (classifications), Ctrl+Z/Y (undo/redo), ? (help)
- Undo/Redo: Full history for all edits
- Autosave: Automatic saving of edits
- Calendar Browser: Navigate recordings by date
- Uncertainty Review: Filter and review low-confidence predictions
- PyTorch (auto-detects CUDA 12.4/12.1 vs CPU)
- ONNX Runtime for CPU speedup
- FastAPI REST API
- Polars for fast CSV parsing (5-30x faster than pandas)
- React 19 with TypeScript
- Vite dev server
- Modern component architecture
- AST Active Model: Pre-trained 5-class audio classifier (auto-downloaded from HuggingFace)
- Base Architecture:
MIT/ast-finetuned-audioset-10-10-0.4593 - ONNX INT8 Model: Quantized version for CPU (3x+ faster)
Total Size: ~2GB (including model download)
Note: Python 3.11 is required. Python 3.13+ has breaking stdlib removals (
aifc,audioop) that affect audio processing libraries.
At startup, backend logs show what was detected:
CPU-only (ONNX optimized):
INFO: Device: cpu (CPU)
INFO: Using ONNX INT8 backend (3.2x speedup vs PyTorch CPU)
NVIDIA GPU:
INFO: GPU detected: NVIDIA CUDA 12.4 - GeForce RTX 3090
INFO: Using PyTorch GPU backend with torch.compile
AMD GPU:
INFO: GPU detected: AMD ROCm 6.2 - Radeon RX 7900 XTX
INFO: Using PyTorch GPU backend with torch.compile
Note:
torch.compilerequires NVIDIA GPUs with CUDA capability >= 7.0 (Volta+). Older GPUs (e.g. GTX 1060) will automatically fall back to eager mode.
- Polars CSV parsing: 5-30x faster than pandas
- ONNX INT8 CPU: 3x+ faster than PyTorch
- torch.compile GPU: ~2x speedup vs eager mode
- Waveform caching: <500ms repeat load (was 8s)
"Python not found" (Windows):
- Install Python 3.11 with "Add Python to PATH" checked
- Restart terminal after installation
"Python not found" (Linux/macOS):
setup.shinstalls Python 3.11 automatically via system packages or pyenv- If it fails, install pyenv manually:
curl https://pyenv.run | bashthen re-run setup
"Node.js not found":
- On Linux/macOS,
setup.shinstalls it automatically - On Windows, install from https://nodejs.org
- Restart terminal
ONNX export fails:
- Not critical - app uses PyTorch CPU fallback
- Slightly slower but works fine
- Re-run setup to retry
No module named 'aifc' or audioop:
- You're running Python 3.13+ which removed these modules
- Switch to Python 3.11 (recommended version for this project)
Backend won't start:
# Windows
cd backend
venv\Scripts\activate
python -m uvicorn app.main:app --reload
# macOS/Linux
cd backend
source venv/bin/activate
python -m uvicorn app.main:app --reloadFrontend won't start:
cd frontend
pnpm install
pnpm devPort already in use:
- Windows:
netstat -ano | findstr :8000thentaskkill /PID <PID> /F - macOS/Linux:
lsof -ti:8000 | xargs kill -9
filharmonia-ai/
βββ backend/ # FastAPI + PyTorch backend
β βββ app/ # API routes, services, models
β βββ scripts/ # ONNX export, utilities
β βββ venv/ # Python virtual environment
βββ frontend/ # React 19 frontend
β βββ src/ # Components, hooks, pages
β βββ node_modules/ # Node.js packages
βββ data/ # Working data directory (auto-created)
β βββ SORTED/ # Analyzed recordings
β βββ NAGRANIA_KONCERTOW/ # Raw concert recordings
βββ docker/ # Docker configuration
βββ setup.bat # Windows setup script
βββ setup.sh # macOS/Linux setup script (auto-installs everything)
βββ start.bat # Windows start script
βββ start.sh # macOS/Linux start script (proper process cleanup on Ctrl+C)
βββ stop.sh # macOS/Linux stop script
βββ docker-compose.yml # Docker setup
docker-compose updocker build -t filharmonia-ai .
docker run -p 80:80 -v /path/to/audio:/data filharmonia-aiOpen http://localhost
- Upload MP3 β Browse local files or use calendar browser
- Automatic Analysis β AST model classifies audio segments
- Review Results β View waveform + predictions
- Edit Classifications β Correct mistakes (undo/redo support)
- Export CSV β Timestamped segment list
Spacebar: Play/pause audio1-5: Change segment classificationCtrl+Z: UndoCtrl+Y: RedoCtrl+S: Save (autosave already enabled)?: Show keyboard help
Backend: http://localhost:8000 Frontend: http://localhost:5173 API Docs: http://localhost:8000/docs
- docs/ROCM_SETUP.md - AMD GPU setup guide
- .planning/ - Development milestones and planning docs
- PyTorch - Deep learning framework
- Audio Spectrogram Transformer (AST) - Audio classification model
- FastAPI - High-performance Python API
- React 19 - Modern UI framework
- Polars - Fast dataframe library
- ONNX Runtime - Cross-platform inference
- Vite - Fast frontend tooling
- β Python 3.11 standardization (3.13+ breaks audio libs)
- β
setup.shauto-installs all prerequisites (OS-aware) - β Pre-trained model auto-download from HuggingFace
- β Multi-index PyTorch install fallback (cu124 β cu121 β CPU)
- β
torch.compileCUDA capability check (graceful fallback on older GPUs) - β Cross-platform path display fixes (Linux + Windows)
- β
Proper process cleanup on Ctrl+C (
setsid+ process group kills) - β Data directory structure auto-creation
- β Unified device detection (NVIDIA/AMD/CPU)
- β ONNX INT8 CPU optimization (3x speedup)
- β torch.compile GPU acceleration
- β ROCm 6.4 support for AMD GPUs
- β React 19 upgrade
- β Confidence threshold auto-tuning
- β Cross-platform paths
- β Component refactoring (30% code reduction)
- β Performance improvements (Polars migration)
See LICENSE file in repository root.
Setup Issues:
- Check logs:
backend.logandfrontend.log - Re-run setup script
- Check troubleshooting section above
Feature Requests:
- Create an issue on GitHub
Need Help:
- Check documentation in
docs/folder - Review API docs at http://localhost:8000/docs






