Home

Awesome

GNN-CCA

This is a DGL implementation of GNN-CCA for multi-view detections.

The original GNN-CCA was implemented in PyGeometric. This repo re-implements in DGL. Both are using PyTorch.

cover

Installation

  1. Install PyTorch (>= 1.9.0) and DGL (Python 3.7)
  2. Install other requirements and warmup_scheduler:
pip install -r requirements.txt
pip install git+https://github.com/ildoonet/pytorch-gradual-warmup-lr.git
  1. Install torchreid (follow its instruction)

Preparation

Dataset

Assume DATA_NAME is the directory in dataset folder.

  1. Download dataset. Please refer to dataset/${DATA_NAME}/README.md
  2. Run python preprocess/${DATA_NAME}.py with ${DATA_NAME} be the lower case. For example:
python preprocess/epfl.py

Model

  1. Download ReID model from here and assume its path is PATH_TO_REID_MODEL.
  2. You can also download the trained model from table below and assume its path is PATH_TO_MODEL.
Model NameDownload LinkTrain DatasetTest DatasetPerformance
gnn_cca_epflGoogle Drive <br/> Baidu Drive (m1he)EPFLEPFLSee Table 1

Note: all the trainings are under the same default configuration.

Table 1:

Test SequenceARIAMIHCV-mACC
basketball72.99858.40652.27066.79958.47697.035
laboratory91.98386.82185.71488.18486.88098.268
passageway71.21166.52864.71880.97067.08193.573
terrace90.74984.47883.06086.22884.52698.300

Training

Training model on a specific dataset.

For example, training on EPFL dataset with all sequences:

python run.py --train --reid-path ${PATH_TO_REID_MODEL} --epfl --seq-name all

training on EPFL dataset with specific sequences:

python run.py --train --reid-path ${PATH_TO_REID_MODEL} --epfl --seq-name terrace passageway

You can also change the ReID model (served as the feature extractor) refer to here, and assume its name is NAME_OF_REID_MODEL. Then you can train your model by running:

python run.py --reid-name ${NAME_OF_REID_MODEL} --reid-path ${PATH_TO_REID_MODEL} ...

After each epoch, the trained model will be saved in the directory assigned by --output.

Finally, denote PATH_TO_MODEL as the trained model.

Testing

Testing model on a specific dataset.

For example, testing on EPFL dataset with all sequences:

python run.py --test --reid-path ${PATH_TO_REID_MODEL} --ckpt ${PATH_TO_MODEL} --epfl --seq-name all

and you can also plot the results of some sequences by adding --visualize:

python run.py --test --reid-path ${PATH_TO_REID_MODEL} --ckpt ${PATH_TO_MODEL} --epfl --seq-name terrace laboratory --visualize

The results will be saved in the directory assigned by --output.

Results

Result of EPFL-basketball:

result1

Result of EPFL-laboratory:

result2

Citation

@article{luna2022gnncca,
  title={Graph Neural Networks for Cross-Camera Data Association},
  author={Luna, Elena and SanMiguel, Juan C. and Martínez, José M. and Carballeira, Pablo},
  journal={arXiv preprint arXiv:2201.06311},
  year={2022}
}