用于评估先进唇读网络的代码和模型
This repository contains code for evaluating the best performing lip reading model described in the paper Deep Lip Reading: A comparison of models and an online application. The model is based on the Transformer architecture.
| Input | Crop | Enc-Dec Attention | Prediction |
|---|---|---|---|
Recommended way to install the python dependencies is creating a new virtual environment and then running
pip install -r requirements.txtTo verify that everything works
python main.py --lip_model_path models/lrs2_lip_model expected output:
(wer=0.0) IT'S-THAT-SIMPLE --> IT'S-THAT-SIMPLE
1/1 [================] - ETA: 0:00:00 - cer: 0.00 - wer: 0.00To visualize the input, attention matrix and predictions set the --tb_eval flag to 1 (not supported with beam search)
python main.py --lip_model_path models/lrs2_lip_model --tb_eval 1 --img_channels 3Then point tensorboard to the resulting log directory
tensorboard --logdir=eval_tb_logsThe models have been trained and evaluated on the LRW and LRS datasets as well as the non-public MVLRS dataset. More details can be found in the paper.
To evaluate on LRS2 download and extract the dataset into e.g. data/lrs2
For a quick evaluation on the test set without beam search run:
python main.py --gpu_id 0 --lip_model_path models/lrs2_lip_model --data_path data/lrs2/main --data_list media/lrs2_test_samples.txt This should take a few minutes on a GPU and result in a WER of approximately 58%.
expected output:
…For the best results, run a full beam search, using the language model and performing simple test-time augmentation in the form of horizontal flips.
python main.py --gpu_id 0 --lip_model_path models/lrs2_lip_model --lm_path models/lrs2_language_model --data_path data/lrs2/main --data_list media/lrs2_test_samples.txt --graph_type infer --test_aug_times 2 --beam_size 35This will take a few hours to complete on a GPU and give WER of approx. 49%.
If you use this code, please cite:
@InProceedings{Afouras18b,
author = "Afouras, T. and Chung, J.~S. and Zisserman, A.",
title = "Deep Lip Reading: a comparison of models and an online application",
booktitle = "INTERSPEECH",
year = "2018",
}The Transformer model is based on the implementation of Kyubyong.
The beam search was adapted from Tensor2Tensor.
The char-RNN language model uses code from sherjilozair.
暂无开放 Issues,或尚未同步最近议题。