BEV-Net: Assessing Social Distancing Compliance by Joint People Localization and Geometric Reasoning
PyTorch implementation of ICCV2021 paper, BEV-Net: Assessing Social Distancing Compliance by Joint People Localization and Geometric Reasoning, for estimating camera pose and analysing social distancing compliance with geometric reasoning:
- Windows or Linux
- NVIDIA GPU + CUDA cuDNN
- Windows
- PyTorch 1.8.2
- CUDA 11.1
- Linux
- PyTorch 1.8.2
- CUDA 11.1
# make sure replace the path with the correct one
export CUDAHOME="/usr/local/cuda"
bash create_env.bash
Set-ExecutionPolicy unrestricted
create_env.ps1
git submodule update --init --recursive ./data
Dataset should be ready when the submodule at data
is pulled.
python src/datasets/cityuhk/build_dataset.py
python src/datasets/cityuhk/build_datalist.py
We provide all the checkpoints of models we used, including the baselines.
git submodule update --init --recursive ./checkpoints_tar_parts
- Linux
bash uncompress_checkpoints.bash
- Windows: you may need to use tools like
7zip
to uncompress the files.
We also provide the bash script to compress the checkpoints again. So, you
can delete checkpoints_tar_parts
if you like to.
Please make sure the environment is activated
conda activate bevnet
python ./src/train.py \
--task-option-file ./configs/bevnet/mixed-all.yaml --use-gpus 0
-
If you want to collect all the test results in a single folder, please make sure
log/test
is created before running any test. Otherwise, test results will be saved along with the checkpoint file. -
Generate model output for the test dataset and calculate losses
python src/test.py \
--task-option-file checkpoints/BEVNet-all/mixed/option.yaml --use-gpus 0
- Generate visualization of the model output
python src/visualize_model_output.py \
--model-output-file log/test/BEVNet-all/mixed/test/model-output.h5 -j 8
- Run the SDCA metrics
python src/run_metrics.py \
--task-option-file checkpoints/BEVNet-all/mixed/option.yaml \
--model-output-file log/test/BEVNet-all/mixed/test/model-output.h5 \
--output-csv log/test/metric_result.csv \
--use-gpu 0
To test all the provided models, run the script:
- Linux
bash test_models.bash
- Windows
test_models.ps1
@misc{dai2021bevnet,
title={BEV-Net: Assessing Social Distancing Compliance by Joint People Localization and Geometric Reasoning},
author={Zhirui Dai and Yuepeng Jiang and Yi Li and Bo Liu and Antoni B. Chan and Nuno Vasconcelos},
year={2021},
eprint={2110.04931},
archivePrefix={arXiv},
primaryClass={cs.CV}
}