Coder Social home page Coder Social logo

mahfujur1 / efficient-person-generation-for-reid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lulujianjie/efficient-person-generation-for-reid

0.0 1.0 0.0 2.03 MB

efficient person image generation for re-identification application

Python 86.32% Jupyter Notebook 13.68%

efficient-person-generation-for-reid's Introduction

Towards Efficient Data Generation for Person ReID

Paper: "Towards Efficient Data Generation for Person Re-Identification" (under review)

This temporary repository holds the codebase, data, and models for our paper.

Pipeline

Visualized examples

Market1501 and DukeMTMC

Changing Clothes

Directory layout

.
├── data-generation-GAN     # training and testing code for data generation
│   └── ...                 
├── data-purifying-GCN      # training and testing code for data purifying
│   └── feature-extraction  # extract features for affinity graph construction
│       └── ...             
│   └── graph-clustering    # link prediction and data purifying
│       └── ...             
├──  person-reid-baselines  # training and testing code for person reid             
│       └── ...             
├── LICENSE
└── README.md

Prerequisites

  1. cd to folder where you want to download this repo

  2. Run git clone https://github.com/lulujianjie/efficient-person-generation-for-reid.git

  3. Install dependencies:

  4. Prepare dataset

    • Download the Market1501 and DukeMTMC-reID
    • Download the train/test splits and train/test key points annotations from Google Drive or Baidu Disk with extraction code 9e34, including market-pairs-train.csv, market-pairs-test.csv, market-annotation-train.csv, market-annotation-train.csv, duke-pairs-train.csv, duke-pairs-test.csv, duke-annotation-train.csv, duke-annotation-train.csv
    • Generate the body-part heatmaps, run
    python /data-generation-GAN/tool/generate_part_heatmap.py
  5. Prepare pretrained models if you don't have

    • Download the pretrained models from Google Drive or Baidu Disk, including gan_market.pth, gan_duke.pth, resnet50_person_reid_gan.pth, resnet50_person_reid_gcn.pth, gcn_20.pth, gcn_20_duke

Testing pretrained models

Evaluation on person re-identification

  1. To generate person images, modify the paths of root, datasets, pre-trained models, output in data-generation-GAN/config/cfg.py and run
python data-generation-GAN/generate_samples_market.py
python data-generation-GAN/generate_samples_duke.py
  1. To prepare features for graph convolutional network (GCN), modify the path of generated data in data-purifying-GCN/feature-extraction/datasets/NewDataset.py and modify the path of pre-trained model in data-purifying-GCN/feature-extraction/config/cfg.py. Run
python data-purifying-GCN/feature-extraction/get_feats.py
  1. cd data-purifying-GCN/graph-clustering/ and prepare data for GCN
python convert_npy_for_gcn.py
  1. To purify generated data using GCN, modify the path of pretrained model in ./config/cfg.py and run
python test.py
python purify.py
  1. To test reID performance, cd .. && cd .. && cd person-reid-baselines, modify the data path in main.py of each baseline and run
python main.py

Evaluation on person generation

  1. Modify the paths of root, datasets, pre-trained models, and output in data-generation-GAN/config/cfg.py
  2. To evaluate SSMI of our generated results on Market1501, run
python test.py
  1. To evaluate FID of our generated results on Market1501, run
python tool/pytorch-fid/fid_score.py path/to/fake_imgs path/to/target_imgs

Training

  1. To train your own generative model, modify the paths of root, datasets, and output in data-generation-GAN/config/cfg.py, and run
python data-generation-GAN/train.py
  1. To train your own gcn model, modify the paths of dataset and output in data-purifying-GCN/graph-clustering/config/cfg.py, and run
python graph-clustering/train.py

Citation

Please cite the following paper if you use this repository in your research. TBD

Acknowledgment

TBD

Contact

TBD

efficient-person-generation-for-reid's People

Contributors

lulujianjie avatar

Watchers

 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.