diff options
| author | Matt Cooper <matthew_cooper@brown.edu> | 2016-08-17 19:51:18 -0400 |
|---|---|---|
| committer | Matt Cooper <matthew_cooper@brown.edu> | 2016-08-17 19:51:18 -0400 |
| commit | 14ad89afcfe776d6ca290856bd24256a6e9bdc89 (patch) | |
| tree | 61bae700c5c0190205f94bbb2896feb9aa9eae22 /Code/utils.py | |
| parent | 9177c7e9696b4fbd6feaecb0067ac1fce0cb5bdb (diff) | |
safe path joining with os.path.join
Diffstat (limited to 'Code/utils.py')
| -rw-r--r-- | Code/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Code/utils.py b/Code/utils.py index 2b97bdb..c2bf856 100644 --- a/Code/utils.py +++ b/Code/utils.py @@ -2,6 +2,7 @@ import tensorflow as tf import numpy as np from scipy.ndimage import imread from glob import glob +import os import constants as c from tfutils import log10 @@ -77,7 +78,7 @@ def get_full_clips(data_dir, num_clips, num_rec_out=1): # get a random clip of length HIST_LEN + 1 from each episode for clip_num, ep_dir in enumerate(ep_dirs): - ep_frame_paths = glob(ep_dir + '/*') + ep_frame_paths = 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)] |
