Before diving into the details of the process, take a moment to watch a demo video showcasing our project in action.
The Digital Content to Sign Language Converter is a comprehensive tool that converts various forms of Digital media (YouTube videos, local videos, audio files, and text) into sign language videos. This project leverages several libraries and APIs to process and translate spoken or written content into Indian Sign Language (ISL) syntax, creating videos that can aid in communication for the deaf and hard-of-hearing community.
The primary objective of this project is to bridge the communication gap for individuals who rely on sign language. By converting various media formats into sign language videos, we aim to provide an accessible and efficient means of understanding content that is traditionally available only in spoken or written form.
- YouTube Video Processing: Download and convert YouTube videos into sign language videos.
- Local File Processing: Convert local video or audio files into sign language videos.
- Text Input Processing: Translate text into sign language videos.
- Sign Language Translation: Convert English sentences into ISL syntax.
- Video Compilation: Combine video clips and GIFs to form coherent sign language videos.
- Python: Core programming language used for development.
- Streamlit: Framework for creating the web interface.
- Google Cloud Speech-to-Text API: For transcribing audio to text.
- yt-dlp: For downloading YouTube videos.
- MoviePy: For video processing and editing.
- Pydub: For audio processing.
- nltk: For natural language processing tasks.
- num2words: For converting numbers to words.
- pytube: For downloading YouTube videos.
- pandas: For data manipulation and handling.
Stanford Parser
: Used for syntactic parsing of text, which involves analyzing the grammatical structure of sentences.stanford-parser-3.9.1-models
: This package contains pre-trained models that the parser uses to analyze text.
- Download Audio: Using
yt-dlp
, download the audio from the provided YouTube URL. - Convert to Mono: Ensure the audio is in mono format using
pydub
. - Transcribe Audio: Use Google Cloud Speech-to-Text API to transcribe the audio into text.
- Translate to ISL: Convert the transcribed text to ISL syntax using
nltk
and Stanford Parser. - Compile Video: Use
MoviePy
to compile the translated text into a sign language video.
- Extract Audio: Extract audio from the uploaded video or audio file using
ffmpeg
. - Transcribe Audio: Transcribe the extracted audio using Google Cloud Speech-to-Text API.
- Translate to ISL: Convert the transcribed text to ISL syntax.
- Compile Video: Compile the translated text into a sign language video.
- Translate to ISL: Directly convert the input text to ISL syntax.
- Compile Video: Compile the translated text into a sign language video using appropriate video clips and GIFs.
-
Setting Up Environment:
- Install necessary libraries and tools.
- Set up Google Cloud credentials and APIs.
-
Developing the Backend:
- Implement the
VideoProcessor
class to handle downloading, audio processing, and transcription. - Develop functions for text processing and translation to ISL.
- Implement the
-
Creating the Frontend:
- Use Streamlit to create an intuitive web interface for users to input YouTube URLs, upload files, or enter text.
- Integrate backend processing with the frontend to provide real-time feedback and results.
-
Testing and Optimization:
- Test the application with various inputs to ensure accuracy and robustness.
- Optimize the processing pipeline for efficiency and speed.
-
Google Cloud Account: Ensure you have a Google Cloud account. If not, you can sign up here.
-
Google Cloud SDK: Install the Google Cloud SDK by following the instructions here.
- Go to the Google Cloud Console.
- Click on the project drop-down menu at the top of the page.
- Click New Project.
- Enter a name for your project.
- Click Create.
- Go to the API Library.
- Search for "Cloud Speech-to-Text API".
- Click on the "Cloud Speech-to-Text API" result.
- Click Enable.
- Go to the Credentials page in the Cloud Console.
- Click Create credentials and select Service account.
- Enter a name for your service account and click Create and continue.
- Assign the role "Project" > "Editor" and click Continue.
- Click Done.
- In the service account list, click on the newly created service account.
- Click Keys and then Add key > Create new key.
- Select JSON and click Create. Save the downloaded JSON file securely.
- Open your terminal.
- Initialize the Google Cloud SDK by running:
gcloud init
- Authenticate with your Google account and select your newly created project.
- Set the environment variable to the path of your service account key file:
Replace
export GOOGLE_APPLICATION_CREDENTIALS="[PATH_TO_YOUR_SERVICE_ACCOUNT_KEY_JSON]"
[PATH_TO_YOUR_SERVICE_ACCOUNT_KEY_JSON]
with the actual file path.
- Open the Google Cloud Console.
- Navigate to Storage > Browser.
- Click Create bucket.
- Enter a unique name for your bucket.
- Select a Location type and Location for your bucket.
- Choose a Default storage class.
- Configure Access control:
- For simplicity, you can choose Uniform.
- Click Create.
- Update the paths of JSON file which you've downloaded in main code
- Update the name of bucket correctly in main code
-
Download the
stanford-parser.jar
andstanford-parser-3.9.1-models.jar
from the following link:http://nlp.stanford.edu/software/stanford-parser-4.2.1.zip
- Update the path location in
textToISL.py
- Update the path location in
-
Download the
ffmpeg.exe
for audio processing from the following link:https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z
- Update the path location in
VideoProessor.py
- Update the path location in
-
Download the latest version of
JDK
for creating the JAVA Environment to access the two.jar
files from the below link:https://download.oracle.com/java/22/latest/jdk-22_windows-x64_bin.zip
- Update the
Java.exe
location intextToISL.py
- Update the
-
Clone the Repository:
git clone https://github.com/SaiNivedh26/Hackathon-June-2024 cd Hackathon-June-2024
-
Install the required Libraries:
pip install -r requirements.txt
-
Run the app.py file in the terminal:
streamlit run app.py