Views
No views yet
voicecraft/
├── datasets/ # Dataset handling
│ ├── download_ljspeech.py
│ └── prepare_dataset.py
├── preprocessing/ # Text and audio preprocessing
│ ├── text_normalizer.py
│ └── audio_processor.py
├── g2p/ # Grapheme-to-Phoneme conversion
│ └── g2p_converter.py
├── prosody/ # Prosody prediction
│ └── prosody_predictor.py
├── tacotron2/ # Tacotron2 acoustic model
│ ├── model.py
│ └── train.py
├── vocoder/ # Vocoders (HiFiGAN, WaveGlow)
│ ├── hifigan.py
│ └── train.py
├── utils/ # Utility functions
│ ├── audio_utils.py
│ ├── collate_fn.py
│ └── evaluation.py
├── deployment/ # Deployment files
│ ├── app.py # Gradio GUI
│ ├── requirements.txt
│ └── colab_deploy.ipynb
├── future/ # Future expansion modules
│ ├── assamese_tts.py
│ ├── emotional_tts.py
│ ├── whisper_transcription.py
│ └── mobile_inference.py
└── README.md1git clone <repository-url>
2cd voicecraftpip install -r deployment/requirements.txt1python voicecraft/datasets/download_ljspeech.py
2python voicecraft/datasets/prepare_dataset.py data/LJSpeech-1.1python voicecraft/deployment/app.pyhttp://localhost:78601# Download LJSpeech
2python voicecraft/datasets/download_ljspeech.py
3
4# Prepare dataset with train/val/test splits
5python voicecraft/datasets/prepare_dataset.py data/LJSpeech-1.11python voicecraft/tacotron2/train.py \
2 --train_data data/processed/train \
3 --val_data data/processed/val \
4 --checkpoint_dir checkpoints/tacotron2 \
5 --log_dir logs/tacotron2 \
6 --num_epochs 100 \
7 --batch_size 32 \
8 --lr 1e-3 \
9 --use_amp \
10 --save_interval 10001python voicecraft/vocoder/train.py \
2 --train_data data/processed/train \
3 --checkpoint_dir checkpoints/hifigan \
4 --log_dir logs/hifigan \
5 --num_epochs 100 \
6 --batch_size 16 \
7 --lr_g 2e-4 \
8 --lr_d 2e-4 \
9 --use_amp \
10 --save_interval 10001from voicecraft.utils.evaluation import compute_mcd, compute_spectral_distortion
2
3mcd = compute_mcd(mel_pred, mel_target)
4sd = compute_spectral_distortion(mel_pred, mel_target)voicecraft/deployment/app.pyvoicecraft/deployment/requirements.txtvoicecraft/ source codevoicecraft/deployment/colab_deploy.ipynb1from pyngrok import ngrok
2public_url = ngrok.connect(7860)
3print(f"Public URL: {public_url}")1# Install dependencies
2pip install -r voicecraft/deployment/requirements.txt
3
4# Run the app
5python voicecraft/deployment/app.pyhttp://localhost:7860Hello everyone, hope you are well. We are students of Dhemaji Engineering College, Computer Science and Engineering Department, and our names are: Abinash Dutta, Arindom Bordoloi, Bakhtiar Ahmed, Chinmoy Mahanta, Mumon Saikia, Preety Rani Boruah. We are developing the project "Voicecraft: The Art of Text-to-Speech – Crafting Human-Like Voices from Text" under the guidance of Barga Deori Sir. Thank you.
future/assamese_tts.py)future/emotional_tts.py)future/whisper_transcription.py)future/mobile_inference.py)voicecraft/datasets/voicecraft/preprocessing/voicecraft/g2p/voicecraft/tacotron2/ and voicecraft/vocoder/voicecraft/deployment/1from voicecraft.preprocessing.text_normalizer import normalize_text
2from voicecraft.g2p.g2p_converter import text_to_phonemes
3from voicecraft.tacotron2.model import Tacotron2
4from voicecraft.vocoder.hifigan import HiFiGAN
5
6# Normalize text
7text = "Hello, it's 9:30 a.m. on Jan. 15, 2023."
8normalized = normalize_text(text)
9
10# Convert to phonemes
11phonemes = text_to_phonemes(normalized)
12
13# Load models
14tacotron2 = Tacotron2()
15hifigan = HiFiGAN()
16
17# Generate speech
18text_seq = text_to_sequence(normalized)
19mel = tacotron2.infer(text_seq)
20audio = hifigan.infer(mel)preprocessing/text_normalizer.pyg2p/g2p_converter.pytacotron2/ or vocoder/deployment/app.py1# Test individual modules
2python voicecraft/preprocessing/text_normalizer.py
3python voicecraft/g2p/g2p_converter.py