# Producing and Leveraging Online Map Uncertainty in Trajectory Prediction
This repository contains the implementation of 'Producing and Leveraging Online Map Uncertainty in Trajectory Prediction'.

![](flowchart.png)

## Uncertainty Map Estimation

1\. Clone this repository:

Please extract the contents out of the code/ folder.


2\. Download [NuScenes](https://www.nuscenes.org/download) dataset to `./datasets/nuScenes`.

3\. Create a conda environment and install the dependencies:

The environments for each map estimation and prediction model are different. Please navigate to corresponding directories and install the dependencies as per instructions. In the future, we will provide a general environment installation. 

The code for each map estimation model are under `./MapTR_modified`, `./MapTR_v2_modified`, and `./StreamMapNet_modified`.


## Extract Motion Data using trajdata

After following the instructions of each map models to obtain the neceassary results. Then, run the following to obtain the processed motion data + map data

```
pip install trajdata
python adaptor_maptr.py
python adaptor_maptrv2_cent.py
python adaptor_stream.py
```

## Prediction

The code for prediction are under `./HiVT_modified`, `./DenseTNT_modified`.


