Coder Social home page Coder Social logo

jamesliao714 / gnn-cca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shawnh2/gnn-cca

2.0 1.0 0.0 294 KB

DGL implementation of GNN-CCA: Graph Neural Networks for Cross-Camera Data Association [arXiv:2201.06311]

License: MIT License

Python 100.00%

gnn-cca's Introduction

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:
pip install -r requirements.txt
  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 Name Download Link Train Dataset Test Dataset Performance
gnn_cca_epfl Google Drive
Baidu Drive (m1he)
EPFL EPFL See Table 1

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

Table 1:

Test Sequence ARI AMI H C V-m ACC
basketball 72.998 58.406 52.270 66.799 58.476 97.035
laboratory 91.983 86.821 85.714 88.184 86.880 98.268
passageway 71.211 66.528 64.718 80.970 67.081 93.573
terrace 90.749 84.478 83.060 86.228 84.526 98.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}
}

gnn-cca's People

Contributors

shawnh2 avatar

Stargazers

廖品捷 avatar Cheng-Che, Cheng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.