This project aims to develop a model that synchronizes lip movements in images based on the provided text input (words or phrases). The model leverages the MIRACL dataset, which contains a variety of images depicting individuals speaking specific words and phrases.
The objective of this project is to build a two-step CNN-RNN architecture. The CNN will be used for feature extraction from images, and the RNN (LSTM) will model the temporal patterns of lip movements corresponding to the text input.
The project utilizes the MIRACL dataset, which includes:
- Color images and depth images of male and female speakers.
- A total of 10 speakers, each uttering 10 different words and phrases.
- Frames corresponding to specific words, which will be used to train the model.
- Images are cropped to focus on facial regions using Haar cascade face detection.
- Images are resized to 224x224 pixels for input into the pre-trained VGGFace model.
- The data will be split into training, validation, and test sets to evaluate model performance.
- Clone the repository:
git clone https://github.com/ashishlal2003/lip-sync-model.git cd lip-sync-model - Setup a virtual environment, if you haven't already (For Windows):
python -m venv venv
venv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Setup the .env file from the provided template:
cp .env.sample .env
-
Download the MIRACL dataset from the official website.
-
In the
.envfile, set the path to the dataset:DATASET_PATH=/path/to/miracl-dataset
-
To preprocess the data, run the following command:
python src/preprocess_data.py
-
To train the model, run the following command:
python src/model.py
-
To evaluate the model, run the following command:
python src/evaluate.py
The project structure is as follows:
lip-sync-model/
├── notebooks/ # Jupyter notebooks for exploration
├── src/ # Python modules for the main application
│ ├── preprocessing.py
│ ├── model.py
│ └── training.py
├── requirements.txt # List of dependencies
├── README.md # Project overview
├── .env.sample # Template for environment variables
└── .gitignore # Files and directories to ignore
- Fork the repository.
- Create a new branch.
- Implement the changes.
- Send a pull request.