forked from RyanZotti/Self-Driving-Car
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame_count.py
24 lines (21 loc) · 872 Bytes
/
frame_count.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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))