Skip to content

LeoHuang0511/DAANet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAANet

The official implementation of "Density-assisted Adaptive Alignment Network for Crowd Flux Estimation".

image

Installation

  • 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

Datasets

  • SenseCrowd:
    1. Download SenseCrowd from Baidu disk.
    2. 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.

Pretrained Weights

  • 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

Preparation

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
     

Training

  • 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 to HT21 or CARLA to change the training dataset.

Testing

  • 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 to test_HT21.py or test_CARLA.py to test the model trained on CroHD or CARLA.
  • Change --MODEL_PATH to load other pretrained weights.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published