Giter Site home page Giter Site logo

ishine / leveraging-self-supervised-learning-for-avsr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lumia-group/leveraging-self-supervised-learning-for-avsr

0.0 0.0 0.0 80 KB

Official PyTorch implementation of paper Leveraging Uni-Modal Self Supervised Learning for Multimodal Audio-visual Speech Recognition

License: MIT License

Python 100.00%

leveraging-self-supervised-learning-for-avsr's Introduction

Leveraging Unimodal Self-Supervised Learning for Multimodal Audio-Visual Speech Recognition

Official PyTorch implementation of paper Leveraging Uni-Modal Self Supervised Learning for Multimodal Audio-visual Speech Recognition

How to install environment

  1. Clone the repo into a directory.
git clone https://github.com/LUMIA-Group/Leveraging-Self-Supervised-Learning-for-AVSR.git
  1. Install all required packages.
pip install -r requirements.txt

Noted that the Pytorch-Lightning lib do not support a wrapped ReduceLROnPlateau scheduler, we need to modify the lib manually by:

python -c "exec(\"import pytorch_lightning\nprint(pytorch_lightning.__file__)\")"
vi /path/to/pytorch_lightning/trainer/optimizers.py

and comments the 154-156 lines

# scheduler["reduce_on_plateau"] = isinstance(
#     scheduler["scheduler"], optim.lr_scheduler.ReduceLROnPlateau
# )

How to prepare dataset

  1. Download LRW dataset and LRS2 dataset
  2. Download pretrained MoCo v2 model and wav2vec 2.0 model
  3. Change the directory in config.py to "relative directory" relative to the project root directory
  4. Preprocessing the LRW dataset.
cd trainFrontend
python saveh5.py
  1. Preprocessing the LRS2 dataset.
python saveh5.py

How to train

  1. Train the visual front-end on LRW.
python trainfrontend.py
  1. Change the args["MOCO_FRONTEND_FILE"] in config.py to the trained front-end file, and config args["MODAL"] to choose modality.
  2. Train the AO and VO model first.
python train.py
  1. Then train the AV model. Before that, change the args["TRAINED_AO_FILE"] and args["TRAINED_VO_FILE"] to the trained AO and VO model.
python train.py

How to test

  1. Choose test configuration and model.
  2. Evaluate the visual word classification performance.
python evalfrontend.py
  1. Evaluate the AO/VO/AV model.
python eval.py

leveraging-self-supervised-learning-for-avsr's People

Contributors

xichenpan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.