summaryrefslogtreecommitdiff
path: root/Code
diff options
context:
space:
mode:
authorMatt Cooper <matthew_cooper@brown.edu>2016-08-21 16:31:53 -0400
committerMatt Cooper <matthew_cooper@brown.edu>2016-08-21 16:31:53 -0400
commit8d1d0653de4d0e16d1df30a92bc3cfaa3c839676 (patch)
tree774ad0628009b084a9457ab7776b0f8af078c1fe /Code
parent765a1c4a4dae54d0a6b42760845349ad39fe11f9 (diff)
sorted frames for compatibility with linux
Diffstat (limited to 'Code')
-rw-r--r--Code/utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Code/utils.py b/Code/utils.py
index 3a33d3f..6c9f891 100644
--- a/Code/utils.py
+++ b/Code/utils.py
@@ -25,7 +25,6 @@ def normalize_frames(frames):
return new_frames
-
def denormalize_frames(frames):
"""
Performs the inverse operation of normalize_frames.
@@ -74,11 +73,11 @@ def get_full_clips(data_dir, num_clips, num_rec_out=1):
(3 * (c.HIST_LEN + num_rec_out))])
# get num_clips random episodes
- ep_dirs = np.random.choice(glob(data_dir + '*'), num_clips)
+ ep_dirs = np.random.choice(glob(os.path.join(data_dir, '*')), num_clips)
# get a random clip of length HIST_LEN + num_rec_out from each episode
for clip_num, ep_dir in enumerate(ep_dirs):
- ep_frame_paths = glob(os.path.join(ep_dir, '*'))
+ ep_frame_paths = sorted(glob(os.path.join(ep_dir, '*')))
start_index = np.random.choice(len(ep_frame_paths) - (c.HIST_LEN + num_rec_out - 1))
clip_frame_paths = ep_frame_paths[start_index:start_index + (c.HIST_LEN + num_rec_out)]