-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathcreate_stereo_filelist.py
42 lines (31 loc) · 1014 Bytes
/
create_stereo_filelist.py
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
#! /usr/bin/python
"""
Collect drive data set files
"""
import os
f = open('left_flow.txt', 'wb')
g = open('right_flow.txt', 'wb')
left = []
right = []
for root, dirs, files in os.walk('../../../data/FT/optical_flow/TRAIN/'):
for dirname in dirs:
if dirname == 'left':
files = os.listdir(root + '/left')
for filename in files:
if filename.find('.pfm') != -1:
left.append(os.path.join(root + '/left', filename))
elif dirname == 'right':
files = os.listdir(root + '/right')
for filename in files:
if filename.find('.pfm') != -1:
right.append(os.path.join(root + '/right', filename))
left.sort()
right.sort()
for line in left:
if line.find('0015_L.pfm') == -1 and line.find('into_past') == -1:
f.write(line + '\n')
for line in right:
if line.find('0015_R.pfm') == -1 and line.find('into_past') == -1:
g.write(line + '\n')
f.close()
g.close()