Git Product home page Git Product logo

person-reid_gan's Introduction

Person-reID_GAN

This repository contains the code for our paper Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro.

1.Unsupervised Learning (GAN)

The first stage is to generate fake images by DCGAN. We used the code provided in https://github.com/carpedm20/DCGAN-tensorflow and modify some hyper-parameters at https://github.com/layumi/DCGAN-tensorflow. You can directly use my forked code.

For more reference, you can find our modified training code and generating code in ./DCGAN. We wrote a detailed README. If you still has some question, feel free to contact me ([email protected]).

2.Semi-supervised Learning

The second stage is to combine the original data and generated data to train the network. This repos includes the baseline code and the three different methods in the paper.

Models               Reference
resnet52_market.m       ResNet50 baseline
resnet52_market_K_1.m One extra class for generated images
resnet52_market_lsro.m The proposed method, uniform probability
resnet52_market_pseudo.m Give the most likely label for generated images

Compile Matconvnet

(Note that I have included my Matconvnet in this repo, so you do not need to download it again. I has changed some codes comparing with the original version. For example, one of the difference is in /matlab/+dagnn/@DagNN/initParams.m. If one layer has params, I will not initialize it again, especially for pretrained model.)

You just need to uncomment and modify some lines in gpu_compile.m and run it in Matlab. Try it~

(The code does not support cudnn 6.0. You may just turn off the Enablecudnn or try cudnn5.1)

If you fail in compilation, you may refer to http://www.vlfeat.org/matconvnet/install/

Dataset

Download Market1501 Dataset We take Market1501 as an example in this repos and you can easily extend it to other datasets.

ImageNet Pretrained model

  1. Make a dir called data by typing mkdir ./data.

  2. Download ResNet-50 model pretrained on Imagenet. Put it in the data dir.

Train the Baseline code

  1. Add your dataset path into prepare_data.m and run it. Make sure the code outputs the right image path.

  2. Run train_id_net_res_market_new.m.

Train with generated data

  1. Add your generated data path into prepare_data_gan.m and run it. It will add generated image path into the original image database.

  2. Run train_id_net_res_market_K_1.m for training extra-class method.

Or run train_id_net_res_market_lsro.m for training the proposed method.

Or run train_id_net_res_market_pseudo.m for training the pseudo-label method.

(What's new: I also include train_id_net_res_2stream_gan.m for training the code with the method proposed in my another paper. I do not import all files, and you may find the missing code in https://github.com/layumi/2016_person_re-ID. )

Test

  1. Run test/test_gallery_query_crazy.m to extract the features of images in the gallery and query set. They will store in a .mat file. Then you can use it to do evaluation.
  2. Evaluate feature on the Market-1501. Run evaluation/zzd_evaluation_res_faster.m.

Citation

Please cite this paper in your publications if it helps your research:

@inproceedings{zheng2017unlabeled,
  title={Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro},
  author={Zheng, Zhedong and Zheng, Liang and Yang, Yi},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},
  year={2017}
}

Related Repos

  1. 2stream Person re-ID
  2. Pedestrian Alignment Network

person-reid_gan's People

Contributors

layumi avatar

Watchers

James Cloos avatar paper2code - bot 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.