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

Overview

License CC BY-NC-SA 4.0 Python 3.6 Language 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 release DG-Net++: the extention of DG-Net for unsupervised cross-domain re-id.
  • 08/24/2019: We add the direct transfer learning results of DG-Net here.
  • 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

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

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

Dataset Preparation

Download the dataset Market-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 from Google Drive (or Baidu Disk password: rqvf). You may download and move it to the outputs.

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

Person re-id evaluation

  • Supervised learning
Market-1501 DukeMTMC-reID MSMT17 CUHK03-NP
[email protected] 94.8% 86.6% 77.2% 65.6%
mAP 86.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 as A→B.
Market→Duke Duke→Market Market→MSMT MSMT→Market Duke→MSMT MSMT→Duke
[email protected] 42.62% 56.12% 17.11% 61.76% 20.59% 61.89%
[email protected] 58.57% 72.18% 26.66% 77.67% 31.67% 75.81%
[email protected] 64.63% 78.12% 31.62% 83.25% 37.04% 80.34%
mAP 24.25% 26.83% 5.41% 33.62% 6.35% 40.69%

Image generation evaluation

Please check the README.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 in SSIM and FID.

Training

Train a teacher model

You may directly download our trained teacher model from Google Drive (or Baidu Disk password: rqvf). If you want to have it trained by yourself, please check the person 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 out configs/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 in outputs/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 from Google Drive (or Baidu Disk password: qxyh).

DG-Market Market-1501 (training)
#identity - 751
#images 128,307 12,936

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 include LSGAN, FDGAN and PG2GAN. 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 in person re-id baseline, MUNIT and DRIT.

License

Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International). The code is released for academic research use only. For commercial use, please contact [email protected].

Owner
NVIDIA Research Projects
NVIDIA Research Projects
ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs

ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs This is the code of paper ConE: Cone Embeddings for Multi-Hop Reasoning over Knowl

MIRA Lab 33 Dec 07, 2022
Mesh Graphormer is a new transformer-based method for human pose and mesh reconsruction from an input image

MeshGraphormer ✨ ✨ This is our research code of Mesh Graphormer. Mesh Graphormer is a new transformer-based method for human pose and mesh reconsructi

Microsoft 251 Jan 08, 2023
COCO Style Dataset Generator GUI

A simple GUI-based COCO-style JSON Polygon masks' annotation tool to facilitate quick and efficient crowd-sourced generation of annotation masks and bounding boxes. Optionally, one could choose to us

Hans Krupakar 142 Dec 09, 2022
A graph-to-sequence model for one-step retrosynthesis and reaction outcome prediction.

Graph2SMILES A graph-to-sequence model for one-step retrosynthesis and reaction outcome prediction. 1. Environmental setup System requirements Ubuntu:

29 Nov 18, 2022
LieTransformer: Equivariant Self-Attention for Lie Groups

LieTransformer This repository contains the implementation of the LieTransformer used for experiments in the paper LieTransformer: Equivariant Self-At

OxCSML (Oxford Computational Statistics and Machine Learning) 50 Dec 28, 2022
Neurons Dataset API - The official dataloader and visualization tools for Neurons Datasets.

Neurons Dataset API - The official dataloader and visualization tools for Neurons Datasets. Introduction We propose our dataloader API for loading and

1 Nov 19, 2021
Zen-NAS: A Zero-Shot NAS for High-Performance Deep Image Recognition

Zen-NAS: A Zero-Shot NAS for High-Performance Deep Image Recognition How Fast Compare to Other Zero-Shot NAS Proxies on CIFAR-10/100 Pre-trained Model

190 Dec 29, 2022
Flappy bird automation using Neuroevolution of Augmenting Topologies (NEAT) in Python

FlappyAI Flappy bird automation using Neuroevolution of Augmenting Topologies (NEAT) in Python Everything Used Genetic Algorithm especially NEAT conce

Eryawan Presma Y. 2 Mar 24, 2022
Code for Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations

Implementation for Iso-Points (CVPR 2021) Official code for paper Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations paper |

Yifan Wang 66 Nov 08, 2022
PyTorch implementation of neural style randomization for data augmentation

README Augment training images for deep neural networks by randomizing their visual style, as described in our paper: https://arxiv.org/abs/1809.05375

84 Nov 23, 2022
Moiré Attack (MA): A New Potential Risk of Screen Photos [NeurIPS 2021]

Moiré Attack (MA): A New Potential Risk of Screen Photos [NeurIPS 2021] This repository is the official implementation of Moiré Attack (MA): A New Pot

Dantong Niu 22 Dec 24, 2022
Prototypical Cross-Attention Networks for Multiple Object Tracking and Segmentation, NeurIPS 2021 Spotlight

PCAN for Multiple Object Tracking and Segmentation This is the offical implementation of paper PCAN for MOTS. We also present a trailer that consists

ETH VIS Group 328 Dec 29, 2022
A keras implementation of ENet (abandoned for the foreseeable future)

ENet-keras This is an implementation of ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation, ported from ENet-training (lua-t

Pavlos 115 Nov 23, 2021
9th place solution

AllDataAreExt-Galixir-Kaggle-HPA-2021-Solution Team Members Qishen Ha is Master of Engineering from the University of Tokyo. Machine Learning Engineer

daishu 5 Nov 18, 2021
这是一个unet-pytorch的源码,可以训练自己的模型

Unet:U-Net: Convolutional Networks for Biomedical Image Segmentation目标检测模型在Pytorch当中的实现 目录 性能情况 Performance 所需环境 Environment 注意事项 Attention 文件下载 Downl

Bubbliiiing 567 Jan 05, 2023
[CVPR 2022 Oral] MixFormer: End-to-End Tracking with Iterative Mixed Attention

MixFormer The official implementation of the CVPR 2022 paper MixFormer: End-to-End Tracking with Iterative Mixed Attention [Models and Raw results] (G

Multimedia Computing Group, Nanjing University 235 Jan 03, 2023
FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware.

FIRM-AFL FIRM-AFL is the first high-throughput greybox fuzzer for IoT firmware. FIRM-AFL addresses two fundamental problems in IoT fuzzing. First, it

356 Dec 23, 2022
Distilling Motion Planner Augmented Policies into Visual Control Policies for Robot Manipulation (CoRL 2021)

Distilling Motion Planner Augmented Policies into Visual Control Policies for Robot Manipulation [Project website] [Paper] This project is a PyTorch i

Cognitive Learning for Vision and Robotics (CLVR) lab @ USC 6 Feb 28, 2022
Milano is a tool for automating hyper-parameters search for your models on a backend of your choice.

Milano (This is a research project, not an official NVIDIA product.) Documentation https://nvidia.github.io/Milano Milano (Machine learning autotuner

NVIDIA Corporation 147 Dec 17, 2022
Anomaly detection analysis and labeling tool, specifically for multiple time series (one time series per category)

taganomaly Anomaly detection labeling tool, specifically for multiple time series (one time series per category). Taganomaly is a tool for creating la

Microsoft 272 Dec 17, 2022