Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdavchev committed Nov 4, 2017
1 parent 128411f commit d61bcb4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
19 changes: 11 additions & 8 deletions desire/utils/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def __init__(self,

# Define the path in which the process data would be stored
data_file = os.path.join(self.data_dir, "trajectories.cpkl")

self.frame_preprocess(data_file)
# If the file doesn't exist or forcePreProcess is true
if not os.path.exists(data_file) or preprocess:
print("Creating pre-processed data from raw data")
sys.stdout.flush()
# Preprocess the data from the csv files of the datasets
# Note that this data is processed in frames
self.frame_preprocess(data_file)
# if not os.path.exists(data_file) or preprocess:
# print("Creating pre-processed data from raw data")
# sys.stdout.flush()
# # Preprocess the data from the csv files of the datasets
# # Note that this data is processed in frames
# self.frame_preprocess(data_file)

# Load the processed data from the pickle file
self.load_preprocessed(data_file)
Expand All @@ -83,9 +83,12 @@ def frame_preprocess(self, data_file):
num_obj_data = []
# Index of the current dataset
dataset_index = 0

count = 0
# For each dataset
for subdir, dirs, files in os.walk(self.data_dir):
if count >= 2:
break
count += 1
for file in files:
# if dataset_index != leave_dataset and \
if dataset_index < self.leave_dataset and \
Expand Down
16 changes: 8 additions & 8 deletions utils/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def __init__(self,

# Define the path in which the process data would be stored
data_file = os.path.join(self.data_dir, "trajectories.cpkl")

# If the file doesn't exist or forcePreProcess is true
if not os.path.exists(data_file) or preprocess:
print("Creating pre-processed data from raw data")
sys.stdout.flush()
# Preprocess the data from the csv files of the datasets
# Note that this data is processed in frames
self.frame_preprocess(data_file)
self.frame_preprocess(data_file)
# # If the file doesn't exist or forcePreProcess is true
# if not os.path.exists(data_file) or preprocess:
# print("Creating pre-processed data from raw data")
# sys.stdout.flush()
# # Preprocess the data from the csv files of the datasets
# # Note that this data is processed in frames
# self.frame_preprocess(data_file)

# Load the processed data from the pickle file
self.load_preprocessed(data_file)
Expand Down

0 comments on commit d61bcb4

Please sign in to comment.