An advanced AI-powered platform for generating realistic talking avatar videos from any text script. The system automates text-to-speech conversion, lip-synced video creation, and avatar animation using deep learning, allowing users to create lifelike virtual presenters for various contexts: news, education, announcements, and more. Features include multiple text-to-speech engine options (online/offline), voice selection, and an intuitive interface available both as a desktop GUI and web app. The solution streamlines content production for anyone seeking dynamic, engaging video presentations.
- 🎮 Interactive GUI Interface - User-friendly Tkinter-based control panel.
- 🌐 Streamlit Web App - Run the project in your browser with a modern Streamlit interface.
- 📰 Smart News Fetching - Automatically retrieves the latest news from Google News based on keywords.
- 🗣️ Flexible Text-to-Speech - Choose between Google's gTTS (online) and pyttsx3 (offline, multi-voice).
- 🎤 Voice Selection - Select from available system voices when using pyttsx3.
- 👄 Advanced Lip-Sync Technology - Wav2Lip integration for perfect mouth movements.
- 🎬 Professional Video Output - Seamlessly merged audio-video with Lip-Sync.
- Select TTS method: Choose between gTTS (online), pyttsx3 (offline) or coqui ai (offline)
- Voice selection: Pick from available system voices when using pyttsx3 or coqui-tts
- All features accessible via the GUI
- Streamlit web app: Run
streamlit run streamlit-app.pyfor a browser-based experience
- 🏆 Sports-Focused Content - Specialized in sports commentary and match analysis.
AI-Sports-Commentator/
│
├── gui.py # GUI interface built with Tkinter for user interaction and news input
├── main.py # Main controller script that integrates all modules and triggers the complete pipeline
├── boundary_box_detection.py # Script to detect bounding box coordinates for lips, chin, and cheeks of the avatar image
├── avatar4.png # Static avatar image used to generate the lip-synced talking head
├── project GUI screenshot.png # Screenshot of the GUI to provide a visual preview of the interface
│
├── Wav2Lip/ # Deep Learning model, that generate the lip-sync video from the image given by the user
│ └── inference.py # Lip-sync video generation module using Wav2Lip model
│
├── modules/
│ ├── text_generation.py # Automatically fetches and generates news content using web scraping and APIs
│ ├── text_to_speech.py # Converts news text into speech using gTTS (online) or pyttsx3 (offline, multi-voice)
│ └── avatar_generation.py # Coordinates the avatar image and speech audio to generate the final video
│
├── output/
│ └── result_voice.mp4 # Final output video of the AI avatar reading the news with lip-sync
│
├── click.wav # MP3 file containing button sounds used in GUI
├── requirements.txt # List of required Python libraries and packages to run the project
└── README.md # Project documentation file with setup instructions and project details
-
Clone the Repository:
git clone https://github.com/AnshSinghSonkhia/AI-Commentator-Avatar cd AI-Sports-Commentator -
Create a Virtual Environment (Optional but Recommended):
python -m venv venv venv\Scripts\activate # On Windows # or source venv/bin/activate # On Linux/Mac
-
Install Dependencies:
pip install -r requirements.txt
-
Download Pre-trained & Setup:
- Windows
python setup.py
- Linux / MacOS
python3 setup.py
-
Run the Project:
-
Tkinter GUI:
python gui.py
Use the GUI to:
- Enter a topic and news count, or type your own news text
- Select TTS method (gTTS or pyttsx3) and voice (if using pyttsx3)
- Click "Generate Video" to create a lip-synced news anchor video
-
Streamlit Web App:
streamlit run streamlit-app.py
Use the browser-based interface for a modern experience. All major features are available in both GUI and Streamlit modes.
-
The final output video will be saved as output/result_voice.mp4, showcasing the AI avatar delivering sports commentary in a realistic, lip-synced video format.
- Python 3.7+
- gTTS
- pyttsx3
- moviepy
- OpenCV
- numpy
- requests
- newspaper3k
- GoogleNews
- tqdm
- torch, torchvision
- ffmpeg (installed and added to system path)
- Pillow (for image processing in GUI)
- streamlit (for web app)
- coqui-tts
For any queries or issues, please contact via GitHub issues or open a pull request.
Brought to you by Ansh Singh Sonkhia, B.Tech in CSE (Artificial Intelligence and Machine Learning)