Coder Social home page Coder Social logo

tencentyouturesearch / personreid-youreid Goto Github PK

View Code? Open in Web Editor NEW
67.0 5.0 19.0 7.94 MB

A Simple, High-efficiency, Strong framework for person re-Identification.

License: Other

Python 96.84% Shell 0.17% C++ 2.99%
person-reid identification pytorch person-reidentification baseline market1501 msmt17

personreid-youreid's Introduction

Introduction

YouReID is a light research framework that implements some state-of-the-art person re-identification algorithms for some reid tasks and provides some strong baseline models.

Major features

  • Concise and easy: Simple framework, easy to use and customize. You can get started in 5 minutes.
  • Higher efficiency: Mixed precision and DistributedDataParallel training are supported. You can run over the baseline model in 25 minutes using two 16GB V100 on the Market-1501 dataset.
  • Strong: Some baseline methods are supported, including baseline, PCB, MGN. Specially the performance of baseline model arrives mAP=87.65% and rank-1=94.80% on the Market-1501 dataset.
  • Rich model zoo: State-of-the-art methods for some reid tasks like Occluded/UDA/Cross-modal are supported.

Model Zoo

this project provides the following algorithms and scripts to run them. Please see the details in the link provided in the description column

FieldABBRVAlgorithmsDescriptionStatus
SLCACENETDevil's in the Details: Aligning Visual Clues for Conditional Embedding in Person Re-IdentificationCACENET.mdfinished
PyramidPyramidal Person Re-IDentification via Multi-Loss Dynamic TrainingCVPR-2019-Pyramid.mdfinished
Text NAFSContextual Non-Local Alignment over Full-Scale Representation for Text-Based Person SearchNAFS.mdfinished
UDAACTAsymmetric Co-Teaching for Unsupervised Cross Domain Person Re-IdentificationAAAI-2020-ACT.mdcomming soon
Video TSFRethinking Temporal Fusion for Video-based Person Re-identification on Semantic and Time AspectAAAI-2020-TSF.mdcomming soon
3D Person-ReID-3DLearning 3D Shape Feature for Texture-insensitive Person Re-identificationCVPR-2021-PR3D.mdwaited
Occluded PartNetHuman Pose Information Discretization for Occluded Person Re-IdentificationPartNet.mdwaited

You also can find these models in model_zoo Specially we contribute some reid samples to opencv community, you can use these model in opencv, and you also can visit them at ReID_extra_testdata.

Requirements and Preparation

Please install Python>=3.6 and PyTorch>=1.6.0.

Prepare Datasets

Download the public datasets(like market1501 and DukeMTMC), organize these datasets using the following format:

File Directory:

├── partitions.pkl
├── images
│ ├── 0000000_0000_000000.png
│ ├── 0000001_0000_000001.png
│ ├── ...
  1. Rename the images in following convention: "000000_000_000000.png" where the first substring splitted by underline is the person identity; for the second substring, the first digit is the camera id and the rest is track id; and the third substring is an image offset.

  2. "partitions.pkl" file This file contains a python dictionary storing meta data of the datasets, which contains folling key value pairs "train_im_names": [list of image names] #storing a list of names of training images "train_ids2labels":{"identity":label} #a map that maps the person identity string to a integer label "val_im_names": [list of image names] #storing a list of names of validation images "test_im_names": [list of image names] #storing a list of names of testing images "test_marks"/"val_marks": [list of 0/1] #0/1 indicates if an image is in gallery

you can run tools/transform_format.py to get the formatted dataset or download from formatted market1501

Geting Started

Clone this github repository:

git clone this repository

train

  1. Configure basic settings in core/config
  2. Define the network in net and register in the factory.py
  3. Set the corresponding hyperparameters in the example yaml
  4. set example.yaml path in config.yaml
  5. set port and gpu config in cmd.sh
  6. cd train && ./cmd.sh

Quickly Started

cd train && ./cmd.sh

Citation

If you are interested in our works, please cite our papers

personreid-youreid's People

Contributors

mznw avatar poorfriend avatar x-ing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

personreid-youreid's Issues

how to get conditional embedding in inference stage.

Hello, it seems during evaluation we only get the individual features of query set and gallery set, i get map 0.836 on dataset market1501, and if I set use_rerank: true the map rise to 0.8945.
From your paper section3.5 Model Inference, after get individual features of query set and gallery set, we need re calculate the distance between query and gallery based the conditional embedding. but from the code it seems that we discard the key-point Alignment Block and Conditional Feature Embedding Block during inference, so could you tell me the reason?

Correct aspect ratio handling

Thanks for the OpenCV contribution, trying to undestand the code, it seems to me (see here), that sample images are resized without keeping their aspect ratio (same goes for the C++ sample). How does that affect the features extraction and similarity calculations? Does an aspect ratio modification not affect some of the features? With other words, wouldn"t a different approach like resizing with cropping or even with letter boxing be a better approach?

Thanks for clarification.

Some details?

Hello, first of all thank you for your excellent work. I am sorry that I am not very familiar with tensorflow. I would like to ask you a few specific implementation details:

  1. As mentioned in the paper, conditional features are determined by two pictures. The 16x4 sampling method you use, then when calculating the subsequent conditional features, 64x63 conditional features need to be calculated?

2.Top-K, how much does K take?

Looking forward to your reply!

Difficult to replicate the results

Thanks for publishing the code.
After putting some effort, I still find it difficult to replicate the results. For example, no script is available to "Prepare Datasets", and one has to implement his/her own. It would be good if a foolproof step-by-step guide could be provided, especially for the training procedure.
I have completed the training on Market-1501. However, the reported mAP score is 0.06245. I have made substantial modifications, so there might be bugs in my own script. Could you please check the attached slurm-xxx.log for training? It looks like that the training collapsed.
All the best.

when to get the best model

hi~
I observe that the code save the checkpoint file at the end of the epoch 80,
then it achieve the best performance without testing in the training process.
If I need to use other dataset, I should modify the code to do testing in the training process,
in order to know when should be stop. Am I right ?

enviroment configuration

Thanks for your excellent work and code. But when i try to replicate the results, i encounter a runtime error:
F tensorflow/core/framework/tensor.cc:624] Check failed: dtype() == expected_dtype (10 vs. 3) int32 expected, got bool

my environment is: python == 3.7.1 tensorflow == 1.14.0
Could you tell your environment that can run the training?

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.