Skip to content

HirthikBalaji/DELTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📷 Image to Audio 🎧 — Motivational News Speech Generator

This Streamlit app transforms text from an image into a motivational speech with military-style intensity — and then speaks it out loud using text-to-speech synthesis.

🚀 Features

  • 📸 Upload Image: Accepts .jpg, .jpeg, and .png formats.
  • 🧠 OCR (Optical Character Recognition): Extracts text from the uploaded image using easyocr.
  • ✍️ Summarization: Summarizes extracted text using an AI model via ollama (LLaMA 3.2).
  • 🎙 Speech Conversion: Transforms the summary into a motivational military speech.
  • 🔊 Text-to-Speech (TTS): Converts the speech into audio using Piper TTS.
  • 🎧 Audio Playback: Streamlit interface plays the generated audio.

🛠 Installation

1. Clone the Repository

git clone https://github.com/HirthikBalaji/DELTA.git
cd DELTA

2. Install Dependencies

Make sure you have Python 3.9+ and virtualenv:

pip install streamlit easyocr pillow

Install and configure:


🧠 Model Dependencies

Ollama LLM (LLaMA 3.2)

Ensure llama3.2 model is pulled and available for chat-based summarization:

ollama pull llama3.2

Piper TTS

Make sure Piper is installed (via WSL or Linux), and you have a model like en_US-hfc_male-medium.onnx and en_US-hfc_male-medium.json in the ./piper/ directory:

# Inside WSL or Linux terminal
cd piper
./piper --list  # To list available voices

🖼 How It Works

  1. Upload an image.
  2. The app extracts text using OCR (easyocr).
  3. It summarizes the text using the LLaMA 3.2 model via ollama.
  4. The summary is transformed into a powerful motivational speech.
  5. Piper TTS synthesizes the speech into an audio file.
  6. The audio is played directly in the Streamlit UI.

🔉 Example Output

Your browser does not support the audio element.


⚙️ File Structure

├── app.py                # Main Streamlit application
├── piper/
│   ├── piper             # Piper binary (Linux or WSL)
│   └── en_US-hfc_male-medium.onnx  # TTS voice model
├── welcome.wav           # Output audio file (auto-generated)

🧪 Run the App

streamlit run app.py

📌 Notes

  • The Piper TTS command uses WSL (wsl ./piper/piper) — make sure you have WSL set up if on Windows.
  • Ensure ollama is running as a background service before using the app.
  • Piper models can be downloaded from Piper TTS GitHub.

🙌 Credits


📜 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages