Generate HDF5 Tensor Files
This Python script allows you to convert one or multiple RAW or DAT files to precomputed tensor features in HDF5 tensor files.
The source code of this sample can be found in <install-prefix>/share/metavision/sdk/ml/python_samples/generate_hdf5
when installing Metavision SDK from installer or packages. For other deployment methods, check the page
Path of Samples.
Expected Output
This sample outputs HDF5 tensor 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:
python generate_hdf5.py file.raw -o /path/to/output --preprocess event_cube
You can preprocess multiple input files by providing a list of input paths. For example:
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:
python generate_hdf5.py /path/to/dataset/* -o /path/to/output
Note
use –max-duration-ms to set the maximum storage duration in ms. If the raw data is longer than this period, then several HDF5 tensor files will be produced accordingly.
use –box-labels to process the label files together with the RAW or DAT input files.
python generate_hdf5.py -h