Skip to content

GoodarzMehr/UniTR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PWC

UniTR in CARLA

About

This is a fork of UniTR that can be trained and evaluated on data from the CARLA Simulator generated by SimBEV.

Installation

Without Docker

UniTR requires the following libraries:

  • Python >= 3.8, <3.9
  • PyTorch >= 1.1
  • nuscenes-dev-kit = 1.0.5
  • numpy = 1.23.3
  • numba = 0.48.0
  • SharedArray = 3.0.0
  • shapely = 1.8.4
  • llvmlite
  • tensorboardX
  • easydict
  • pyyaml
  • scikit-image
  • tqdm
  • torchvision
  • opencv-python
  • pyquaternion
  • spconv-cu113
  • av2
  • kornia
  • torch_scatter

After installing these dependencies, run

python setup.py develop

to install the codebase.

With Docker

  1. Install Docker on your system.
  2. Install the Nvidia Container Toolkit. It exposes your Nvidia graphics card to Docker containers.
  3. Install the Nvidia Container Runtime and set it as the default runtime.
  4. In the docker folder, run
docker build --no-cache --rm -t unitr:develop .

You may need to replace libnvidia-gl-550 and libnvidia-common-550 packages in the Dockerfile with ones that are compatible with your Nvidia driver version.

The following build arguments (ARG) are available:

  • USER: username inside each container, set to untr by default.

Launch a container by running

docker run --privileged --gpus all --network=host -e DISPLAY=$DISPLAY
-v [path/to/UniTR]:/home/unitr
-v [path/to/dataset]:/dataset
--shm-size 32g -it unitr:develop /bin/bash

Then, in /home/unitr, run

python setup.py develop

to install the codebase.

Usage

Training

For UniTR 3D object detection, run

bash scripts/dist_train.sh 4 --cfg_file ./cfgs/simbev_models/unitr.yaml --sync_bn --pretrained_model ../unitr_pretrain.pth --logger_iter_interval 50 --num_epochs_to_eval 10 --ckpt_save_time_interval 1800

For UniTR+LSS 3D object detection, run

bash scripts/dist_train.sh 4 --cfg_file ./cfgs/simbev_models/unitr+lss.yaml --sync_bn --pretrained_model ../unitr_pretrain.pth --logger_iter_interval 50 --num_epochs_to_eval 10 --ckpt_save_time_interval 1800

For UniTR BEV segmentation, run

bash scripts/dist_train.sh 4 --cfg_file ./cfgs/simbev_models/unitr_map.yaml --sync_bn --eval_map --logger_iter_interval 50 --num_epochs_to_eval 20 --ckpt_save_time_interval 1800

For UniTR+LSS BEV segmentation, run

bash scripts/dist_train.sh 4 --cfg_file ./cfgs/simbev_models/unitr_map+lss.yaml --sync_bn --eval_map --logger_iter_interval 50 --num_epochs_to_eval 20 --ckpt_save_time_interval 1800

Replace 4 in scripts/dist_train.sh 4 with the number of your GPUs. You can use --batch_size to specify the batch size (default 24) based on your available GPU memory.

If you want to evaluate on the test set instead of the val set, change test under INFO_PATH in cfgs/simbev_models/[model].yaml to ${infos/simbev_infos_test.json}.

Evaluation

For UniTR 3D object detection, run

bash scripts/dist_test.sh 4 --cfg_file ./cfgs/simbev_models/unitr.yaml --ckpt [checkpoint file]

For UniTR+LSS 3D object detection, run

bash scripts/dist_test.sh 4 --cfg_file ./cfgs/simbev_models/unitr+lss.yaml --ckpt [checkpoint file]

For UniTR BEV Segmentation, run

bash scripts/dist_test.sh 4 --cfg_file ./cfgs/simbev_models/unitr_map.yaml --ckpt [checkpoint file] --eval_map

For UniTR+LSS BEV Segmentation, run

bash scripts/dist_test.sh 4 --cfg_file ./cfgs/simbev_models/unitr_map+lss.yaml --ckpt [checkpoint file] --eval_map

Results

3D Object Detection

UniTR

Class AP (%) ATE (m) AOE (rad) ASE AVE (m/s)
Car 46.5 0.132 0.179 0.095 0.52
Truck 45.2 0.123 0.134 0.074 0.58
Bus 35.1 0.122 0.216 0.041 0.80
Motorcycle 52.3 0.075 0.216 0.105 0.62
Bicycle 54.4 0.087 0.168 0.146 0.49
Pedestrian 52.8 0.118 0.499 0.079 0.29
mean 47.7 0.113 0.224 0.090 0.55

SDS: 61.7% / Checkpoint

UniTR+LSS

Class AP (%) ATE (m) AOE (rad) ASE AVE (m/s)
Car 46.0 0.128 0.153 0.097 0.50
Truck 45.8 0.128 0.140 0.078 0.56
Bus 35.2 0.129 0.176 0.037 0.72
Motorcycle 52.1 0.091 0.148 0.096 0.61
Bicycle 55.0 0.085 0.155 0.121 0.49
Pedestrian 53.1 0.116 0.472 0.081 0.28
mean 47.8 0.113 0.207 0.085 0.53

SDS: 62.2% / Checkpoint

BEV Segmentation

Results are provided for different IoU thresholds.

UniTR

Class 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
road 85.7 89.1 91.0 92.2 92.8 92.5 91.4 89.3 85.5
car 31.2 49.6 63.1 71.3 73.8 67.4 57.4 45.8 29.8
truck 33.3 51.2 61.7 67.2 67.7 61.3 51.9 40.1 22.7
bus 39.5 53.5 56.7 55.5 51.7 45.1 37.8 29.8 17.9
motorcycle 6.2 17.6 29.1 37.4 36.5 22.7 7.2 0.3 0.0
bicycle 3.3 7.9 11.0 13.6 11.4 5.5 0.7 0.0 0.0
rider 5.3 15.5 25.7 35.7 36.2 17.4 1.7 0.0 0.0
pedestrian 3.0 11.1 19.9 30.2 27.5 3.9 0.0 0.0 0.0
mIoU 25.9 36.9 44.8 50.4 49.7 39.5 31.0 25.7 19.5

Checkpoint

UniTR+LSS

Class 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
road 86.0 89.4 91.3 92.6 93.3 93.0 92.0 90.1 86.4
car 32.2 50.6 63.0 70.9 72.8 66.1 55.8 44.3 28.8
truck 34.4 53.2 63.6 69.0 69.4 63.4 53.6 41.6 23.6
bus 44.4 57.2 61.7 62.0 58.5 51.4 42.9 33.5 21.3
motorcycle 8.3 19.5 29.1 36.3 35.9 21.6 5.8 0.3 0.0
bicycle 3.2 7.7 10.5 10.9 6.3 2.7 1.4 0.2 0.0
rider 6.5 15.7 24.4 32.1 31.6 14.8 1.3 0.0 0.0
pedestrian 3.1 10.2 17.7 25.1 12.9 0.2 0.0 0.0 0.0
mIoU 27.3 38.0 45.2 49.9 47.6 39.1 31.6 26.2 20.0

Checkpoint

About

Implementation of UniTR [ICCV 2023] using the SimBEV dataset.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.6%
  • Cuda 6.7%
  • C++ 4.0%
  • Other 0.7%