Downloads Β· 30 days
0
thecodeworm/clearspeech-unet
clearspeech-unet is a audio classification model from thecodeworm. Use it for the audio classification task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
AI-Powered Speech Enhancement & Transcription System
Downloads Β· 30 days
0
Access
Public
Updated Jan 7, 2026
Repo size
745 MB
Likes
1
Public
Click a slice to open those files.
.pt373 MB Β· 100%
From the Hugging Face model README
AI-Powered Speech Enhancement & Transcription System
ClearSpeech uses a custom U-Net deep learning model to remove background noise from audio, then transcribes the enhanced audio using OpenAI's Whisper. Perfect for cleaning up voice recordings, meeting audio, podcasts, or any noisy speech.
π Live Website (will be updated): https://clearspeech.yourdomain.com
Python 3.8+
pip
Optional CUDA GPU
git clone https://github.com/yourusername/ClearSpeech.git
cd ClearSpeech
# Create environment
python3.10 -m venv venv
# Activate (macOS/Linux)
source venv/bin/activate
# Activate (Windows)
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Download model
python -c "
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id='thecodeworm/clearspeech-unet',
filename='best_model.pt',
local_dir='enhancement_model/checkpoints/'
)
"
# Generate all noise types at multiple SNR levvels
python generate_noisy_samples.py \
--input my_clean_voice.wav \
--output test_samples/
Start the server:
python -m backend.app
Server starts at http://localhost:8000
Start the server:
cd frontend
python -m http.server 3000
Frontend starts at http://localhost:3000
Process audio:
# Full pipeline (enhance + transcribe)
curl -X POST "http://localhost:8000/process" \
-F "file=@your_audio.wav" \
| jq .
# Enhance only
curl -X POST "http://localhost:8000/enhance" \
-F "file=@your_audio.wav" \
-o enhanced_output.wav
# Transcribe only
curl -X POST "http://localhost:8000/transcribe" \
-F "file=@your_audio.wav" \
-F "enhance=true" \
| jq .
Method 2: Using Python
from backend.inference_pipeline import EnhancementPipeline
# Initialize pipeline
pipeline = EnhancementPipeline(
cnn_checkpoint_path="enhancement_model/checkpoints/best_model.pt",
whisper_model_name="base",
device="cpu" # or "cuda" or "mps"
)
# Process audio
result = pipeline.process("path/to/noisy_audio.wav")
print(f"Transcript: {result['transcript']}")
print(f"Duration: {result['duration']:.2f}s")
# Save enhanced audio
import soundfile as sf
sf.write("enhanced.wav", result['enhanced_audio'], result['sample_rate'])
Method 3: Command Line
# Enhance audio file
python enhancement_model/infer.py \
--checkpoint enhancement_model/checkpoints/best_model.pt \
--input noisy_audio.wav \
--output enhanced_audio.wav \
--comparison # Creates stereo comparison file
Once the server is running, visit:
POST /processProcess audio with enhancement and transcription.
Request:
-F "[email protected]" \
-F "language=en" \
-F "skip_enhancement=false"
Response:
{
"success": true,
"transcript": "Transcribed text here",
"duration": 3.5,
"language": "en",
"enhanced_audio_url": "/download/enhanced_123.wav",
"segments": [...],
"processing_time": 2.3
}
POST /enhanceEnhance audio only (no transcription).
Request:
curl -X POST "http://localhost:8000/enhance" \
-F "[email protected]" \
-o enhanced.wav
Response: Enhanced audio file (WAV)
POST /transcribeTranscribe audio with optional enhancement.
Request:
curl -X POST "http://localhost:8000/transcribe" \
-F "[email protected]" \
-F "language=en" \
-F "enhance=true"
Response:
{
"success": true,
"transcript": "Transcribed text",
"duration": 3.5,
"language": "en",
"segments": [...]
}
GET /download/{filename}Download enhanced audio file.
GET /healthHealth check endpoint.
ClearSpeech/
βββ backend/ # FastAPI backend
β βββ app.py # Main API server
β βββ inference_pipeline.py # Processing pipeline
β βββ requirements.txt
βββ enhancement_model/ # U-Net model
β βββ model.py # U-Net architecture
β βββ dataset.py # PyTorch dataset
β βββ train.py # Training script
β βββ infer.py # Inference script
β βββ checkpoints/ # Trained models
β β βββ best_model.pt
β βββ requirements.txt
βββ data/ # Training/test data
β βββ audio_clean/ # Clean audio
β βββ audio_raw/ # Noisy audio
β βββ metadata/
β β βββ metadata.json # Dataset metadata
β βββ spectrograms/ # Mel-spectrograms
β βββ clean/
β βββ noisy/
βββ frontend/ # Web interface (optional)
β βββ index.html
β βββ script.js
βββ tests/ # Test files
β βββ test_backend.py
βββ README.md
βββ requirements.txt
We welcome contributions! Here's how:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureDevelopment Setup
# Install dev dependencies
pip install -r requirements-dev.txt
# Run tests before committing
python -m pytest tests/
# Format code
black backend/ enhancement_model/
Project Maintainers: Aditya Chanda, Josh Pal, Advik Kumar Singh
Project Link: https://github.com/thecodeworm/ClearSpeech
Give a βοΈ if this project helped you!
Built with β€οΈ using PyTorch and FastAPI