/velodyne-dataset-utils

Primary LanguagePythonApache License 2.0Apache-2.0

Velodyne Dataset Utilities

This repository contains software for generating and reading binary datasets of Velodyne LiDAR frames.

Generating Datasets

Given a .pcap packet capture file generated by running a Velodyne HDL-32E sensor, parser.py parses the file and outputs it into a directory of .bin binary frame files, containing only the azumith and distance data from the .pcap file for each frame.

Reading from Datasets

dove_dataset.py contains the PyTorch dataset abstraction for the DOVe (Distance-Only Velodyne) dataset. By specifying a "clip length" and directory upon instantiation, the dataset is partitioned into clips of length n. The ith clip containing n frames can be read using dataset[i], the data is read from the corresponding DOVe files at access time due to the size of the dataset. The DatasetLoader PyTorch class can be used to shuffle and accelerate reading of the data as normal.

Instantiating your DOVeDataset in binning mode allows you to specify granularity number of bins per degree. For example, DOVeDataset('.',frames_per_clip=10,raw=False,granularity=3) will cause the clips to be read out as (10,1080,32) clips (360*3=1080) of binned frames. raw=True will instead cause the dataset to read out clips of raw data, or a length-10 list of frame dicts with key 'azumith' a detections length azumith numpy array and a _detections_x32 length frame distances array.

In order to get initialize the dataset for training, validation and testing splits, use CreateDOVeDatasets('.'). This will return a tuple containing (train, val, test), and will call DOVeDataset