Giter VIP home page Giter VIP logo

nformer's Introduction

NFormer

Implementation of NFormer: Robust Person Re-identification with Neighbor Transformer. CVPR2022

Pipeline

Requirements

  • Python3
  • pytorch>=0.4
  • torchvision
  • pytorch-ignite=0.1.2 (Note: V0.2.0 may result in an error)
  • yacs

Hardware

  • 1 NVIDIA 3090 Ti

Dataset

Create a directory to store reid datasets under this repo or outside this repo. Set your path to the root of the dataset in config/defaults.py or set in scripts Experiment-all_tricks-tri_center-market.sh and Test-all_tricks-tri_center-feat_after_bn-cos-market.sh.

Market1501

|-  data
    |-  market1501 # this folder contains 6 files.
        |-  bounding_box_test/
        |-  bounding_box_train/
              ......

Training

download the pretrained resnet50 model and set the path at line3

run Experiment-all_tricks-tri_center-market.sh to train NFormer on Market-1501 dataset

sh Experiment-all_tricks-tri_center-market.sh

or

python3 tools/train.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" DATASETS.ROOT_DIR "('/home/haochen/workspace/project/NFORMER/')" OUTPUT_DIR "('work_dirs')"

Evaluation

run Test-all_tricks-tri_center-feat_after_bn-cos-market.sh to evaluate NFormer on Market-1501 dataset. Change TEST.TEST_NFORMER to determine test for NFormer ('yes') or CNNEncoder ('no').

sh Test-all_tricks-tri_center-feat_after_bn-cos-market.sh

or

python3 tools/test.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" DATASETS.ROOT_DIR "('/home/haochen/workspace/project/NFORMER')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('test/nformer_model.pth')" TEST.TEST_NFORMER "('no')"

Acknowledgement

This repo is highly based on reid-strong-baseline, thanks for their excellent work.

Citation

@article{wang2022nformer,
  title={NFormer: Robust Person Re-identification with Neighbor Transformer},
  author={Wang, Haochen and Shen, Jiayi and Liu, Yongtuo and Gao, Yan and Gavves, Efstratios},
  journal={arXiv preprint arXiv:2204.09331},
  year={2022}
}

@InProceedings{Luo_2019_CVPR_Workshops,
author = {Luo, Hao and Gu, Youzhi and Liao, Xingyu and Lai, Shenqi and Jiang, Wei},
title = {Bag of Tricks and a Strong Baseline for Deep Person Re-Identification},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2019}
}

nformer's People

Contributors

haochenheheda 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.