Last active
February 18, 2019 13:13
-
-
Save AdroitAnandAI/f3984de070a302caefc666200e2bae8f to your computer and use it in GitHub Desktop.
Dataset Parser
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
import numpy as np | |
import h5py | |
import scipy.misc | |
filePath = "comma-dataset/" | |
file="2016-03-29--10-50-20" | |
log = h5py.File(filePath+"log/"+file+".h5", "r") | |
cam = h5py.File(filePath+"camera/"+file+".h5", "r") | |
print(log.keys()) | |
skip = 300 | |
# skip to highway | |
for i in range(skip*100, log['times'].shape[0]): | |
# Parameter Values | |
img = cam['X'][log['cam1_ptr'][i]].swapaxes(0,2).swapaxes(0,1) | |
angle_steers = log['steering_angle'][i] | |
speed_ms = log['speed'][i] | |
brake = log['brake_user'][i] | |
accel = log['car_accel'][i] | |
scipy.misc.imsave(filePath+"pics/"+str(i)+".png", img[None, :, :, :].transpose(0, 3, 1, 2)[0][0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment