Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

👫 Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral) 👫

License

NotificationsYou must be signed in to change notification settings

NVlabs/DG-Net

Repository files navigation

License CC BY-NC-SA 4.0Python 3.6Language grade: Python

Joint Discriminative and Generative Learning for Person Re-identification

[Project][Paper][YouTube][Bilibili][Poster][Supp]

Joint Discriminative and Generative Learning for Person Re-identification, CVPR 2019 (Oral)
Zhedong Zheng,Xiaodong Yang,Zhiding Yu,Liang Zheng,Yi Yang,Jan Kautz

Table of contents

News

  • 02/18/2021: We releaseDG-Net++: the extention of DG-Net for unsupervised cross-domain re-id.
  • 08/24/2019: We add the direct transfer learning results of DG-Nethere.
  • 08/01/2019: We add the support of multi-GPU training:python train.py --config configs/latest.yaml --gpu_ids 0,1.

Features

We have supported:

  • Multi-GPU training (fp32)
  • APEX to save GPU memory (fp16/fp32)
  • Multi-query evaluation
  • Random erasing
  • Visualize training curves
  • Generate all figures in the paper

Prerequisites

  • Python 3.6
  • GPU memory >= 15G (fp32)
  • GPU memory >= 10G (fp16/fp32)
  • NumPy
  • PyTorch 1.0+
  • [Optional] APEX (fp16/fp32)

Getting Started

Installation

  • InstallPyTorch
  • Install torchvision from the source:
git clone https://github.com/pytorch/visioncd visionpython setup.py install
  • [Optional] You may skip it. Install APEX from the source:
git clone https://github.com/NVIDIA/apex.gitcd apexpython setup.py install --cuda_ext --cpp_ext
  • Clone this repo:
git clone https://github.com/NVlabs/DG-Net.gitcd DG-Net/

Our code is tested on PyTorch 1.0.0+ and torchvision 0.2.1+ .

Dataset Preparation

Download the datasetMarket-1501[Google Drive][Baidu Disk]

Preparation: put the images with the same id in one folder. You may use

python prepare-market.py# for Market-1501

Note to modify the dataset path to your own path.

Testing

Download the trained model

We provide our trained model. You may download it fromGoogle Drive (orBaidu Disk password: rqvf). You may download and move it to theoutputs.

├── outputs/│   ├── E0.5new_reid0.5_w30000├── models│   ├── best/

Person re-id evaluation

  • Supervised learning
Market-1501DukeMTMC-reIDMSMT17CUHK03-NP
Rank@194.8%86.6%77.2%65.6%
mAP86.0%74.8%52.3%61.1%
  • Direct transfer learning
    To verify the generalizability of DG-Net, we train the model on dataset A and directly test the model on dataset B (with no adaptation).We denote the direct transfer learning protocol asA→B.
Market→DukeDuke→MarketMarket→MSMTMSMT→MarketDuke→MSMTMSMT→Duke
Rank@142.62%56.12%17.11%61.76%20.59%61.89%
Rank@558.57%72.18%26.66%77.67%31.67%75.81%
Rank@1064.63%78.12%31.62%83.25%37.04%80.34%
mAP24.25%26.83%5.41%33.62%6.35%40.69%

Image generation evaluation

Please check theREADME.md in the./visual_tools.

You may use the./visual_tools/test_folder.py to generate lots of images and then do the evaluation. The only thing you need to modify is the data path inSSIM andFID.

Training

Train a teacher model

You may directly download our trained teacher model fromGoogle Drive (orBaidu Disk password: rqvf).If you want to have it trained by yourself, please check theperson re-id baseline repository to train a teacher model, then copy and put it in the./models.

├── models/│   ├── best/                   /* teacher model for Market-1501│       ├── net_last.pth        /* model file│       ├── ...

Train DG-Net

  1. Setup the yaml file. Check outconfigs/latest.yaml. Change the data_root field to the path of your prepared folder-based dataset, e.g.../Market-1501/pytorch.

  2. Start training

python train.py --config configs/latest.yaml

Or train with low precision (fp16)

python train.py --config configs/latest-fp16.yaml

Intermediate image outputs and model binary files are saved inoutputs/latest.

  1. Check the loss log
 tensorboard --logdir logs/latest

DG-Market

We provide our generated images and make a large-scale synthetic dataset called DG-Market. This dataset is generated by our DG-Net and consists of 128,307 images (613MB), about 10 times larger than the training set of original Market-1501 (even much more can be generated with DG-Net). It can be used as a source of unlabeled training dataset for semi-supervised learning. You may download the dataset fromGoogle Drive (orBaidu Disk password: qxyh).

DG-MarketMarket-1501 (training)
#identity-751
#images128,30712,936

Quick Download viagdrive

wget https://github.com/prasmussen/gdrive/releases/download/2.1.1/gdrive_2.1.1_linux_386.tar.gztar -xzvf gdrive_2.1.1_linux_386.tar.gzgdrive download 126Gn90Tzpk3zWp2c7OBYPKc-ZjhptKDounzip DG-Market.zip

Tips

Note the format of camera id and number of cameras. For some datasets (e.g., MSMT17), there are more than 10 cameras. You need to modify the preparation and evaluation code to read the double-digit camera id. For some vehicle re-id datasets (e.g., VeRi) having different naming rules, you also need to modify the preparation and evaluation code.

Citation

Please cite this paper if it helps your research:

@inproceedings{zheng2019joint,title={Joint discriminative and generative learning for person re-identification},author={Zheng, Zhedong and Yang, Xiaodong and Yu, Zhiding and Zheng, Liang and Yang, Yi and Kautz, Jan},booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},year={2019}}

Related Work

Other GAN-based methods compared in the paper includeLSGAN,FDGAN andPG2GAN. We forked the code and made some changes for evaluatation, thank the authors for their great work. We would also like to thank to the great projects inperson re-id baseline,MUNIT andDRIT.

License

Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under theCC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International). The code is released for academic research use only. For commercial use, please contactresearchinquiries@nvidia.com.


[8]ページ先頭

©2009-2025 Movatter.jp