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.
separate process for getting file size
- Loading branch information
Ryan Zotti
authored and
Ryan Zotti
committed
Sep 10, 2016
1 parent
f7df51c
commit 9ab9339
Showing
1 changed file
with
24 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import numpy as np | ||
import argparse | ||
from util import shell_command, remove_file_if_exists | ||
|
||
''' | ||
python frame_count.py \ | ||
-i /Users/ryanzotti/Documents/repos/Self_Driving_RC_Car/final_processed_data_3_channels.npz \ | ||
-o /Users/ryanzotti/Documents/repos/Self_Driving_RC_Car/ | ||
''' | ||
|
||
ap = argparse.ArgumentParser() | ||
ap.add_argument("-i", "--input", required = True, help = "path to input numpy dataset") | ||
ap.add_argument("-o", "--output", required = True, help = "path to shape output") | ||
args = vars(ap.parse_args()) | ||
input_path = args["input"] | ||
output_path = args["output"] | ||
npzfile = np.load(input_path) | ||
train_predictors = npzfile['train_predictors'] | ||
train_targets = npzfile['train_targets'] | ||
|
||
shape = train_predictors.shape | ||
shape = shape[0] | ||
remove_file_if_exists(output_path+'/shape') | ||
shell_command('echo "{shape}" >> {output}/shape'.format(shape=str(shape),output=output_path)) |