Giter Site home page Giter Site logo

zhangmaom / mar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kovenyu/mar

0.0 1.0 0.0 4.37 MB

Pytorch code for our CVPR'19 (oral) work: Unsupervised person re-identification by soft multilabel learning

Home Page: https://kovenyu.com/publication/2019-cvpr-mar/

MATLAB 8.13% Python 91.87%

mar's Introduction

update on 17th June: illustration for soft multilabel learning loss

This repo contains the source code for our CVPR'19 work Unsupervised person re-identification by soft multilabel learning (the paper and the supplementary material is available). Our implementation is based on Pytorch. In the following is an instruction to use the code to train and evaluate the MAR model on the Market-1501 dataset.

Prerequisites

  1. Pytorch 1.0.0
  2. Python 3.6+
  3. Python packages: numpy, scipy, pyyaml/yaml, h5py
  4. [Optional] MATLAB, if you need to customize used datasets.

Data preparation

(If you simply want to run the demo code without further modification, you might skip this step by downloading all required data from BaiduPan with password "tih8", and put all of them into /data/)

  1. Pretrained model

    Please find the pretrained model (pretrained using softmax loss on MSMT17) in BaiduPan (password: tih8) or GoogleDrive. After downloading pretrained_weight.pth, please put it into /data/.

  2. Target dataset

    Download the Market-1501 dataset, and unzip it into /data. After this step, you should have a folder structure:

    • data
      • Market-1501-v15.09.15
        • bounding_box_test
        • bounding_box_train
        • query

    Then run /data/construct_dataset_Market.m in MATLAB. If you prefer to use another dataset, just modify the MATLAB code accordingly. The processed Market-1501 and DukeMTMC-reID are available in BaiduPan and GoogleDrive.

  3. Auxiliary (source) dataset

    Download the MSMT17 dataset, and unzip it into /data. After this step, you should have a folder structure:

    • data
      • MSMT17_V1
        • train
        • test
        • list_train.txt
        • list_query.txt
        • list_gallery.txt

    Then run /data/construct_dataset_MSMT17.m in MATLAB. If you prefer to use another dataset, just modify the MATLAB code accordingly. Again, the processed MSMT17 is available in BaiduPan.

Run the code

Please enter the main folder, and run

python src/main.py --gpu 0,1,2,3 --save_path runs/debug

where "0,1,2,3" specifies your gpu IDs. If you are using gpus with 12G memory, you need 4 gpus to run in the default setting (batchsize=368). If you set a small batch size, please do not forget to lower the learning rate as the gradient would be stronger for a smaller batch size. Please also note that since I load the whole datasets into cpu memory to cut down IO overhead, you need at least 40G cpu memory. Hence I recommend you run it on a server.

Main results

Reference

If you find our work helpful in your research, please kindly cite our paper:

Hong-Xing Yu, Wei-Shi Zheng, Ancong Wu, Xiaowei Guo, Shaogang Gong and Jian-Huang Lai, "Unsupervised person re-identification by soft multilabel learning", In CVPR, 2019.

bib:

@inproceedings{yu2019unsupervised,
  title={Unsupervised Person Re-identification by Soft Multilabel Learning},
  author={Yu, Hong-Xing and Zheng, Wei-Shi and Wu, Ancong and Guo, Xiaowei and Gong, Shaogang and Lai, Jianhuang},
  year={2019},
  booktitle={IEEE International Conference on Computer Vision and Pattern Recognition (CVPR)},
}

If you have any problem/question, please feel free to contact me at [email protected] or open an issue.

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.