File size: 1,113 Bytes
8310a1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
'''Converts the LRW video names in filelists to LRW relative paths and dumps them unto new filelists'''
import os
filelist = "../filelists/lrw_cross.txt" 

filelist_split_path = filelist.replace(".txt","_relative_path.txt")
with open(filelist, 'r') as f:
        lines = f.readlines()
with open(filelist_split_path, 'w') as f:
    for i in range(len(lines)):
        audio_name, video_name=lines[i].split(' ')
        audio_word = audio_name.split('_')[0]
        video_word = video_name.split('_')[0]
        f.write(os.path.join(audio_word,'test',audio_name)+' '+os.path.join(video_word,'test',video_name))

filelist = "../filelists/lrw_reconstruction.txt" 

filelist_split_path = filelist.replace(".txt","_relative_path.txt")
with open(filelist, 'r') as f:
        lines = f.readlines()
with open(filelist_split_path, 'w') as f:
    for i in range(len(lines)):
        audio_name, video_name=lines[i].split(' ')
        audio_word = audio_name.split('_')[0]
        video_word = video_name.split('_')[0]
        f.write(os.path.join(audio_word,'test',audio_name)+' '+os.path.join(video_word,'test',video_name))