forked from RyanZotti/Self-Driving-Car
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Zotti
authored and
Ryan Zotti
committed
Oct 9, 2016
1 parent
5e6647b
commit e18fb11
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
from dataprep import video_to_rgb_npz, make_gamma_tables, process_session | ||
import os | ||
from util import shell_command | ||
|
||
data_path = '/Users/ryanzotti/Documents/repos/Self_Driving_RC_Car/data' | ||
data_folders = os.listdir(data_path) | ||
gamma_map = make_gamma_tables([1]) # I should refactor-out the gamma at some point. It's not needed here | ||
rgb = True | ||
|
||
for folder in data_folders: | ||
predictors, targets = process_session(data_path + '/' + folder, gamma_map, rgb) | ||
video_to_rgb_npz(data_path + '/' + folder,predictors,targets) | ||
print("saved folder: "+str(folder)) | ||
|
||
cmd = 'ls '+data_path + '/' + folder | ||
dir_contents = str(shell_command(cmd)) | ||
print("Started work on "+str(folder)) | ||
print(dir_contents) | ||
if 'predictors_and_targets.npz' not in dir_contents: | ||
predictors, targets = process_session(data_path + '/' + folder, gamma_map, rgb) | ||
video_to_rgb_npz(data_path + '/' + folder,predictors,targets) | ||
print("Completed work on: "+str(folder)+". Created new npz file.") | ||
else: | ||
print("Completed work on "+str(dir)+". File already exists. No processing necessary.") | ||
print("Finished.") |