Home

Awesome

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:

Setup

Prerequisites

Tested Environments

Create Environment

Linux

# make sure replace the path with the correct one
export CUDAHOME="/usr/local/cuda"
bash create_env.bash

Windows

Set-ExecutionPolicy unrestricted
create_env.ps1

Download Data

git submodule update --init --recursive ./data

Prepare Dataset (Optional)

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

Download Checkpoints (Optional)

We provide all the checkpoints of models we used, including the baselines.

git submodule update --init --recursive ./checkpoints_tar_parts

Uncompress Checkpoints (Optional)

bash uncompress_checkpoints.bash

We also provide the bash script to compress the checkpoints again. So, you can delete checkpoints_tar_parts if you like to.

How to use

Please make sure the environment is activated

conda activate bevnet

Train Models

python ./src/train.py \
    --task-option-file ./configs/bevnet/mixed-all.yaml --use-gpus 0

Test Models

python src/test.py \
    --task-option-file checkpoints/BEVNet-all/mixed/option.yaml --use-gpus 0
python src/visualize_model_output.py \
    --model-output-file log/test/BEVNet-all/mixed/test/model-output.h5 -j 8
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:

bash test_models.bash
test_models.ps1

Citation

@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}
}