Torchreid: Deep learning person re-identification in PyTorch.

Overview

Torchreid

Torchreid is a library for deep-learning person re-identification, written in PyTorch.

It features:

  • multi-GPU training
  • support both image- and video-reid
  • end-to-end training and evaluation
  • incredibly easy preparation of reid datasets
  • multi-dataset training
  • cross-dataset evaluation
  • standard protocol used by most research papers
  • highly extensible (easy to add models, datasets, training methods, etc.)
  • implementations of state-of-the-art deep reid models
  • access to pretrained reid models
  • advanced training techniques
  • visualization tools (tensorboard, ranks, etc.)

Code: https://github.com/KaiyangZhou/deep-person-reid.

Documentation: https://kaiyangzhou.github.io/deep-person-reid/.

How-to instructions: https://kaiyangzhou.github.io/deep-person-reid/user_guide.

Model zoo: https://kaiyangzhou.github.io/deep-person-reid/MODEL_ZOO.

Tech report: https://arxiv.org/abs/1910.10093.

You can find some research projects that are built on top of Torchreid here.

What's new

  • [Apr 2021] We have updated the appendix in the TPAMI version of OSNet to include results in the multi-source domain generalization setting. The trained models can be found in the Model Zoo.
  • [Apr 2021] We have added a script to automate the process of calculating average results over multiple splits. For more details please see tools/parse_test_res.py.
  • [Apr 2021] v1.4.0: We added the person search dataset, CUHK-SYSU. Please see the documentation regarding how to download the dataset (it contains cropped person images).
  • [Apr 2021] All models in the model zoo have been moved to google drive. Please raise an issue if any model's performance is inconsistent with the numbers shown in the model zoo page (could be caused by wrong links).
  • [Mar 2021] OSNet will appear in the TPAMI journal! Compared with the conference version, which focuses on discriminative feature learning using the omni-scale building block, this journal extension further considers generalizable feature learning by integrating instance normalization layers with the OSNet architecture. We hope this journal paper can motivate more future work to taclke the generalization issue in cross-dataset re-ID.
  • [Mar 2021] Generalization across domains (datasets) in person re-ID is crucial in real-world applications, which is closely related to the topic of domain generalization. Interested in learning how the field of domain generalization has developed over the last decade? Check our recent survey in this topic at https://arxiv.org/abs/2103.02503, with coverage on the history, datasets, related problems, methodologies, potential directions, and so on (methods designed for generalizable re-ID are also covered!).
  • [Feb 2021] v1.3.6 Added University-1652, a new dataset for multi-view multi-source geo-localization (credit to Zhedong Zheng).
  • [Feb 2021] v1.3.5: Now the cython code works on Windows (credit to lablabla).
  • [Jan 2021] Our recent work, MixStyle (mixing instance-level feature statistics of samples of different domains for improving domain generalization), has been accepted to ICLR'21. The code has been released at https://github.com/KaiyangZhou/mixstyle-release where the person re-ID part is based on Torchreid.
  • [Jan 2021] A new evaluation metric called mean Inverse Negative Penalty (mINP) for person re-ID has been introduced in Deep Learning for Person Re-identification: A Survey and Outlook (TPAMI 2021). Their code can be accessed at https://github.com/mangye16/ReID-Survey.
  • [Aug 2020] v1.3.3: Fixed bug in visrank (caused by not unpacking dsetid).
  • [Aug 2020] v1.3.2: Added _junk_pids to grid and prid. This avoids using mislabeled gallery images for training when setting combineall=True.
  • [Aug 2020] v1.3.0: (1) Added dsetid to the existing 3-tuple data source, resulting in (impath, pid, camid, dsetid). This variable denotes the dataset ID and is useful when combining multiple datasets for training (as a dataset indicator). E.g., when combining market1501 and cuhk03, the former will be assigned dsetid=0 while the latter will be assigned dsetid=1. (2) Added RandomDatasetSampler. Analogous to RandomDomainSampler, RandomDatasetSampler samples a certain number of images (batch_size // num_datasets) from each of specified datasets (the amount is determined by num_datasets).
  • [Aug 2020] v1.2.6: Added RandomDomainSampler (it samples num_cams cameras each with batch_size // num_cams images to form a mini-batch).
  • [Jun 2020] v1.2.5: (1) Dataloader's output from __getitem__ has been changed from list to dict. Previously, an element, e.g. image tensor, was fetched with imgs=data[0]. Now it should be obtained by imgs=data['img']. See this commit for detailed changes. (2) Added k_tfm as an option to image data loader, which allows data augmentation to be applied k_tfm times independently to an image. If k_tfm > 1, imgs=data['img'] returns a list with k_tfm image tensors.
  • [May 2020] Added the person attribute recognition code used in Omni-Scale Feature Learning for Person Re-Identification (ICCV'19). See projects/attribute_recognition/.
  • [May 2020] v1.2.1: Added a simple API for feature extraction (torchreid/utils/feature_extractor.py). See the documentation for the instruction.
  • [Apr 2020] Code for reproducing the experiments of deep mutual learning in the OSNet paper (Supp. B) has been released at projects/DML.
  • [Apr 2020] Upgraded to v1.2.0. The engine class has been made more model-agnostic to improve extensibility. See Engine and ImageSoftmaxEngine for more details. Credit to Dassl.pytorch.
  • [Dec 2019] Our OSNet paper has been updated, with additional experiments (in section B of the supplementary) showing some useful techniques for improving OSNet's performance in practice.
  • [Nov 2019] ImageDataManager can load training data from target datasets by setting load_train_targets=True, and the train-loader can be accessed with train_loader_t = datamanager.train_loader_t. This feature is useful for domain adaptation research.

Installation

Make sure conda is installed.

# cd to your preferred directory and clone this repo
git clone https://github.com/KaiyangZhou/deep-person-reid.git

# create environment
cd deep-person-reid/
conda create --name torchreid python=3.7
conda activate torchreid

# install dependencies
# make sure `which python` and `which pip` point to the correct path
pip install -r requirements.txt

# install torch and torchvision (select the proper cuda version to suit your machine)
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

# install torchreid (don't need to re-build it if you modify the source code)
python setup.py develop

Get started: 30 seconds to Torchreid

  1. Import torchreid
import torchreid
  1. Load data manager
datamanager = torchreid.data.ImageDataManager(
    root='reid-data',
    sources='market1501',
    targets='market1501',
    height=256,
    width=128,
    batch_size_train=32,
    batch_size_test=100,
    transforms=['random_flip', 'random_crop']
)

3 Build model, optimizer and lr_scheduler

model = torchreid.models.build_model(
    name='resnet50',
    num_classes=datamanager.num_train_pids,
    loss='softmax',
    pretrained=True
)

model = model.cuda()

optimizer = torchreid.optim.build_optimizer(
    model,
    optim='adam',
    lr=0.0003
)

scheduler = torchreid.optim.build_lr_scheduler(
    optimizer,
    lr_scheduler='single_step',
    stepsize=20
)
  1. Build engine
engine = torchreid.engine.ImageSoftmaxEngine(
    datamanager,
    model,
    optimizer=optimizer,
    scheduler=scheduler,
    label_smooth=True
)
  1. Run training and test
engine.run(
    save_dir='log/resnet50',
    max_epoch=60,
    eval_freq=10,
    print_freq=10,
    test_only=False
)

A unified interface

In "deep-person-reid/scripts/", we provide a unified interface to train and test a model. See "scripts/main.py" and "scripts/default_config.py" for more details. The folder "configs/" contains some predefined configs which you can use as a starting point.

Below we provide an example to train and test OSNet (Zhou et al. ICCV'19). Assume PATH_TO_DATA is the directory containing reid datasets. The environmental variable CUDA_VISIBLE_DEVICES is omitted, which you need to specify if you have a pool of gpus and want to use a specific set of them.

Conventional setting

To train OSNet on Market1501, do

python scripts/main.py \
--config-file configs/im_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \
--transforms random_flip random_erase \
--root $PATH_TO_DATA

The config file sets Market1501 as the default dataset. If you wanna use DukeMTMC-reID, do

python scripts/main.py \
--config-file configs/im_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \
-s dukemtmcreid \
-t dukemtmcreid \
--transforms random_flip random_erase \
--root $PATH_TO_DATA \
data.save_dir log/osnet_x1_0_dukemtmcreid_softmax_cosinelr

The code will automatically (download and) load the ImageNet pretrained weights. After the training is done, the model will be saved as "log/osnet_x1_0_market1501_softmax_cosinelr/model.pth.tar-250". Under the same folder, you can find the tensorboard file. To visualize the learning curves using tensorboard, you can run tensorboard --logdir=log/osnet_x1_0_market1501_softmax_cosinelr in the terminal and visit http://localhost:6006/ in your web browser.

Evaluation is automatically performed at the end of training. To run the test again using the trained model, do

python scripts/main.py \
--config-file configs/im_osnet_x1_0_softmax_256x128_amsgrad_cosine.yaml \
--root $PATH_TO_DATA \
model.load_weights log/osnet_x1_0_market1501_softmax_cosinelr/model.pth.tar-250 \
test.evaluate True

Cross-domain setting

Suppose you wanna train OSNet on DukeMTMC-reID and test its performance on Market1501, you can do

python scripts/main.py \
--config-file configs/im_osnet_x1_0_softmax_256x128_amsgrad.yaml \
-s dukemtmcreid \
-t market1501 \
--transforms random_flip color_jitter \
--root $PATH_TO_DATA

Here we only test the cross-domain performance. However, if you also want to test the performance on the source dataset, i.e. DukeMTMC-reID, you can set -t dukemtmcreid market1501, which will evaluate the model on the two datasets separately.

Different from the same-domain setting, here we replace random_erase with color_jitter. This can improve the generalization performance on the unseen target dataset.

Pretrained models are available in the Model Zoo.

Datasets

Image-reid datasets

Geo-localization datasets

Video-reid datasets

Models

ImageNet classification models

Lightweight models

ReID-specific models

Useful links

Citation

If you use this code or the models in your research, please give credit to the following papers:

@article{torchreid,
  title={Torchreid: A Library for Deep Learning Person Re-Identification in Pytorch},
  author={Zhou, Kaiyang and Xiang, Tao},
  journal={arXiv preprint arXiv:1910.10093},
  year={2019}
}

@inproceedings{zhou2019osnet,
  title={Omni-Scale Feature Learning for Person Re-Identification},
  author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},
  booktitle={ICCV},
  year={2019}
}

@article{zhou2021osnet,
  title={Learning Generalisable Omni-Scale Representations for Person Re-Identification},
  author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},
  journal={TPAMI},
  year={2021}
}
Issues
  • Releasing OSNet code and models

    Releasing OSNet code and models

    new_feature 
    opened by KaiyangZhou 30
  • Proper way to export the model to onnx

    Proper way to export the model to onnx

    import torchreid
    
    torchreid.models.show_avai_models()
    
    model = torchreid.models.build_model(name='osnet_ain_x1_0', num_classes=1000)
    
    torchreid.utils.load_pretrained_weights(model, "osnet_ain_x1_0_msmt17_256x128_amsgrad_ep50_lr0.0015_coslr_b64_fb10_softmax_labsmth_flip_jitter.pth") 
    
    from torch.autograd import Variable
    import torch
    import onnx
    
    input_name = ['input']
    output_name = ['output']
    input = Variable(torch.randn(1, 3, 256, 128))
    torch.onnx.export(model, input, 'osnet_ain_x1_0.onnx', input_names=input_name,output_names=output_name, verbose=True, export_params=True)
    
    The model after convert only 10633KBytes, while the pytorch model got 16888KBytes
    
    onnx_model = onnx.load("osnet_ain_x1_0.onnx")
    onnx.checker.check_model(onnx_model)
    
    
    1. The output messages seems all fine, but is this the correct way?
    2. What is the num_classes I should set?
    3. Am I using correct input_name and output_name

    Model before convert is 16888KB, model after convert only got 10633KB

    opened by stereomatchingkiss 18
  •  No module named 'torchreid.utils'

    No module named 'torchreid.utils'

    when i run the program in cmd,a error come out: No module named 'torchreid.utils'.why

    opened by 18842505953 15
  • Some confusion on mAP of CUKH03 in eval_metrics.py

    Some confusion on mAP of CUKH03 in eval_metrics.py

        cmc, AP = 0., 0.
        for repeat_idx in range(num_repeats):
            mask = np.zeros(len(raw_cmc), dtype=np.bool)
            for _, idxs in g_pids_dict.items():
                # randomly sample one image for each gallery person
                rnd_idx = np.random.choice(idxs)
                mask[rnd_idx] = True
            masked_raw_cmc = raw_cmc[mask]
            _cmc = masked_raw_cmc.cumsum()
            _cmc[_cmc > 1] = 1
            cmc += _cmc[:max_rank].astype(np.float32)
            # compute AP
            num_rel = masked_raw_cmc.sum()
            tmp_cmc = masked_raw_cmc.cumsum()
            tmp_cmc = [x / (i+1.) for i, x in enumerate(tmp_cmc)]
            tmp_cmc = np.asarray(tmp_cmc) * masked_raw_cmc
            AP += tmp_cmc.sum() / num_rel
    

    The author calculates the mAP of CUKH03 using single_gallery_shot. In my opinoin, this is superfluous and only necessary for cmc. The mAP results calculated in this way are different from others, for instance open-reid. https://github.com/Cysu/open-reid/blob/master/reid/evaluation_metrics/ranking.py

    opened by kalilili 14
  • how to cite your result

    how to cite your result

    @KaiyangZhou I want to write my paper , and cite some of your conclusions.

    KaiyangZhou.Pytorch implementation of deep person re-identification models[EB/OL].[2018-12].https://github.com/KaiyangZhou/deep-person-reid

    Is this form correct?

    opened by ciwei123 13
  • MSMT17 dataset version updated?

    MSMT17 dataset version updated?

    @KaiyangZhou Thanks for your implementation to advance further research in Re-ID. I noticed that the MSMT17 dataset has been upgraded to version 2 on the official website. Would you consider updating the relevant data loader in your code?

    new_feature 
    opened by d-li14 13
  • Cython problem

    Cython problem

    I installed TorchReID on another computer (win10, anaconda3) today with a new installation method (option 2) using conda.

    After that, the message "rank.py:17: UserWarning: Cython evaluation (very fast) in unavailable, now use python evaluation" keeps appearing. I erased Cython and reinstalled it with the latest version, but it is still intact.

    My Cython version is 0.29.7. Is not it compatible with the latest version of Cython?

    opened by raretomato 12
  • How to extract features ?

    How to extract features ?

    Hi,

    first thank you for your work.

    I would like to know how to extract features for each images for :

    • training
    • testing
    • query

    please ?

    If it can be in a .pickle file in a OredredDict format should be great. Example for a resnet50 : dict({img01 : [array of 2048]}, {img02 : [array of 2048]}, ...)

    Thank you.

    EDIT : In engine.py we have access to features but not sure how to use them

    opened by djidje 12
  • mobilenet v2 pretrained model?

    mobilenet v2 pretrained model?

    do you have mobilenet v2 pretrained model? Thanks a lot

    new_feature 
    opened by yyjabidintg 11
  • Using OSNet for Pedestrian Attribute Recognition

    Using OSNet for Pedestrian Attribute Recognition

    Hi, I was trying to replicate OSNet for Pedestrian Attribute Recognition on PA-100K dataset as mentioned in the paper. I added a Classifier on top of the base OSNet (2 FC layers, input dims=512 and output dims=number of classes in PA100k), and trained (from scratch) with the values mentioned in the paper, but I am getting F1 Score of around only 50. Is there any way I can improvise? Also, It'll be really helpful if the code used for training on PA-100K is released.

    opened by akashmanna 11
  • Memory size required for Market1501-500k

    Memory size required for Market1501-500k

    Hi,

    I have trained models on Market1501-500k but it used all memory free space on evaluating process and made the machine freeze due to out-of-memory problem.

    I have 48gb of RAM. Is it enough?

    or did I do something wrong? this is the parameters I use to train the model.

    python scripts/main.py \
    --root $DATA \
    --app image \
    --loss softmax \
    --label-smooth \
    -s market1501 \
    --market1501-500k \
    -a resnet50_fc512 \
    --optim adam \
    --lr 0.0003 \
    --max-epoch 60 \
    --stepsize 20 40 \
    --batch-size 32 \
    --save-dir log/model-market1501-softmax \
    --gpu-devices 0
    
    opened by crossknight 10
  • Can't training with GPU

    Can't training with GPU

    In the version of pytorch 1.3.1, OsNet can't train with GPU, report CUDA out of memory, but the gpu is not occupied。Bug?

    opened by lovekittynine 9
  • Model zoo unavailable

    Model zoo unavailable

    opened by KaiyangZhou 9
  • why always show 'cuda out of memory'

    why always show 'cuda out of memory'

    it has nothing to do with batch size,

    => Start training

    • Only train ['classifier'] (epoch: 1/10) Traceback (most recent call last): File "scripts/main.py", line 164, in main() File "scripts/main.py", line 160, in main engine.run(**engine_run_kwargs(cfg)) File "/home/guanyonglai/gyl/goods_project/osnet-deep-person-reid/torchreid/engine/engine.py", line 122, in run open_layers=open_layers File "/home/guanyonglai/gyl/goods_project/osnet-deep-person-reid/torchreid/engine/image/softmax.py", line 95, in train outputs = self.model(imgs) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 148, in forward inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 159, in scatter return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 35, in scatter_kwargs inputs = scatter(inputs, target_gpus, dim) if inputs else [] File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 28, in scatter return scatter_map(inputs) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 15, in scatter_map return list(zip(*map(scatter_map, obj))) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 13, in scatter_map return Scatter.apply(target_gpus, None, dim, obj) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/nn/parallel/_functions.py", line 89, in forward outputs = comm.scatter(input, target_gpus, chunk_sizes, ctx.dim, streams) File "/home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/cuda/comm.py", line 147, in scatter return tuple(torch._C._scatter(tensor, devices, chunk_sizes, dim, streams)) RuntimeError: CUDA error: out of memory (malloc at /pytorch/c10/cuda/CUDACachingAllocator.cpp:241) frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f01581aa441 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libc10.so) frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f01581a9d7a in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libc10.so) frame #2: + 0x1581d (0x7f015775881d in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libc10_cuda.so) frame #3: + 0x16247 (0x7f0157759247 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libc10_cuda.so) frame #4: at::native::empty_cuda(c10::ArrayRef, c10::TensorOptions const&) + 0x121 (0x7f0087143f81 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libcaffe2_gpu.so) frame #5: at::CUDAType::empty(c10::ArrayRef, c10::TensorOptions const&) const + 0x19b (0x7f0085d8b6fb in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libcaffe2_gpu.so) frame #6: torch::autograd::VariableType::empty(c10::ArrayRef, c10::TensorOptions const&) const + 0x284 (0x7f0152824094 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch.so.1) frame #7: at::native::to(at::Tensor const&, c10::TensorOptions const&, bool, bool) + 0x506 (0x7f0129a98666 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libcaffe2.so) frame #8: at::TypeDefault::to(at::Tensor const&, c10::TensorOptions const&, bool, bool) const + 0x17 (0x7f0129d17857 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libcaffe2.so) frame #9: torch::autograd::VariableType::to(at::Tensor const&, c10::TensorOptions const&, bool, bool) const + 0x2c2 (0x7f015270db52 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch.so.1) frame #10: torch::cuda::scatter(at::Tensor const&, c10::ArrayRef, c10::optional<std::vector<long, std::allocator > > const&, long, c10::optional<std::vector<c10::optionalc10::cuda::CUDAStream, std::allocator<c10::optionalc10::cuda::CUDAStream > > > const&) + 0x389 (0x7f0152c61fd9 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch.so.1) frame #11: + 0x5a41cf (0x7f0158b9a1cf in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch_python.so) frame #12: + 0x130fac (0x7f0158726fac in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
    frame #20: THPFunction_apply(_object*, _object*) + 0x6b1 (0x7f01589aa301 in /home/guanyonglai/anaconda3/envs/torchreid/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
    opened by guanyonglai 8
  • Error met when trying to reproduce HACNN result (Python3)

    Error met when trying to reproduce HACNN result (Python3)

    I am trying to reproduce the HACNN result. I've downloaded CUHK03 dataset and process it as described in README. However, when I apply the train command of HACNN as described in README, I've met python error: hacnn I am an beginner of ReID, I an running the repo in my personal bought AWS K80 GPU Ubuntu 16.04 LTS server, in which the Python is 3.6.4 in Anaconda3, and the torch 0.4.0, with torchvision 0.2.1: pythonenv Where is the problem do you think? Can you give me some hint, from the capture image above? Thanks.

    opened by lzhaozi 8
  • PyTorch is not using the GPU specified by gpu_devices

    PyTorch is not using the GPU specified by gpu_devices

    When I set gpu_devices = 0, it will run all gpus in the server. And I tried to put "CUDA_VISIBLE_DEVICES=0" before "python scripts/main.py", the same thing occurred.

    opened by justopit 8
  • error occurs while training

    error occurs while training

    Epoch: [10/60][400/404] Time 0.173 (0.188) Data 0.000 (0.011) Loss 1.6979 (1.5605) Acc 81.25 (91.09) Lr 0.000300 eta 1:03:19

    Evaluating market1501 (source)

    Extracting features from query set ... Done, obtained 3368-by-2048 matrix Extracting features from gallery set ... Done, obtained 15913-by-2048 matrix Speed: 0.0211 sec/batch Computing distance matrix with metric=euclidean ... Computing CMC and mAP ...

    "ValueError Traceback (most recent call last) in 4 eval_freq=10, 5 print_freq=10, ----> 6 test_only=False 7 )

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\engine\engine.py in run(self, save_dir, max_epoch, start_epoch, print_freq, fixbase_epoch, open_layers, start_eval, eval_freq, test_only, dist_metric, normalize_feature, visrank, visrank_topk, use_metric_cuhk03, ranks, rerank) 141 save_dir=save_dir, 142 use_metric_cuhk03=use_metric_cuhk03, --> 143 ranks=ranks 144 ) 145 self._save_checkpoint(epoch, rank1, save_dir)

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\engine\engine.py in test(self, epoch, dist_metric, normalize_feature, visrank, visrank_topk, save_dir, use_metric_cuhk03, ranks, rerank) 225 use_metric_cuhk03=use_metric_cuhk03, 226 ranks=ranks, --> 227 rerank=rerank 228 ) 229

    ~\anaconda3\envs\torchreid\lib\site-packages\torch\autograd\grad_mode.py in decorate_no_grad(*args, **kwargs) 47 def decorate_no_grad(*args, **kwargs): 48 with self: ---> 49 return func(*args, **kwargs) 50 return decorate_no_grad 51

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\engine\engine.py in _evaluate(self, epoch, dataset_name, query_loader, gallery_loader, dist_metric, normalize_feature, visrank, visrank_topk, save_dir, use_metric_cuhk03, ranks, rerank) 300 q_camids, 301 g_camids, --> 302 use_metric_cuhk03=use_metric_cuhk03 303 ) 304

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\metrics\rank.py in evaluate_rank(distmat, q_pids, g_pids, q_camids, g_camids, max_rank, use_metric_cuhk03, use_cython) 199 return evaluate_cy( 200 distmat, q_pids, g_pids, q_camids, g_camids, max_rank, --> 201 use_metric_cuhk03 202 ) 203 else:

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\metrics\rank_cylib\rank_cy.pyx in torchreid.metrics.rank_cylib.rank_cy.evaluate_cy() 22 23 # Main interface ---> 24 cpdef evaluate_cy(distmat, q_pids, g_pids, q_camids, g_camids, max_rank, use_metric_cuhk03=False): 25 distmat = np.asarray(distmat, dtype=np.float32) 26 q_pids = np.asarray(q_pids, dtype=np.int64)

    ~\Desktop\deep-person-reid-master\deep-person-reid-master\torchreid\metrics\rank_cylib\rank_cy.pyx in torchreid.metrics.rank_cylib.rank_cy.evaluate_cy() 30 if use_metric_cuhk03: 31 return eval_cuhk03_cy(distmat, q_pids, g_pids, q_camids, g_camids, max_rank) ---> 32 return eval_market1501_cy(distmat, q_pids, g_pids, q_camids, g_camids, max_rank) 33 34

    ValueError: Buffer dtype mismatch, expected 'long' but got 'long long'"

    opened by berkdenizi 8
  • Using RandomIdentitySampler sampler, Cross Entropy doesn't converge.

    Using RandomIdentitySampler sampler, Cross Entropy doesn't converge.

    Hi, Kaiyang, Firstly, I want to thank for your great work. When I try to use RandomIdentitySampler sampler to train PCB_P6 model with Cross Entropy loss and Triplet loss, I encounter strange things. The xent loss doesn't converge and vibrates periodically. Every period in the figure stands for one epoch training procedure. newplot My training command like this: python train_imgreid_xent_htri.py \ --root /DATASET/data \ --source-names market1501 \ --target-names market1501 \ --train-sampler 'RandomIdentitySampler' \ --print-freq 50 \ --num-instances 2 \ --lambda-xent 1.0 \ --lambda-htri 0.05 \ --height 256 \ --width 128 \ --optim amsgrad \ --lr 0.0003 \ --max-epoch 60 \ --stepsize 20 40 \ --train-batch-size 16 \ --test-batch-size 100 \ --arch pcb_p6 \ --save-dir log/resnet50-market-xtri \ --gpu-devices 0,1,2,3 Did i miss some important operations? THANKS

    opened by SkytreeRom 8
  • Person Attribute Recognition

    Person Attribute Recognition

    Hello, @KaiyangZhou I am trying to execute your code and found that the images of similar persons (in terms of color and texture) are obtained by grouping the learned factor selection features, Is there any way to visualize the probabilities of the extracted features(Like, Gender, Clothing, Backpack, etc..)?

    confuse

    opened by Akashpanchal95 8
  • Segmentation fault (core dumped)

    Segmentation fault (core dumped)

    ==> Test Extracted features for query set, obtained 3368-by-2048 matrix Extracted features for gallery set, obtained 15913-by-2048 matrix ==> BatchTime(s)/BatchSize(img): 0.014/64 Segmentation fault (core dumped) 测试的时候出现这个问题,谢谢

    opened by 22wei22 8
  • Training set

    Training set

    Hi. What are the training settings for these models(mlfn,hacnn,osnet_x1_0,resnet50_fc512 )? To reproduce your test results. Thanks.

    opened by InstantWindy 8
  • i have a error

    i have a error

    File "train_imgreid_xent.py", line 266, in main() File "train_imgreid_xent.py", line 91, in main distmat = test(model, queryloader, galleryloader, use_gpu, return_distmat=True) File "train_imgreid_xent.py", line 250, in test cmc, mAP = evaluate(distmat, q_pids, g_pids, q_camids, g_camids, use_metric_cuhk03=args.use_metric_cuhk03) File "/mnt/hdd/Private/zhangting/deep-person-reid/torchreid/eval_metrics.py", line 161, in evaluate return evaluate_cy(distmat, q_pids, g_pids, q_camids, g_camids, max_rank, use_metric_cuhk03) File "eval_metrics_cy.pyx", line 21, in eval_metrics_cy.evaluate_cy File "eval_metrics_cy.pyx", line 29, in eval_metrics_cy.evaluate_cy File "eval_metrics_cy.pyx", line 226, in eval_metrics_cy.eval_market1501_cy AssertionError: Error: all query identities do not appear in gallery

    opened by zhangting1994 8
  • Training parameters of Mars dataset

    Training parameters of Mars dataset

    Because the result of my training is always about 3% worse than the result you provided, so I guess it's the training parameters. My training parameters are as follows:

    python train_vid_model_xent_htri.py -d mars -a resnet50m --max-epoch 500 --train-batch 128 --test-batch 32 --stepsize 200 --eval-step 20 --save-dir log/resnet50m-xent-htri-mars --gpu-devices 0

    opened by xiaoweihappy123 7
  • Incredibly low CMC scores  - possible test set config issue

    Incredibly low CMC scores - possible test set config issue

    So I'm using my own dataset (configuration below). The dataset is configured similar to MARS and consists of pig identities (hence the name). I have tried both training with my dataset from scratch and by training with MARS then using transfer learning to train on my PigMARS. However, the results are insanely low, like so low it doesn't even seem reasonable.

    After 20 epochs training SENet on MARS I get Rank-1 CMC: 64%. Then training 20 epochs on PigMARS I get Rank-1 | 3 | 5 CMC: 0% and mAP lower than 20%.

    Training accuracy on PigMARS is in the high 90s, which made me think maybe I'm overfitting (even though I still would've expected a higher test set score), so I plotted the features generated for my test set (query left, gallery right) using t-SNE and it seems to have worked well in that regard....except the CMC & mAP scores are terrible.

    Screenshot from 2019-07-25 17-09-29

    The only thing I can think of is that I haven't configured the query/gallery test set correctly, but I can't find any issues with it. Any help is hugely appreciated.

    from __future__ import absolute_import
    from __future__ import print_function
    from __future__ import division
    
    import logging
    from os import path, listdir
    
    import numpy as np
    from torchreid.data import VideoDataset
    
    class PigMars(VideoDataset):
        dataset_dir = "pig_mars"
        def __init__(self, root='', **kwargs):
            self.root = root
            self.dataset_dir = path.join(self.root, self.dataset_dir)
            # self.cached_files = path.join(self.dataset_dir, "cache")
    
            train = self.load_data("train")
            query = self.load_data("query")
            gallery = self.load_data("gallery")
    
            print("Validating train")
            self.validate_dataset(train)
            print("Validating query")
            self.validate_dataset(query)
            print("Validating gallery")
            self.validate_dataset(gallery)
    
            super(PigMars, self).__init__(train, query, gallery, **kwargs)
    
        def validate_dataset(self, dataset):
            count = 0
            for imgs, pid, cid in dataset:
                for img in imgs:
                    img_fn = path.basename(img)
                    try:
                        assert self._get_cam_id_from_name(img_fn) == cid
                        assert self._get_object_id_from_name(img_fn) == pid
                    except AssertionError:
                        pass
    
        def load_data(self, dataset):
            return self.build_data(dataset)
    
        def build_data(self, dataset):
            if dataset == "train":
                return self._build_block("train")
            elif dataset == "query":
                test_block = np.array(self._build_block("test"))
                return self._build_query(test_block)
            elif dataset == "gallery":
                test_block = np.array(self._build_block("test"))
                return self._build_gallery(test_block)
            else:
                raise ValueError(f"Dataset {dataset} not defined")
    
        def _get_cam_id_from_name(self, filename):
            return int(filename.split("C")[1][0])
    
        def _get_object_id_from_name(self, filename):
            return int(filename.split("C")[0])
    
        def _all_same_cam(self, images):
            camid = self._get_cam_id_from_name(images[0])
            for image in images:
                if self._get_cam_id_from_name(image) != camid:
                    return False
            return True
    
        def _build_block(self, dataset):
            tracklet_size = 10
            bbox = path.join(self.dataset_dir,
                             f"bbox_{dataset}")
            tracklets = []
    
            pids = sorted([int(x) for x in listdir(bbox)])
            pid2label = {pid:label for label, pid in enumerate(pids)}
    
            for pid in pids:
                logging.debug(f"Processing pid {pid}")
                pid_dir = path.join(bbox, str(pid).zfill(4))
                frames = sorted(listdir(pid_dir))
                for i in range(len(frames)):
                    try:
                        selected_images = tuple(frames[i:i+tracklet_size])
                        selected_images = [path.join(self.dataset_dir,
                                                    f"bbox_{dataset}",
                                                    str(pid).zfill(4),
                                                    img_fp) \
                                           for img_fp in selected_images]
                    except IndexError:
                        break
                    camid = self._get_cam_id_from_name(selected_images[0])
                    if self._all_same_cam(selected_images):
                        tracklets.append((selected_images, pid2label[pid], camid))
    
            return tracklets
    
        def _load_query_idx(self):
            return np.load(path.join(self.dataset_dir, "info", "query_idx.npy"))
    
        def _build_query(self, test_block):
            query_idx = self._load_query_idx()
            return test_block[query_idx,:]
    
        def _build_gallery(self, test_block):
            query_idx = self._load_query_idx()
            gallery_idx = [i for i in range(test_block.shape[0]) \
                           if i not in query_idx]
            return test_block[gallery_idx,:]
    
    opened by JakeCowton 7
  • OSNet can't reproduce the result in paper on CUHK03 and MSMT17 dataset

    OSNet can't reproduce the result in paper on CUHK03 and MSMT17 dataset

    I have trained OSNet on Market1501、DukeMTMC-reID、CHUK03 and MSMT17 with referring to the paper regarding the hyperparameter setting https://arxiv.org/abs/1910.06827. And I got the same result as paper on Market1501 and DukeMTMC-reID dataset. But when it comes to CUHK03 and MSMT17 dataset, I can't reproduce the result (same hyperparameters as Market1501).

    The results are listing below:

    | Dataset | Expected Rank-1 | Expected mAP | Reprodued Rank-1 | Reproduced mAP | Train Mode | | ------- | --------------- | ------------ | ---------------- | --------------- | ------------ | | CUHK03 | 72.3 | 67.8 | 67.6 (-4.7) | 63.7 (-4.1) | fine-tune | | CUHK03 | 57.1 | 54.2 | 51.9 (-5.2) | 50.2 (-4) | scratch | | MSMT17 | 78.7 | 52.9 | 78.2 | 50.2 (-2.7) | fine-tune | | MSMT17 | 71 | 43.4 | 69.3 | 39.9 (-3.5) | scratch |

    For CUHK03, I used the 767/700 split version. For MSMT17, I used the V1 version.

    opened by valuefish 7
  • Training DukeMTMC-VideoReID  dataset

    Training DukeMTMC-VideoReID dataset

    @luzai @KaiyangZhou Hi first of thanks for the wonderful code representation . i have few queries when training the DukeMTMC-VideoReID dataset

    1.When i download the dataset from the source i have only train , gallery and video folder there is no .json file. Can you share me how to generate the .json file , since it gives me error camid = int(img_name[5]) - 1 # index-0 ValueError: invalid literal for int() with base 10: 'C'

    Can you pls help me out in solving this issues

    opened by abhigoku10 7
  • 使用triplet在相同的环境下测试无法达到正常的结果

    使用triplet在相同的环境下测试无法达到正常的结果

    您好,我按照您的环境(PyTorch (0.4.0),torchvision (0.2.1),Python2)以及方法复现了cross entropy loss+ triplet loss 的reid,数据集是market1501, 最后的结果只能有: 单卡 Rank-1/Rank-5/Rank-10: 81.0/92.6/95.4 mAP:63.1 多(4)卡 Rank-1/Rank-5/Rank-10: 43.2/66.7/75.8 mAP:24.2 单独复现cross entropy loss的是结果正常能达到您的结果,加上triplet loss会有以上情况出现。使用您提供的pretrained的模型测试也是能够正常达到rank-1 87的结果 请问可能是哪里有问题呢 谢谢

    opened by rjquan 7
  • Getting error while feeding custom dataset

    Getting error while feeding custom dataset

    I want to train the reidentification model on VeRi vehicle dataset. I followed the instructions given here on how to use custom dataset: https://kaiyangzhou.github.io/deep-person-reid/user_guide.html#use-your-own-dataset

    When I try to train "hacnn" model on this custom (VeRi) dataset, I am not able to train the model. Please find below the dataset statistics and the error that I am getting:

    => Loading train (source) dataset
    => Loaded VeRiDataset
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   575 |    37746 |        20
      query    |   200 |     1678 |        19
      gallery  |   200 |    11579 |        19
      ----------------------------------------
    => Loading test (target) dataset
    => Loaded VeRiDataset
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   575 |    37746 |        20
      query    |   200 |     1678 |        19
      gallery  |   200 |    11579 |        19
      ----------------------------------------
    
    
      **************** Summary ****************
      train            : ['veri_dataset']
      # train datasets : 1
      # train ids      : 575
      # train images   : 37746
      # train cameras  : 20
      test             : ['veri_dataset']
      *****************************************
    
    
    => Start training
    /home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
      warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
    Traceback (most recent call last):
      File "train_torchreid.py", line 52, in <module>
        print_freq=10
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/engine.py", line 100, in run
        self.train(epoch, max_epoch, trainloader, fixbase_epoch, open_layers, print_freq)
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/image/softmax.py", line 99, in train
        loss = self._compute_loss(self.criterion, outputs, pids)
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/engine.py", line 302, in _compute_loss
        loss = DeepSupervision(criterion, outputs, targets)
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/losses/__init__.py", line 21, in DeepSupervision
        loss += criterion(x, y)
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
        result = self.forward(*input, **kwargs)
      File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/losses/cross_entropy_loss.py", line 47, in forward
        targets = torch.zeros(log_probs.size()).scatter_(1, targets.unsqueeze(1).data.cpu(), 1)
    RuntimeError: Invalid index in scatter at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:551
    

    Note: The same code is working fine if I use "market1501" dataset instead of my custom one.

    Please help me in solving this issue.

    Thanks

    opened by Rajat-Mehta 7
  • KeyError: 'state_dict'

    KeyError: 'state_dict'

    I run this code(train_img_model_xent_htri.py) with ubuntu 16.04 and python3.5 and appear this problem

    Loading checkpoint from 'saved-models/resnet50_xent_htri_market1501.pth.tar' Traceback (most recent call last): File "train_img_model_xent_htri.py", line 290, in main() File "train_img_model_xent_htri.py", line 155, in main model.load_state_dict(checkpoint['state_dict']) KeyError: 'state_dict'

    what is this mean ? i download this resnet50-19c8e357.pth , rename resnet50_xent_htri_market1501.pth.tar and put it into the file saved-models I don't know how to do.

    opened by lihao056 7
  • importlib-metadata error

    importlib-metadata error

    I'm having an issue with the version of importlib-metadata. One hand, the setup.py seems to be installing the 4.2.0 version of importlib-metadata, on the other hand it's complaining that it's <4.4.0. Any clues?

    Error: `error: importlib-metadata 4.2.0 is installed but importlib-metadata>=4.4 is required by {'markdown'}``

    Full stack:

    
    Processing dependencies for torchreid==1.4.0
    Searching for importlib-metadata<4.3
    Reading https://pypi.org/simple/importlib-metadata/
    Downloading https://files.pythonhosted.org/packages/22/51/52442c59db26637681148c21f8984eed58c9db67053a0a4783a047010c98/importlib_metadata-4.2.0-py3-none-any.whl#sha256=057e92c15bc8d9e8109738a48db0ccb31b4d9d5cfbee5a8670879a30be66304b
    Best match: importlib-metadata 4.2.0
    Processing importlib_metadata-4.2.0-py3-none-any.whl
    Installing importlib_metadata-4.2.0-py3-none-any.whl to c:\users\mazat\anaconda3\envs\soccernet\lib\site-packages
    Adding importlib-metadata 4.2.0 to easy-install.pth file
    
    Installed c:\users\mazat\anaconda3\envs\soccernet\lib\site-packages\importlib_metadata-4.2.0-py3.7.egg
    error: importlib-metadata 4.2.0 is installed but importlib-metadata>=4.4 is required by {'markdown'}
    
    
    opened by mazatov 1
  • Add optional arguments to ImageDataManager

    Add optional arguments to ImageDataManager

    Add **kwargs optional arguments to ImageDataManager

    I defined a custom ImageDataset, which takes some additional arguments for init.

    According to use custom dataset, the officially recommended way to use the dataset is to use the ImageDataManager

    I tried to pass **kwargs(a dict) into the torchreid.data.ImageDataManager() constructor. Unfortunately, due to the positional(fixed) arguments of the function init_image_dataset (in datamanager.py), the constructor of my own custom dataset cannot receive any additional arguaments.

    I hope it will fix the problem!

    opened by ZXYFrank 3
  • Idea: Torch re-id with thermal images ?

    Idea: Torch re-id with thermal images ?

    Hi !. I am wondering if there is a possibility of performing re-id of persons using thermal camera images ?

    Understand that there will be difficulty. Because the heat signature of a person is very very similar to each other. For example, a person will be a red/yellow figure against a blue background. Same as another person. Thus it is difficult to find unique features of each person/figure.

    opened by fatbringer 1
  • Issue with RandomDatasetSampler, same label getting assigned to images belonging to different datasets

    Issue with RandomDatasetSampler, same label getting assigned to images belonging to different datasets

    Hello, First of all, a big thank you for open sourcing this awesome repository! It has indeed reduced lots of efforts and rewriting person Reid boilerplate codes.

    I was trying to perform Multi dataset training where I wish to have images from multiple datasets in a batch. However, I think images belonging to multiple datasets are getting assigned the same label which is incorrect. At this line belonging to the market dataset, each PID is getting converted to 0 to max(ids) range, The same is getting done for other datasets. https://github.com/KaiyangZhou/deep-person-reid/blob/6987d99074fcc63146660b83b38218c37b4412b3/torchreid/data/datasets/image/market1501.py#L74

    But here in datamanager, when multiple datasets are getting added, different labels for different datasets are not getting seperated. This will lead to multiple different people being mapped to same id, which is very incorrect. https://github.com/KaiyangZhou/deep-person-reid/blob/6987d99074fcc63146660b83b38218c37b4412b3/torchreid/data/datamanager.py#L251

    Please have a look at it to see if it's actually a bug or I have misunderstood the code.

    Many thanks!

    opened by chaitrasj 1
  • I want a parameter configuration that reproduces the results

    I want a parameter configuration that reproduces the results

    Using the operating instructions you provided and the parameter settings in the documentation did not reproduce the results, The parameter settings in the article are even less effective. Can you provide a parameter setting that achieves the effect in the article and put it in the document.

    Evaluating market1501 (source)

    Extracting features from query set ... Done, obtained 3368-by-512 matrix Extracting features from gallery set ... Done, obtained 15913-by-512 matrix Speed: 0.0299 sec/batch Computing distance matrix with metric=euclidean ... Computing CMC and mAP ... ** Results ** mAP: 78.0% CMC curve Rank-1 : 91.3% Rank-5 : 96.8% Rank-10 : 97.9% Rank-20 : 98.8% Checkpoint saved to "log/osnet_x1_0-softmax-market1501/model/model.pth.tar-64"

    has converged

    => Final test

    Evaluating market1501 (source)

    Extracting features from query set ... Done, obtained 3368-by-512 matrix Extracting features from gallery set ... Done, obtained 15913-by-512 matrix Speed: 0.0299 sec/batch Computing distance matrix with metric=euclidean ... Computing CMC and mAP ... ** Results ** mAP: 78.1% CMC curve Rank-1 : 91.3% Rank-5 : 96.8% Rank-10 : 97.9% Rank-20 : 98.8% Checkpoint saved to "log/osnet_x1_0-softmax-market1501/model/model.pth.tar-100"

    Total params: 2,578,879 Trainable params: 2,578,879 Non-trainable params: 0 Input size (MB): 0.38 Forward/backward pass size (MB): 282.45 Params size (MB): 9.84 Estimated Total Size (MB): 292.66 Loading checkpoint from "******************************/model.pth.tar-100" Loaded model weights Loaded optimizer Last epoch = 100 Last rank1 = 91.3% dist_metric='cosine'

    Evaluating dukemtmcreid (target)

    Extracting features from query set ... Done, obtained 2228-by-512 matrix Extracting features from gallery set ... Done, obtained 17661-by-512 matrix Speed: 0.0303 sec/batch Computing distance matrix with metric=cosine ... Computing CMC and mAP ... ** Results ** mAP: 24.3% CMC curve Rank-1 : 41.7% Rank-5 : 57.7% Rank-10 : 63.3% Rank-20 : 69.0%

    opened by yup1212 2
  • Unable to reproduce results with multiple runs

    Unable to reproduce results with multiple runs

    Results are random when trained multiple times with exactly the same configuration. Can you please help me understand why this is the case?

    I am attaching the config for reference. I trained the GRID dataset on osnet_ain two times to verify this behavior.

    First Run: Rank1 - 11.2 %, mAP 18.7 %

    adam:
      beta1: 0.9
      beta2: 0.999
    cuhk03:
      classic_split: False
      labeled_images: False
      use_metric_cuhk03: False
    data:
      combineall: False
      height: 256
      k_tfm: 1
      load_train_targets: False
      norm_mean: [0.485, 0.456, 0.406]
      norm_std: [0.229, 0.224, 0.225]
      sources: ['grid']
      split_id: 0
      targets: ['grid']
      transforms: ['random_flip', 'color_jitter']
      type: image
      width: 128
      workers: 4
    loss:
      name: softmax
      softmax:
        label_smooth: True
      triplet:
        margin: 0.3
        weight_t: 1.0
        weight_x: 0.0
    market1501:
      use_500k_distractors: False
    model:
      load_weights: 
      low_memory: False
      name: osnet_ain_x1_0
      pretrained: True
      resume: 
    rmsprop:
      alpha: 0.99
    sampler:
      num_cams: 1
      num_datasets: 1
      num_instances: 4
      train_sampler: RandomSampler
      train_sampler_t: RandomSampler
    sgd:
      dampening: 0.0
      momentum: 0.9
      nesterov: False
    test:
      batch_size: 300
      cross_camera: False
      dist_metric: cosine
      eval_freq: 1
      evaluate: False
      normalize_feature: False
      ranks: [1, 5, 10, 20]
      rerank: False
      start_eval: 0
      visrank: False
      visrank_topk: 10
    train:
      base_lr_mult: 0.1
      batch_size: 64
      fixbase_epoch: 10
      gamma: 0.1
      lr: 0.0015
      lr_scheduler: cosine
      max_epoch: 100
      new_layers: ['classifier']
      open_layers: ['classifier']
      optim: amsgrad
      print_freq: 20
      seed: 1
      staged_lr: False
      start_epoch: 0
      stepsize: [20]
      weight_decay: 0.0005
    use_gpu: True
    video:
      pooling_method: avg
      sample_method: evenly
      seq_len: 15
    
    Collecting env info ...
    ** System info **
    PyTorch version: 1.9.0
    Is debug build: False
    CUDA used to build PyTorch: 11.1
    ROCM used to build PyTorch: N/A
    
    OS: Ubuntu 18.04.6 LTS (x86_64)
    GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
    Clang version: Could not collect
    CMake version: version 3.22.1
    Libc version: glibc-2.17
    
    Python version: 3.7 (64-bit runtime)
    Python platform: Linux-5.4.0-90-generic-x86_64-with-debian-buster-sid
    Is CUDA available: True
    CUDA runtime version: Could not collect
    GPU models and configuration: 
    GPU 0: GeForce RTX 2080 Ti
    GPU 1: GeForce RTX 2080 Ti
    
    Nvidia driver version: 460.106.00
    cuDNN version: Could not collect
    HIP runtime version: N/A
    MIOpen runtime version: N/A
    
    Versions of relevant libraries:
    [pip3] numpy==1.21.1
    [pip3] numpydoc==1.1.0
    [pip3] torch==1.9.0
    [pip3] torchaudio==0.9.0a0+33b2469
    [pip3] torchreid==1.4.0
    [pip3] torchvision==0.10.0
    [conda] _tflow_select             2.3.0                       mkl  
    [conda] blas                      1.0                         mkl  
    [conda] cudatoolkit               11.1.74              h6bb024c_0    nvidia
    [conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
    [conda] libblas                   3.9.0            11_linux64_mkl    conda-forge
    [conda] libcblas                  3.9.0            11_linux64_mkl    conda-forge
    [conda] mkl                       2021.3.0           h06a4308_520  
    [conda] mkl-service               2.4.0            py37h7f8727e_0  
    [conda] mkl_fft                   1.3.0            py37h42c9631_2  
    [conda] mkl_random                1.2.2            py37h51133e4_0  
    [conda] numpy                     1.21.1                   pypi_0    pypi
    [conda] numpy-base                1.20.3           py37h74d4b33_0  
    [conda] numpydoc                  1.1.0              pyhd3eb1b0_1  
    [conda] pytorch                   1.9.0           py3.7_cuda11.1_cudnn8.0.5_0    pytorch
    [conda] tensorflow                2.4.1           mkl_py37h2d14ff2_0  
    [conda] tensorflow-base           2.4.1           mkl_py37h43e0292_0  
    [conda] torchaudio                0.9.0                      py37    pytorch
    [conda] torchreid                 1.4.0                     dev_0    <develop>
    [conda] torchvision               0.10.0               py37_cu111    pytorch
            Pillow (8.3.1)
    
    Building train transforms ...
    + resize to 256x128
    + random flip
    + color jitter
    + to torch tensor of range [0, 1]
    + normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    Building test transforms ...
    + resize to 256x128
    + to torch tensor of range [0, 1]
    + normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    => Loading train (source) dataset
    => Loaded GRID
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   125 |      250 |         6
      query    |   125 |      125 |         5
      gallery  |   126 |      900 |         5
      ----------------------------------------
    => Loading test (target) dataset
    => Loaded GRID
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   125 |      250 |         6
      query    |   125 |      125 |         5
      gallery  |   126 |      900 |         5
      ----------------------------------------
    
    
      **************** Summary ****************
      source            : ['grid']
      # source datasets : 1
      # source ids      : 125
      # source images   : 250
      # source cameras  : 6
      target            : ['grid']
      *****************************************
    
    
    Building model: osnet_ain_x1_0
    Successfully loaded imagenet pretrained weights from "/home/meghana/.cache/torch/checkpoints/osnet_ain_x1_0_imagenet.pth"
    ** The following layers are discarded due to unmatched keys or layer size: ['classifier.weight', 'classifier.bias']
    Model complexity: params=2,193,616 flops=978,878,352
    Building softmax-engine for image-reid
    => Start training
    * Only train ['classifier'] (epoch: 1/10)
    ##### Evaluating grid (source) #####
    Extracting features from query set ...
    Done, obtained 125-by-512 matrix 80
    Extracting features from gallery set ...
    Done, obtained 900-by-512 matrix
    Speed: 0.3443 sec/batch
    Computing distance matrix with metric=cosine ...
    Computing CMC and mAP ...
    ** Results **
    mAP: 6.2%
    CMC curve
    Rank-1  : 3.2%
    Rank-5  : 8.8%
    Rank-10 : 12.8%
    Rank-20 : 16.0%
    Checkpoint saved to "/home/meghana/big_storage/reid-trials/Experiments_New/osnet_ain_new_exps/Grid_train/model/model.pth.tar-1"
    .....
    => Final test
    ##### Evaluating grid (source) #####
    Extracting features from query set ...
    Done, obtained 125-by-512 matrix 80
    Extracting features from gallery set ...
    Done, obtained 900-by-512 matrix
    Speed: 0.0203 sec/batch
    Computing distance matrix with metric=cosine ...
    Computing CMC and mAP ...
    ** Results **
    mAP: 18.7%
    CMC curve
    Rank-1  : 11.2%
    Rank-5  : 26.4%
    Rank-10 : 29.6%
    Rank-20 : 36.0%
    Checkpoint saved to "/home/meghana/big_storage/reid-trials/Experiments_New/osnet_ain_new_exps/Grid_train/model/model.pth.tar-100"
    Elapsed 0:06:02"""
    

    Second Run: Rank1 - 13.6 %, mAP: 19.8 %

    Show configuration
    adam:
      beta1: 0.9
      beta2: 0.999
    cuhk03:
      classic_split: False
      labeled_images: False
      use_metric_cuhk03: False
    data:
      combineall: False
      height: 256
      k_tfm: 1
      load_train_targets: False
      norm_mean: [0.485, 0.456, 0.406]
      norm_std: [0.229, 0.224, 0.225]
      root: /home/meghana/big_storage/reid-trials/reid-data/RGBDatasets/
      save_dir: /home/meghana/big_storage/reid-trials/Experiments_New/osnet_ain_new_exps/Grid_train/trial2/
      sources: ['grid']
      split_id: 0
      targets: ['grid']
      transforms: ['random_flip', 'color_jitter']
      type: image
      width: 128
      workers: 4
    loss:
      name: softmax
      softmax:
        label_smooth: True
      triplet:
        margin: 0.3
        weight_t: 1.0
        weight_x: 0.0
    market1501:
      use_500k_distractors: False
    model:
      load_weights: 
      low_memory: False
      name: osnet_ain_x1_0
      pretrained: True
      resume: 
    rmsprop:
      alpha: 0.99
    sampler:
      num_cams: 1
      num_datasets: 1
      num_instances: 4
      train_sampler: RandomSampler
      train_sampler_t: RandomSampler
    sgd:
      dampening: 0.0
      momentum: 0.9
      nesterov: False
    test:
      batch_size: 300
      cross_camera: False
      dist_metric: cosine
      eval_freq: 1
      evaluate: False
      normalize_feature: False
      ranks: [1, 5, 10, 20]
      rerank: False
      start_eval: 0
      visrank: False
      visrank_topk: 10
    train:
      base_lr_mult: 0.1
      batch_size: 64
      fixbase_epoch: 10
      gamma: 0.1
      lr: 0.0015
      lr_scheduler: cosine
      max_epoch: 100
      new_layers: ['classifier']
      open_layers: ['classifier']
      optim: amsgrad
      print_freq: 20
      seed: 1
      staged_lr: False
      start_epoch: 0
      stepsize: [20]
      weight_decay: 0.0005
    use_gpu: True
    video:
      pooling_method: avg
      sample_method: evenly
      seq_len: 15
    
    Collecting env info ...
    ** System info **
    PyTorch version: 1.9.0
    Is debug build: False
    CUDA used to build PyTorch: 11.1
    ROCM used to build PyTorch: N/A
    
    OS: Ubuntu 18.04.6 LTS (x86_64)
    GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
    Clang version: Could not collect
    CMake version: version 3.22.1
    Libc version: glibc-2.17
    
    Python version: 3.7 (64-bit runtime)
    Python platform: Linux-5.4.0-90-generic-x86_64-with-debian-buster-sid
    Is CUDA available: True
    CUDA runtime version: Could not collect
    GPU models and configuration: 
    GPU 0: GeForce RTX 2080 Ti
    GPU 1: GeForce RTX 2080 Ti
    
    Nvidia driver version: 460.106.00
    cuDNN version: Could not collect
    HIP runtime version: N/A
    MIOpen runtime version: N/A
    
    Versions of relevant libraries:
    [pip3] numpy==1.21.1
    [pip3] numpydoc==1.1.0
    [pip3] torch==1.9.0
    [pip3] torchaudio==0.9.0a0+33b2469
    [pip3] torchreid==1.4.0
    [pip3] torchvision==0.10.0
    [conda] _tflow_select             2.3.0                       mkl  
    [conda] blas                      1.0                         mkl  
    [conda] cudatoolkit               11.1.74              h6bb024c_0    nvidia
    [conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
    [conda] libblas                   3.9.0            11_linux64_mkl    conda-forge
    [conda] libcblas                  3.9.0            11_linux64_mkl    conda-forge
    [conda] mkl                       2021.3.0           h06a4308_520  
    [conda] mkl-service               2.4.0            py37h7f8727e_0  
    [conda] mkl_fft                   1.3.0            py37h42c9631_2  
    [conda] mkl_random                1.2.2            py37h51133e4_0  
    [conda] numpy                     1.21.1                   pypi_0    pypi
    [conda] numpy-base                1.20.3           py37h74d4b33_0  
    [conda] numpydoc                  1.1.0              pyhd3eb1b0_1  
    [conda] pytorch                   1.9.0           py3.7_cuda11.1_cudnn8.0.5_0    pytorch
    [conda] tensorflow                2.4.1           mkl_py37h2d14ff2_0  
    [conda] tensorflow-base           2.4.1           mkl_py37h43e0292_0  
    [conda] torchaudio                0.9.0                      py37    pytorch
    [conda] torchreid                 1.4.0                     dev_0    <develop>
    [conda] torchvision               0.10.0               py37_cu111    pytorch
            Pillow (8.3.1)
    
    Building train transforms ...
    + resize to 256x128
    + random flip
    + color jitter
    + to torch tensor of range [0, 1]
    + normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    Building test transforms ...
    + resize to 256x128
    + to torch tensor of range [0, 1]
    + normalization (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
    => Loading train (source) dataset
    => Loaded GRID
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   125 |      250 |         6
      query    |   125 |      125 |         5
      gallery  |   126 |      900 |         5
      ----------------------------------------
    => Loading test (target) dataset
    => Loaded GRID
      ----------------------------------------
      subset   | # ids | # images | # cameras
      ----------------------------------------
      train    |   125 |      250 |         6
      query    |   125 |      125 |         5
      gallery  |   126 |      900 |         5
      ----------------------------------------
    
    
      **************** Summary ****************
      source            : ['grid']
      # source datasets : 1
      # source ids      : 125
      # source images   : 250
      # source cameras  : 6
      target            : ['grid']
      *****************************************
    
    
    Building model: osnet_ain_x1_0
    Successfully loaded imagenet pretrained weights from "/home/meghana/.cache/torch/checkpoints/osnet_ain_x1_0_imagenet.pth"
    ** The following layers are discarded due to unmatched keys or layer size: ['classifier.weight', 'classifier.bias']
    Model complexity: params=2,193,616 flops=978,878,352
    Building softmax-engine for image-reid
    => Start training
    * Only train ['classifier'] (epoch: 1/10)
    ##### Evaluating grid (source) #####
    Extracting features from query set ...
    Done, obtained 125-by-512 matrix 80
    Extracting features from gallery set ...
    Done, obtained 900-by-512 matrix
    Speed: 0.3568 sec/batch
    Computing distance matrix with metric=cosine ...
    Computing CMC and mAP ...
    ** Results **
    mAP: 6.2%
    CMC curve
    Rank-1  : 3.2%
    Rank-5  : 8.8%
    Rank-10 : 12.8%
    Rank-20 : 16.0%
    ....
    => Final test
    ##### Evaluating grid (source) #####
    Extracting features from query set ...
    Done, obtained 125-by-512 matrix 80
    Extracting features from gallery set ...
    Done, obtained 900-by-512 matrix
    Speed: 0.0282 sec/batch
    Computing distance matrix with metric=cosine ...
    Computing CMC and mAP ...
    ** Results **
    mAP: 19.8%
    CMC curve
    Rank-1  : 13.6%
    Rank-5  : 24.0%
    Rank-10 : 31.2%
    Rank-20 : 39.2%
    Checkpoint saved to "/home/meghana/big_storage/reid-trials/Experiments_New/osnet_ain_new_exps/Grid_train/trial2/model/model.pth.tar-100"
    Elapsed 0:06:02
    

    Any help is appreciated...****

    opened by meghana-shastri24 0
  • ResNet50_fc512 vs OSNet speed and accuracy

    ResNet50_fc512 vs OSNet speed and accuracy

    Hi there,

    First, thank you for your great work on TorchReID, it is really useful to me!

    I have done some comparisons of ResNet50_fc512_market and OSNet_x1.0 with two of my datasets. The dataset contains images from two 15 min videos and accuracy is performed using mAP metric. I respectively compute 347653 and 682750 predictions for each dataset.

    I found out that OSNet is twice slower than ResNet50_fc512 (13.6ms vs 7.6ms) while it as 10x more parameters. Accuracy wise i'm getting roughly the same mAP=88.6% for ResNet50_fc512 and mAP=89.3% for OSNet.

    I would like to understand why OSNet is slower then ResNet50 while it has twice less parameters and also if i should expect much better results from OSNet (I know i could depend on the data as well), because at the moment i'm not getting a good trade off between speed and accuracy.

    Thanks for your help.

    opened by corentin87 0
  • Feature distances not discriminatory

    Feature distances not discriminatory

    Hi,

    I am using torchreid as a feature extractor for my custom dataset. When I find euclidean or cosine distances between probe and gallery images, the distances are not very well separated between matching and non-matching candidates. For example, if the probe image is a person in a red dress, then the right match will have a distance of 0.1 whereas someone in a yellow dress will have a distance of 0.2. This does not seem like a big enough separation considering how different the subjects look.

    Is this expected behavior for out-of-distribution data? Do I have no other choice apart from retraining the model on my custom dataset?

    I am using OSNet model for feature extraction.

    opened by mishravishnu 2
  • requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1-CaioD9NaqbHK_kzSMW8VE4_3KcsRjEo (Caused by NewConnectinnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7a8d535d60>: Failed to establish a new connection: [Errno 110] Connection timed out'))

    requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1-CaioD9NaqbHK_kzSMW8VE4_3KcsRjEo (Caused by NewConnectinnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out'))

    i download the osnet modol from the model zoo. this error appear when test the model....

    requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1-CaioD9NaqbHK_kzSMW8VE4_3KcsRjEo (Caused by NewConnectinnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7a8d535d60>: Failed to establish a new connection: [Errno 110] Connection timed out'))

    opened by ZJX-CV 2
Releases(v1.0.6)
  • v1.0.6(Oct 23, 2019)

  • v1.0.5(Oct 23, 2019)

  • v1.0.0(Aug 26, 2019)

    Major updates:

    • Significant changes to "scripts/main.py", where most arguments in argparse are replaced with config.
    • Add config files which contain predefined training params to configs/.
    • In data manager and engine, use_cpu is changed to use_gpu.
    • In data manager, batch_size is changed to batch_size_train and batch_size_test.
    • Tensorboard is available.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.1(Aug 4, 2019)

    Main update:

    • Plot ranks in a single figure (currently support image-reid)
    • Visualize activation maps to understand where CNNs focus on to extract features for reid.
    Source code(tar.gz)
    Source code(zip)
  • v0.8.1(Jul 8, 2019)

  • v0.8.0(Jul 3, 2019)

  • v0.7.8(May 28, 2019)

  • v0.7.7(May 24, 2019)

  • v0.7.5(May 9, 2019)

    Major updates:

    • Added person reranking, which can be activated with rerank=True in engine.run(). It only works in the evaluation mode, i.e. test_only=True.
    • Added normalize_feature to engine.run() to allow the feature vectors to be normalized with L2 norm before calculating feature distance.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.4(Apr 27, 2019)

    Major changes:

    • Added conda install instructions.
    • Fixed a bug in learning rate scheduler https://github.com/KaiyangZhou/deep-person-reid/commit/dcd8da565a9802bf48e8694e616e633a51b413a3
    • Fixed a bug in combineall https://github.com/KaiyangZhou/deep-person-reid/commit/bb6dc46e21e335789b9d891f7191c1da3a5d2e01
    Source code(tar.gz)
    Source code(zip)
  • v0.7.3(Apr 18, 2019)

    Major changes

    • https://github.com/KaiyangZhou/deep-person-reid/commit/1e9d466f42256cc451f6f73761c298cabbcd0b39
    • https://github.com/KaiyangZhou/deep-person-reid/commit/4a033659b0330bcbd25dc1cc344cf26ddd69ac73
    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Mar 25, 2019)

  • v0.7.1(Mar 25, 2019)

    Bug fix:

    • https://github.com/KaiyangZhou/deep-person-reid/commit/235348f67248a9d27d5c9bcafcabcfe5cbf61cb3: return ImageDataset or VideoDataset rather than Dataset.
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Mar 25, 2019)

  • v0.5.0(Nov 12, 2018)

    Major updates:

    • Model codes such as resnet.py and densenet.py keep the original style for easier modification.
    • Generalize CrossEntropyLableSmooth to CrossEntropyLoss. --label-smooth should be called explicitly in order to add the label smoothing regularizer to the cross entropy loss.
    • Add support to multi-dataset training. Datasets are specified by the arguments -s and -t, which refer to source datasets and target datasets, respectively. Both can take multiple strings delimited by space. For example, say you wanna train a model using Market1501+DukeMTMC-reID, just set -s market1501 dukemtmcreid. If you wanna test on multiple datasets, you can do -t market1501 dukemtmcreid cuhk03 msmt17.
    • Arguments are unified in args.py.
    • Dataloaders are wrapped into two classes, which are ImageDataManager and VideoDataManager (see data_manager.py). A datamanger is initialized by dm = ImageDataManager(use_gpu, **image_dataset_kwargs(args)) where image_dataset_kwargs() is implemented in args.py. Therefore, when new arguments are added to the data manager, you don't need to exhausively change everywhere in the code. What you need to update are (1) add new arguments in args.py and (2) update the input arguments in data_manager.py.
    • BENCHMARK is replaced with MODEL_ZOO where model weights and training scripts can be downloaded.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Aug 15, 2018)

    • Added --lambda-xent and --lambda-htri in xxx_xent_htri.py, which can balance between cross entropy loss and hard mining triplet loss.
    • Divided losses into separate files for easier extension.
    • Moved major codes to the folder torchreid/ (such structuring will be maintained).
    • Automated the download of dukemtmcreid and dukemtmcvidreid.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Aug 1, 2018)

    • Added --load-weights (weights that don't match in size will be discarded, e.g. old classification layer).
    • Updated dukemtmcvidreid naming, old/new formats are supported.
    • Added --vis-ranked-res and reidtools.py, allowing ranked images to be visualized.

    Note: --use-lmdb is postponed.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jul 6, 2018)

    To be done:

    • --lmdb is under development.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jun 4, 2018)

  • v0.0.9(Jun 4, 2018)

    • multi-GPU training.
    • both image-based and video-based reid.
    • unified interface for different reid models.
    • easy dataset preparation.
    • end-to-end training and evaluation.
    • standard dataset splits used by most papers.
    • download of trained models.
    Source code(tar.gz)
    Source code(zip)
Owner
Kaiyang
Researcher in computer vision and machine learning :)
Kaiyang
[TIP2020] Adaptive Graph Representation Learning for Video Person Re-identification

Introduction This is the PyTorch implementation for Adaptive Graph Representation Learning for Video Person Re-identification. Get started git clone h

WuYiming 39 Nov 25, 2021
IAUnet: Global Context-Aware Feature Learning for Person Re-Identification

IAUnet This repository contains the code for the paper: IAUnet: Global Context-Aware Feature Learning for Person Re-Identification Ruibing Hou, Bingpe

null 24 Oct 20, 2021
Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification"

hypergraph_reid Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification" If you find this help your research,

null 58 Feb 28, 2022
Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral)

Joint Discriminative and Generative Learning for Person Re-identification [Project] [Paper] [YouTube] [Bilibili] [Poster] [Supp] Joint Discriminative

NVIDIA Research Projects 1.2k Mar 4, 2022
[BMVC2021] The official implementation of "DomainMix: Learning Generalizable Person Re-Identification Without Human Annotations"

DomainMix [BMVC2021] The official implementation of "DomainMix: Learning Generalizable Person Re-Identification Without Human Annotations" [paper] [de

Wenhao Wang 11 Jan 28, 2022
Paper: Cross-View Kernel Similarity Metric Learning Using Pairwise Constraints for Person Re-identification

Cross-View Kernel Similarity Metric Learning Using Pairwise Constraints for Person Re-identification T M Feroz Ali, Subhasis Chaudhuri, ICVGIP-20-21

T M Feroz Ali 1 Nov 27, 2021
Joint Detection and Identification Feature Learning for Person Search

Person Search Project This repository hosts the code for our paper Joint Detection and Identification Feature Learning for Person Search. The code is

null 690 Mar 7, 2022
offical implement of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021

LifelongReID Offical implementation of our Lifelong Person Re-Identification via Adaptive Knowledge Accumulation in CVPR2021 by Nan Pu, Wei Chen, Yu L

PeterPu 63 Mar 5, 2022
[CVPR-2021] UnrealPerson: An adaptive pipeline for costless person re-identification

UnrealPerson: An Adaptive Pipeline for Costless Person Re-identification In our paper (arxiv), we propose a novel pipeline, UnrealPerson, that decreas

ZhangTianyu 64 Feb 21, 2022
Unsupervised Pre-training for Person Re-identification (LUPerson)

LUPerson Unsupervised Pre-training for Person Re-identification (LUPerson). The repository is for our CVPR2021 paper Unsupervised Pre-training for Per

null 98 Mar 6, 2022
Person Re-identification

Person Re-identification Final project of Computer Vision Table of content Person Re-identification Table of content Students: Proposed method Dataset

Nguyễn Hoàng Quân 4 Jun 17, 2021
CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification (ICCV2021)

CM-NAS Official Pytorch code of paper CM-NAS: Cross-Modality Neural Architecture Search for Visible-Infrared Person Re-Identification in ICCV2021. Vis

JDAI-CV 33 Mar 1, 2022
Exploiting Robust Unsupervised Video Person Re-identification

Exploiting Robust Unsupervised Video Person Re-identification Implementation of the proposed uPMnet. For the preprint, please refer to [Arxiv]. Gettin

null 1 Dec 14, 2021
Online Pseudo Label Generation by Hierarchical Cluster Dynamics for Adaptive Person Re-identification

Online Pseudo Label Generation by Hierarchical Cluster Dynamics for Adaptive Person Re-identification

TANG, shixiang 4 Jan 21, 2022
Open source person re-identification library in python

Open-ReID Open-ReID is a lightweight library of person re-identification for research purpose. It aims to provide a uniform interface for different da

Tong Xiao 1.2k Mar 6, 2022
Self-Supervised Pre-Training for Transformer-Based Person Re-Identification

Self-Supervised Pre-Training for Transformer-Based Person Re-Identification [pdf] The official repository for Self-Supervised Pre-Training for Transfo

Hao Luo 45 Dec 3, 2021
Code of paper Interact, Embed, and EnlargE (IEEE): Boosting Modality-specific Representations for Multi-Modal Person Re-identification.

Interact, Embed, and EnlargE (IEEE): Boosting Modality-specific Representations for Multi-Modal Person Re-identification We provide the codes for repr

null 4 Dec 22, 2021
Computer Vision Script to recognize first person motion, developed as final project for the course "Machine Learning and Deep Learning"

Overview of The Code BaseColab/MLDL_FPAR.pdf: it contains the full explanation of our work Base Colab: it contains the base colab used to perform all

Simone Papicchio 2 Mar 3, 2022
Builds a LoRa radio frequency fingerprint identification (RFFI) system based on deep learning techiniques

This project builds a LoRa radio frequency fingerprint identification (RFFI) system based on deep learning techiniques.

null 2 Feb 17, 2022