Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions DATASETS.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Supported Datasets and Required Formats

## View-of-Delft
Nothing special needs to be done for the View-of-Delft Prediction dataset, simply download it as per [the instructions in the devkit README](https://github.com/tudelft-iv/view-of-delft-prediction-devkit?tab=readme-ov-file#vod-p-setup).

It should look like this after downloading:
```
/path/to/VoD/
├── maps/
├── v1.0-test/
└── v1.0-trainval/
```

## nuScenes
Nothing special needs to be done for the nuScenes dataset, simply download it as per [the instructions in the devkit README](https://github.com/nutonomy/nuscenes-devkit#nuscenes-setup).

Expand Down Expand Up @@ -199,30 +188,3 @@ It should look like this after downloading:
```

**Note**: Only the annotations need to be downloaded (not the videos).


## Argoverse 2 Motion Forecasting
The dataset can be downloaded from [here](https://www.argoverse.org/av2.html#download-link).

It should look like this after downloading:
```
/path/to/av2mf/
├── train/
| ├── 0000b0f9-99f9-4a1f-a231-5be9e4c523f7/
| | ├── log_map_archive_0000b0f9-99f9-4a1f-a231-5be9e4c523f7.json
| | └── scenario_0000b0f9-99f9-4a1f-a231-5be9e4c523f7.parquet
| ├── 0000b6ab-e100-4f6b-aee8-b520b57c0530/
| | ├── log_map_archive_0000b6ab-e100-4f6b-aee8-b520b57c0530.json
| | └── scenario_0000b6ab-e100-4f6b-aee8-b520b57c0530.parquet
| └── ...
├── val/
| ├── 00010486-9a07-48ae-b493-cf4545855937/
| | ├── log_map_archive_00010486-9a07-48ae-b493-cf4545855937.json
| | └── scenario_00010486-9a07-48ae-b493-cf4545855937.parquet
| └── ...
└── test/
├── 0000b329-f890-4c2b-93f2-7e2413d4ca5b/
| ├── log_map_archive_0000b329-f890-4c2b-93f2-7e2413d4ca5b.json
| └── scenario_0000b329-f890-4c2b-93f2-7e2413d4ca5b.parquet
└── ...
```
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The easiest way to install trajdata is through PyPI with
pip install trajdata
```

In case you would also like to use datasets such as nuScenes, Lyft Level 5, View-of-Delft, or Waymo Open Motion Dataset (which require their own devkits to access raw data or additional package dependencies), the following will also install the respective devkits and/or package dependencies.
In case you would also like to use datasets such as nuScenes, Lyft Level 5, or Waymo Open Motion Dataset (which require their own devkits to access raw data or additional package dependencies), the following will also install the respective devkits and/or package dependencies.
```sh
# For nuScenes
pip install "trajdata[nusc]"
Expand All @@ -31,13 +31,10 @@ pip install "trajdata[waymo]"
# For INTERACTION
pip install "trajdata[interaction]"

# For View-of-Delft
pip install "trajdata[vod]"

# All
pip install "trajdata[nusc,lyft,waymo,interaction,vod]"
pip install "trajdata[nusc,lyft,waymo,interaction]"
```
Then, download the raw datasets (nuScenes, Lyft Level 5, View-of-Delft, ETH/UCY, etc.) in case you do not already have them. For more information about how to structure dataset folders/files, please see [`DATASETS.md`](./DATASETS.md).
Then, download the raw datasets (nuScenes, Lyft Level 5, ETH/UCY, etc.) in case you do not already have them. For more information about how to structure dataset folders/files, please see [`DATASETS.md`](./DATASETS.md).

### Package Developer Installation

Expand Down Expand Up @@ -103,16 +100,13 @@ Currently, the dataloader supports interfacing with the following datasets:
| nuPlan Validation | `nuplan_val` | N/A | `boston`, `singapore`, `pittsburgh`, `las_vegas` | nuPlan validation split (90.30 GB) | 0.05s (20Hz) | :white_check_mark: |
| nuPlan Test | `nuplan_test` | N/A | `boston`, `singapore`, `pittsburgh`, `las_vegas` | nuPlan testing split (89.33 GB) | 0.05s (20Hz) | :white_check_mark: |
| nuPlan Mini | `nuplan_mini` | `mini_train`, `mini_val`, `mini_test` | `boston`, `singapore`, `pittsburgh`, `las_vegas` | nuPlan mini training/validation/test splits (942/197/224 scenes, 7.96 GB) | 0.05s (20Hz) | :white_check_mark: |
| View-of-Delft Train/TrainVal/Val | `vod_trainval` | `train`, `train_val`, `val` | `delft` | View-of-Delft Prediction training and validation splits | 0.1s (10Hz) | :white_check_mark: |
| View-of-Delft Test | `vod_test` | `test` | `delft` | View-of-Delft Prediction test split | 0.1s (10Hz) | :white_check_mark: |
| Waymo Open Motion Training | `waymo_train` | `train` | N/A | Waymo Open Motion Dataset `training` split | 0.1s (10Hz) | :white_check_mark: |
| Waymo Open Motion Validation | `waymo_val` | `val` | N/A | Waymo Open Motion Dataset `validation` split | 0.1s (10Hz) | :white_check_mark: |
| Waymo Open Motion Testing | `waymo_test` | `test` | N/A | Waymo Open Motion Dataset `testing` split | 0.1s (10Hz) | :white_check_mark: |
| Lyft Level 5 Train | `lyft_train` | `train` | `palo_alto` | Lyft Level 5 training data - part 1/2 (8.4 GB) | 0.1s (10Hz) | :white_check_mark: |
| Lyft Level 5 Train Full | `lyft_train_full` | `train` | `palo_alto` | Lyft Level 5 training data - part 2/2 (70 GB) | 0.1s (10Hz) | :white_check_mark: |
| Lyft Level 5 Validation | `lyft_val` | `val` | `palo_alto` | Lyft Level 5 validation data (8.2 GB) | 0.1s (10Hz) | :white_check_mark: |
| Lyft Level 5 Sample | `lyft_sample` | `mini_train`, `mini_val` | `palo_alto` | Lyft Level 5 sample data (100 scenes, randomly split 80/20 for training/validation) | 0.1s (10Hz) | :white_check_mark: |
| Argoverse 2 Motion Forecasting | `av2_motion_forecasting` | `train`, `val`, `test` | N/A | 250,000 motion forecasting scenarios of 11s each | 0.1s (10Hz) | :white_check_mark: |
| INTERACTION Dataset Single-Agent | `interaction_single` | `train`, `val`, `test`, `test_conditional` | `usa`, `china`, `germany`, `bulgaria` | Single-agent split of the INTERACTION Dataset (where the goal is to predict one target agents' future motion) | 0.1s (10Hz) | :white_check_mark: |
| INTERACTION Dataset Multi-Agent | `interaction_multi` | `train`, `val`, `test`, `test_conditional` | `usa`, `china`, `germany`, `bulgaria` | Multi-agent split of the INTERACTION Dataset (where the goal is to jointly predict multiple agents' future motion) | 0.1s (10Hz) | :white_check_mark: |
| ETH - Univ | `eupeds_eth` | `train`, `val`, `train_loo`, `val_loo`, `test_loo` | `zurich` | The ETH (University) scene from the ETH BIWI Walking Pedestrians dataset | 0.4s (2.5Hz) | |
Expand Down Expand Up @@ -234,3 +228,12 @@ If you use this software, please cite it as follows:

## TODO
- Create a method like finalize() which writes all the batch information to a TFRecord/WebDataset/some other format which is (very) fast to read from for higher epoch training.

## Protobuf
This branch is intended to compile protobuf files for use with Proto V4. In order to do this, install dev depedencies with `pip install trajdata[dev]` and use

```
python -m grpc_tools.protoc --python_out=src/trajdata/proto --proto_path=src/trajdata/proto --experimental_allow_proto3_optional src/trajdata/proto/vectorized_map.proto
```

To compile the vector map protobuf.
25 changes: 11 additions & 14 deletions examples/visualization_example.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from collections import defaultdict

import panel as pn
from torch.utils.data import DataLoader
from tqdm import tqdm

from trajdata import AgentBatch, AgentType, UnifiedDataset
from trajdata.visualization.interactive_animation import (
InteractiveAnimation,
animate_agent_batch_interactive,
)
from trajdata.visualization.interactive_animation import animate_agent_batch_interactive
from trajdata.visualization.interactive_vis import plot_agent_batch_interactive
from trajdata.visualization.vis import plot_agent_batch

Expand Down Expand Up @@ -51,17 +48,17 @@ def main():

batch: AgentBatch
for batch in tqdm(dataloader):
plot_agent_batch_interactive(batch, batch_idx=0, cache_path=dataset.cache_path)
plot_agent_batch(batch, batch_idx=0)
# plot_agent_batch_interactive(batch, batch_idx=0, cache_path=dataset.cache_path)
# plot_agent_batch(batch, batch_idx=0)

animation = InteractiveAnimation(
animate_agent_batch_interactive,
batch=batch,
batch_idx=0,
cache_path=dataset.cache_path,
server = pn.serve(
animate_agent_batch_interactive(
batch=batch, batch_idx=0, cache_path=dataset.cache_path
),
)
animation.show()
# break
server.io_loop.start()

break


if __name__ == "__main__":
Expand Down
13 changes: 4 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: Apache Software License",
]
name = "trajdata"
version = "1.4.0"
name = "trajdata-alpasim"
version = "1.4.3"
authors = [{ name = "Boris Ivanovic", email = "bivanovic@nvidia.com" }]
description = "A unified interface to many trajectory forecasting datasets."
readme = "README.md"
Expand All @@ -26,25 +26,20 @@ dependencies = [
"pandas>=1.4.1",
"pyarrow>=7.0.0",
"torch>=1.10.2",
"zarr>=2.11.0",
"kornia>=0.6.4",
"seaborn>=0.12",
"bokeh>=3.0.3",
"geopandas>=0.13.2",
"protobuf==3.19.4",
"protobuf>=4.0.0,<5.0.0",
"scipy>=1.9.0",
"opencv-python>=4.5.0",
"shapely>=2.0.0",
]

[project.optional-dependencies]
av2 = ["av2==0.2.1"]
dev = ["black", "isort", "pytest", "pytest-xdist", "twine", "build"]
dev = ["black", "isort", "pytest", "pytest-xdist", "twine", "build", "grpcio-tools==1.62.2"]
interaction = ["lanelet2==1.2.1"]
lyft = ["l5kit==1.5.0"]
nusc = ["nuscenes-devkit==1.1.9"]
waymo = ["tensorflow==2.11.0", "waymo-open-dataset-tf-2-11-0", "intervaltree"]
vod = ["vod-devkit==1.1.1"]

[project.urls]
"Homepage" = "https://github.com/nvr-avg/trajdata"
Expand Down
Loading
Loading