Note

This Python sample is available only with our Professional plan.

Generate HDF5

This Python script allows you to convert one or multiple RAW or DAT files to precomputed tensor features in HDF5 datasets.

Expected Output

HDF5 file(s) which share the name as the input files.

Setup & requirements

The basic input to run the script:

  • a list of paths or a path to the RAW or DAT files. You can use files from our Sample Recordings.

How to start

To run it on a single RAW file with Event Cube preprocessing function:

Linux

python3 generate_hdf5.py file.raw -o /path/to/output --event_cube

Windows

python generate_hdf5.py file.raw -o /path/to/output --event_cube

You can preprocess multiple input files by providing a list of input paths. For example:

Linux

python3 generate_hdf5.py file1.raw file2.raw -o /path/to/output

Windows

python generate_hdf5.py file1.raw file2.raw -o /path/to/output

You can preprocess all the file of a directory by using wildcards. For example, if the RAW files are in /path/to/dataset, you can call:

Linux

python3 generate_hdf5.py /path/to/dataset/* -o /path/to/output

Windows

python generate_hdf5.py /path/to/dataset/* -o /path/to/output

Note

  1. use –max-duration-ms to set the maximum storage duration in ms. If the raw data is longer than this period, then several hdf5 files will be produced accordingly.

  2. use –box-labels to process the label files together with the RAW or DAT input files.

To find the full list of options, run:

Linux

python3 generate_hdf5.py -h

Windows

python generate_hdf5.py -h