From 8d1d0653de4d0e16d1df30a92bc3cfaa3c839676 Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Sun, 21 Aug 2016 16:31:53 -0400 Subject: sorted frames for compatibility with linux --- Code/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Code/utils.py') 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)] -- cgit v1.2.3-70-g09d2