File size: 1,069 Bytes
9f4b9c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import argparse

from nota_wav2lip.preprocess import get_cropped_face_from_lrs3_label


def parse_args():

    parser = argparse.ArgumentParser(description="NotaWav2Lip: Get LRS3 video sample with the label text file")

    parser.add_argument(
        '-i',
        '--input-file',
        type=str,
        required=True,
        help="Path of the label text file downloaded from https://mmai.io/datasets/lip_reading"
    )

    parser.add_argument(
        '-o',
        '--output-dir',
        type=str,
        default="sample_video_lrs3",
        help="Output directory to save the result. Defaults: sample_video_lrs3"
    )

    parser.add_argument(
        '--ignore-cache',
        action='store_true',
        help="Whether to force downloading and resampling video and overwrite pre-existing files"
    )

    args = parser.parse_args()

    return args


if __name__ == '__main__':
    args = parse_args()

    get_cropped_face_from_lrs3_label(
        args.input_file,
        video_root_dir=args.output_dir,
        ignore_cache = args.ignore_cache
    )