Skip to content

Commit ab73be2

Browse files
RoyYang0714thomasehuangrenezurbruegg
authored
Refactor config for the Release. (#136)
* feat: cleanup code for the release. * feat: Update test data. * feat: Support submission for nuscenes. * feat: Update config typing; refactor ResNet, transformer and CC-3DT related. * Updating QDTrack zoo * Remove old QDTrack config * Fix minor issue in config * Update test data * feat: Update readme and scripts. * update page * feat: Update pyproject and fix new linting. * feat: Update version. --------- Co-authored-by: Thomas Huang <[email protected]> Co-authored-by: zrene <[email protected]>
1 parent b25086f commit ab73be2

File tree

215 files changed

+1821
-1213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+1821
-1213
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ coverage/
4343
# downloaded repos and models
4444
scalabel/bot/experimental/*
4545

46-
# python cache
47-
__pycache__/
48-
4946
# python virtual environment
5047
env/
5148

52-
5349
# vscode workspace configuration
5450
*.code-workspace
5551

README.md

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
A modular library for 4D scene understanding
1111
</p>
1212

13+
## Quickstart
14+
15+
You can checkout our [documentation](https://docs.vis.xyz/4d/index.html).
16+
17+
You can use the [template](https://github.com/SysCV/vis4d-template) here to start your own project with Vis4D.
18+
1319
## Installation
1420

1521
Installation is as easy as
@@ -26,20 +32,20 @@ python3 -m pip install vis4d
2632

2733
```bash
2834
# vis4d.engine
29-
python -m vis4d fit --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
35+
vis4d fit --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
3036

3137
# vis4d.pl
32-
python -m vis4d.pl fit --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
38+
vis4d-pl fit --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
3339
```
3440

3541
- To test a model
3642

3743
```bash
3844
# vis4d.engine
39-
python -m vis4d test --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
45+
vis4d test --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
4046

4147
# vis4d.pl
42-
python -m vis4d.pl test --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
48+
vis4d-pl test --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpus 1
4349
```
4450

4551
## DDP
@@ -53,18 +59,17 @@ python -m vis4d.pl test --config vis4d/zoo/faster_rcnn/faster_rcnn_coco.py --gpu
5359
./scripts/dist_train.sh <config-file> <num-gpus>
5460

5561
# vis4d.pl
56-
python -m vis4d.pl fit --config <config-file> --gpus <num-gpus>
62+
vis4d-pl fit --config <config-file> --gpus <num-gpus>
5763
```
5864

59-
- SLURM batch job. Need to config the submission file.
65+
- SLURM
6066

6167
```bash
6268
# vis4d.engine
63-
sbatch scripts/slurm_train.sh
69+
srun vis4d fit --config <config-file> --gpus <num-gpus> --slurm True
6470

6571
# vis4d.pl
66-
srun --cpus-per-task=4 --gres=gpumem:20G python -m vis4d.pl.run fit \
67-
--config <config-file> --gpus <num-gpus>
72+
srun vis4d-pl fit --config <config-file> --gpus <num-gpus>
6873
```
6974

7075
### Testing
@@ -76,20 +81,61 @@ srun --cpus-per-task=4 --gres=gpumem:20G python -m vis4d.pl.run fit \
7681
./scripts/dist_test.sh <config-file> <num-gpus>
7782

7883
# vis4d.pl
79-
python -m vis4d.pl test --config <config-file> --gpus <num-gpus>
84+
vis4d-pl test --config <config-file> --gpus <num-gpus>
8085
```
8186

82-
- SLURM batch job. Need to config the submission file.
87+
- SLURM
8388

8489
```bash
8590
# vis4d.engine
86-
sbatch scripts/slurm_test.sh
91+
srun vis4d test --config <config-file> --gpus <num-gpus> --slurm True
8792

8893
# vis4d.pl
89-
srun --cpus-per-task=4 --gres=gpumem:20G python -m vis4d.pl.run test \
90-
--config <config-file> --gpus <num-gpus>
94+
srun vis4d-pl test --config <config-file> --gpus <num-gpus>
9195
```
9296

93-
## Contribute
97+
## Acknowledgement
98+
Vis4D is a group effort by our team at ETH Zurich.
99+
[Yung-Hsu Yang](https://royyang0714.github.io/) built the current version and will be the main maintainer of the codebase.
100+
101+
Vis4D was originally written by [Tobias Fischer](https://tobiasfshr.github.io/) during the first three years of his Ph.D. at ETH Zurich, [Thomas E. Huang](https://www.thomasehuang.com/) helped contribute many models, [Tao Sun](https://www.suniique.com/) implemented the ViT models and designed the evaluation pipeline, and[René Zurbrügg](https://github.com/renezurbruegg) designed the config system.
102+
103+
104+
## Contributors
105+
**Project Leads**
106+
- [Yung-Hsu Yang](https://royyang0714.github.io/)*
107+
- [Tobias Fischer](https://tobiasfshr.github.io/)*
108+
109+
**Core Contributors**
110+
- [Thomas E. Huang](https://www.thomasehuang.com/)
111+
- [Tao Sun](https://www.suniique.com/)
112+
- [René Zurbrügg](https://renezurbruegg.github.io/)
113+
114+
**Advisors**
115+
- [Fisher Yu](https://www.yf.io/)
116+
117+
`*` denotes equal contribution
118+
119+
**We are open to contributions and suggestions, feel free to reach out to us.**
94120

95-
[Check out our contribution guidelines for this project](docs/source/contribute.rst)
121+
[Check out our contribution guidelines for this project](docs/source/dev_guide/contribute.rst)
122+
123+
**Community Contributors**
124+
125+
<a href="https://github.com/SysCV/vis4d/graphs/contributors">
126+
<img src="https://contrib.rocks/image?repo=SysCV/vis4d" />
127+
</a>
128+
129+
130+
## Citation
131+
132+
If you find Vis4D is useful for your research, please consider citing the following BibTeX entry.
133+
134+
```bibtex
135+
@misc{vis4d_2024,
136+
author = {{Yung-Hsu Yang and Tobias Fischer and Thomas E. Huang} and René Zurbrügg and Tao Sun and Fisher Yu},
137+
title = {Vis4D},
138+
howpublished = {\url{https://github.com/SysCV/vis4d}},
139+
year = {2024}
140+
}
141+
```

docs/source/user_guide/faster_rcnn_example.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,40 @@
22
"""Faster RCNN COCO training example."""
33
from __future__ import annotations
44

5+
import tempfile
6+
57
import lightning.pytorch as pl
68
import numpy as np
7-
import tempfile
89
from torch.optim import SGD
910
from torch.optim.lr_scheduler import LinearLR, MultiStepLR
1011

1112
from vis4d.config import class_config
12-
from vis4d.config.common.datasets.coco import (
13-
CONN_COCO_BBOX_EVAL,
14-
get_coco_detection_cfg,
15-
)
16-
from vis4d.config.common.models import get_faster_rcnn_cfg
17-
from vis4d.config.default import (
18-
get_default_callbacks_cfg,
19-
get_default_cfg,
20-
get_default_pl_trainer_cfg,
21-
)
22-
from vis4d.config.default.data_connectors import (
23-
CONN_BBOX_2D_TEST,
24-
CONN_BBOX_2D_TRAIN,
25-
)
2613
from vis4d.config.typing import (
2714
ExperimentConfig,
2815
ExperimentParameters,
2916
ParameterSweepConfig,
3017
)
31-
from vis4d.config.util import get_lr_scheduler_cfg, get_optimizer_cfg
32-
from vis4d.config.util.sweep import grid_search
18+
from vis4d.config.sweep import grid_search
3319
from vis4d.engine.callbacks import EvaluatorCallback
3420
from vis4d.engine.connectors import CallbackConnector, DataConnector
3521
from vis4d.eval.coco import COCODetectEvaluator
3622
from vis4d.op.base import ResNet
23+
from vis4d.zoo.base import (
24+
get_default_callbacks_cfg,
25+
get_default_cfg,
26+
get_default_pl_trainer_cfg,
27+
get_lr_scheduler_cfg,
28+
get_optimizer_cfg,
29+
)
30+
from vis4d.zoo.base.data_connectors import (
31+
CONN_BBOX_2D_TEST,
32+
CONN_BBOX_2D_TRAIN,
33+
)
34+
from vis4d.zoo.base.datasets.coco import (
35+
CONN_COCO_BBOX_EVAL,
36+
get_coco_detection_cfg,
37+
)
38+
from vis4d.zoo.base.models.faster_rcnn import get_faster_rcnn_cfg
3739

3840

3941
def get_config() -> ExperimentConfig:

docs/source/user_guide/getting_started.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
"from vis4d.vis.functional.image import imshow_bboxes\n",
255255
"\n",
256256
"from vis4d.config import instantiate_classes\n",
257-
"from vis4d.config.common.datasets.coco import get_coco_detection_cfg"
257+
"from vis4d.zoo.base.datasets.coco import get_coco_detection_cfg"
258258
]
259259
},
260260
{

docs/source/user_guide/install.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Installation
55
=======
66
Package
77
=======
8-
We currently support Python 3.9+ and PyTorch 1.10.0+.
8+
We currently support Python 3.10+ and PyTorch 2.0.0+.
99

1010
We recommand to install in a new virtual environment, e.g. conda or virtualenv.
1111

@@ -30,15 +30,24 @@ If you want to build the package from source and specify CUDA version, you can c
3030
git clone https://github.com/SysCV/vis4d.git
3131
cd vis4d
3232
33-
python3 -m pip install -r requirements/install.txt -f https://download.pytorch.org/whl/cu117/torch_stable.html
34-
python3 -m pip install -r requirements/torch-lib.txt
33+
python3 -m pip install -r requirements/install.txt -f https://download.pytorch.org/whl/cu118/torch_stable.html
3534
python3 -m pip install -e .
3635
3736
More information about torch and pytorch-lightning installation
3837

3938
- `PyTorch <https://pytorch.org/get-started/locally>`_
4039
- `PyTorch Lightning <https://lightning.ai/docs/pytorch/latest/>`_
4140

41+
-----------------------
42+
Install CUDA Operations
43+
-----------------------
44+
45+
Some functionalities in the library require CUDA operations. You can install them by running:
46+
47+
.. code:: bash
48+
49+
python3 -m pip install -r requirements/torch-lib.txt
50+
4251
================
4352
Directory Layout
4453
================

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ plugins = ["numpy.typing.mypy_plugin"]
9595
"terminaltables.*",
9696
"timm.*",
9797
"vis4d_cuda_ops.*",
98+
"fvcore.*",
9899
]
99100
ignore_missing_imports = true
100101

@@ -111,12 +112,12 @@ plugins = ["numpy.typing.mypy_plugin"]
111112

112113
[project]
113114
name = "vis4d"
114-
version = "0.0"
115+
version = "0.1.2"
115116
authors = [{name = "VIS @ ETH", email = "[email protected]"}]
116117
description = "Vis4D Python package for Visual 4D scene understanding"
117118
readme = "README.md"
118-
license = { text="Apache 2.0"}
119-
requires-python = ">=3.9.0"
119+
license = {text = "Apache 2.0"}
120+
requires-python = ">=3.10"
120121
classifiers = [
121122
"Programming Language :: Python :: 3",
122123
"License :: OSI Approved :: Apache Software License",
@@ -134,7 +135,7 @@ dependencies = {file = ["requirements/install.txt"]}
134135
include = ["vis4d*"]
135136

136137
[project.urls]
137-
"Documentation" = "https://vis.xyz/4d/"
138+
"Documentation" = "https://docs.vis.xyz/4d"
138139
"Source" = "https://github.com/syscv/vis4d"
139140
"Tracker" = "https://github.com/syscv/"
140141

requirements/install.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ tensorboard
1919
termcolor
2020
terminaltables
2121
timm>=0.6.0
22-
torch>=1.10
23-
torchvision>=0.11
22+
torch>=2.0.0
23+
torchvision>=0.15.1
2424
tqdm
2525
utm
2626
wheel

scripts/install_gpu_conda.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source $CONDA_PATH/etc/profile.d/conda.sh
44

55
if [ -z "$1" ]
66
then
7-
CUDA_VERSION=11.7
7+
CUDA_VERSION=11.8
88
else
99
CUDA_VERSION=$1
1010
fi
@@ -14,4 +14,4 @@ conda activate vis4d-dev
1414
conda install cudatoolkit=$CUDA_VERSION -c pytorch -c nvidia
1515
python3 -m pip install -r requirements/install.txt -f https://download.pytorch.org/whl/cu${CUDA_VERSION//.}/torch_stable.html
1616
python3 -m pip install -r requirements/torch-lib.txt
17-
python3 setup.py develop
17+
pip install -e .

scripts/slurm_test.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

scripts/slurm_train.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)