Skip to content

Instantly share code, notes, and snippets.

@AdroitAnandAI
Last active Feb 18, 2019
Embed
What would you like to do?
Dataset Parser
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