Converts the h5 data from Unitraj (based on ScenarioNet) to the HPTR data format.
This tool can be installed by running the following commands:
conda create -n unitraj2hptr python=3.9.21
git clone https://github.com/marlon31415/unitraj2hptr.git
cd unitraj2hptr
pip install -e .
The conversion script expects .h5 Unitraj cache files as input. The original Unitraj repo converts the agent and map data to local coordinates. As HPTR expects global coordinates, we implemented a set of modifications necessary for the conversion pipeline which can be found in the modified Unitraj repo.
To preprocess the data follow this steps:
-
Install our modified ScenarioNet and convert data:
-
Install our modified Unitraj and generate cache files
-
Run the conversion script:
python convert.py --dataset split_to_convert --hptr_root_dir /path/to/hptr/output --unitraj_data_dir /path/to/input/dataThe conversion tool allows plotting scenarios while converting data, to activate this feature run:
python convert.py --dataset split_to_convert --hptr_root_dir /path/to/hptr/output --unitraj_data_dir /path/to/input/data --save_plotsNuScenes examples of default mode scenario HPTR outputs.


