CoolFace
Apppublic

ThiThanhChuong/precision-voice

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

PrecisionVoice - STT & Speaker Diarization

A production-ready Speech-to-Text and Speaker Diarization web application using FastAPI, faster-whisper, and pyannote.audio.

Features

  • โ€”๐ŸŽ™๏ธ Speech-to-Text using erax-ai/EraX-WoW-Turbo-V1.1-CT2 (8x faster, 8 Vietnamese dialects)
  • โ€”๐Ÿ‘ฅ Speaker Diarization using pyannote/speaker-diarization-3.1
  • โ€”๐Ÿงผ Speech Enhancement using SpeechBrain SepFormer DNS4 (noise + reverb removal)
  • โ€”๐Ÿ”‡ Voice Activity Detection using Silero VAD v5 (prevents hallucination)
  • โ€”๐ŸŽค Vocal Isolation using MDX-Net (UVR-MDX-NET-Voc_FT)
  • โ€”๐Ÿ”„ Automatic speaker-transcript alignment
  • โ€”๐Ÿ“ฅ Download results in TXT or SRT format
  • โ€”๐Ÿณ Docker-ready with persistent model caching and GPU support
  • โ€”๐Ÿณ Docker-ready with persistent model caching and GPU support

Quick Start

Prerequisites

  1. 1.Docker and Docker Compose
  2. 2.(Optional) NVIDIA GPU with CUDA support
  3. 3.HuggingFace account with access to pyannote models

Setup

  1. 1.Clone and configure:
bash
   cp .env.example .env
   # Edit .env and add your HuggingFace token
  1. 1.Build and run:
bash
   docker compose up --build
  1. 1.Open http://localhost:8000

Audio Processing Pipeline

The system uses a state-of-the-art multi-stage pipeline to ensure maximum accuracy:

  1. 1.Speech Enhancement: Background noise and reverb are removed using SpeechBrain SepFormer (DNS4 Challenge winner).
  2. 2.Vocal Isolation: Vocals are separated from background music using MDX-Net.
  3. 3.VAD Filtering: Silence is removed using Silero VAD v5 to prevent ASR hallucination.
  4. 4.Refinement: Highpass filtering and EBU R128 loudness normalization.
  5. 5.Transcription: High-precision Vietnamese transcription using PhoWhisper.
  6. 6.Diarization: Segmenting audio by speaker using Pyannote 3.1.
  7. 7.Alignment: Merging transcripts with speaker segments + timestamp reconstruction.

Configuration

VariableDefaultDescription
HF_TOKEN-Required for Pyannote models
ENABLE_SPEECH_ENHANCEMENTTrueToggle SpeechBrain speech enhancement
ENHANCEMENT_MODELspeechbrain/sepformer-dns4-16k-enhancementModel for speech enhancement
ENABLE_SILERO_VADTrueToggle Silero VAD for hallucination prevention
ENABLE_VOCAL_SEPARATIONTrueToggle MDX-Net vocal isolation
MDX_MODELUVR-MDX-NET-Voc_FTModel for vocal separation
DEVICEautocuda, cpu, or auto

Development

Local Setup (without Docker)

bash
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload

API Endpoints

EndpointMethodDescription
/GETWeb UI
/api/transcribePOSTUpload and transcribe audio
/api/download/{filename}GETDownload result files

Supported Audio Formats

  • โ€”MP3
  • โ€”WAV
  • โ€”M4A
  • โ€”OGG

License

MIT