The official implementation of "Density-assisted Adaptive Alignment Network for Crowd Flux Estimation".
-
Clone this repo in the directory
root/DAANet/src/
cd root/DAANet/src git clone https://github.com/LeoHuang0511/DAANet.git
-
Create and activate the envirnment
cd root/DAANet/ pip install virtualenv virturalenv DAANet_env source ./DAANet_env/bin/activate
-
Install the dependencies (Python 3.8.10, PyTorch 2.1.2)
pip install -r requirements.txt
- SenseCrowd:
- Download SenseCrowd from Baidu disk.
- Download the original dataset form here and the lists of
train/val/test
sets at link1 or link2, and place them to each dataset folder, respectively.
- CroHD: Download CroHD from here.
- CARLA: Download CARLA from here.
- SenseCrowd: The weights trained with Sensecrowd can be download from here
- CroHD: The weights trained with CroHD can be download from here
- CARLA: The weights trained with CARLA can be download from here
Put the downloaded datasets in the directory root/datasets/
, forming the folder structure like:
root
├──DAANet
│ └──src
├──exp
│ └──pretrained
│ ├──SensCrowd.pth
│ ├──CroHD.pth
│ └──CARLA.pth
└──datasets
├──SensCrowd
├──CroHD
└──CARLA
- Run the following command to train your own model:
python train.py --DATASET SENSE --GPU_ID 0
- The checkpoints would be saved in
root/DAANet/exp/
. - Replace
--DATASET
toHT21
orCARLA
to change the training dataset.
- Run the following command to test the model pretrained on SenseCrowd:
python test_SENSE.py --MODEL_PATH ../exp/pretrained/SenseCrowd.pth --GPU_ID 0
- Replace
test_SENSE.py
totest_HT21.py
ortest_CARLA.py
to test the model trained on CroHD or CARLA. - Change
--MODEL_PATH
to load other pretrained weights.