Code Monkey home page Code Monkey logo

alignedreid's People

Contributors

chrisbellew avatar michuanhaohao 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  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  avatar  avatar  avatar

alignedreid's Issues

poor metrics when training on market1501

hello, thanks for your great work and kind sharing. When I intend to reproduce your work, and simply train on market1501 at first. The output info seems weird. The metrics are extremely low as

Epoch: [300][80/93] Time 0.283 (0.252) Data 0.002 (0.007) Loss 4.7850 (5.0124) CLoss 4.7733 (5.0106) GLoss 0.0117 (0.0015) LLoss 0.0000 (0.0004)
Epoch: [300][90/93] Time 0.238 (0.252) Data 0.001 (0.006) Loss 4.9203 (5.0022) CLoss 4.9203 (5.0006) GLoss 0.0000 (0.0013) LLoss 0.0000 (0.0003)
==> 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.131/32
Only using global branch
Computing local distance...
Matrix part (17, 80) / (17, 80), +0.06s, total 87.87s
Using global and local branches
Computing CMC and mAP
Results ----------
mAP: 0.2%
CMC curve
Rank-1 : 0.1%
Rank-5 : 0.9%
Rank-10 : 1.8%
Rank-20 : 3.5%

Computing local distance...
Matrix part (17, 17) / (17, 17), +0.06s, total 17.33s
Computing local distance...
Matrix part (80, 80) / (80, 80), +0.06s, total 393.07s
Using global and local branches for reranking
us

My env is 3090Ti, python 3.7, cuda 11.0, and the command is

python train_alignedreid.py -d market1501 -a resnet50 --test_distance global_local --reranking --root /home/vgc/users/lwz/data/reID/market_1501_raw/

Any recommendation please? Thanks in advance.

Training on custom dataset tutorials

Thank you very much for implementing this repo, I was fascinated by your work a lot.
Would you mind providing any further tutorial on training on custom dataset.

market1501 got 91.7% accuracy of top 1 , but cuhk03 only got 66.6%

hi, why i only got 66.6% top 1 accuracy on cuhk03 dataset with the same setting as martket1501 trainning ? (python train_ml_alignedreid.py -d cuhk03 -a resnet50 --test_distance global_local --stepsize 150 --lr 0.0002 --save-dir ./log/resnet50-cuhk03-test1/ --train-batch 256 --eval-step 150 --max-epoch 300 --reranking )

different results by a large margin from the paper and your repo

HI! I came across your paper; but the reported results on market are very differents by a large margin. In this repo, you report 88.2/73.1 for rank1/mAP without re-ranking but in the paper ,we find 91.8/79.3 without re-ranking results. A margin of 3.6%/6.2% is too high. Can you explain this?

Some wrong with the code?

Firstly, in Alignedreid_demo.py Line 21, we don't import os while using the following code
os.environ['CUDA_VISIBLE_DEVICES'] = "0"

Second, is there anything noteworthy? I follow the original config and run python train_alignedreid.py -d market1501 -a resnet50 --test_distance global_local --reranking --labelsmooth, finally I got the follow result:
Computing local distance...
Using global and local branches for reranking
using GPU to compute original distance
starting re_ranking
Computing CMC and mAP for re_ranking
Results ----------
mAP(RK): 46.7%
CMC curve(RK)
Rank-1 : 63.3%
Rank-5 : 76.7%
Rank-10 : 82.0%
Rank-20 : 86.8%

==> Best Rank-1 63.3%, achieved at epoch 300
Finished. Total elapsed time (h:m:s): 6:26:50. Training time (h:m:s): 6:01:18.

It is not normal, and I notice that my GLoss and Lloss is near to 0, is it normal? And if not, Can you give me some advice?

Something wrong with market1501?

I run the bellow script:
python train_alignedreid_org.py -d market1501 -a resnet50 --test_distance global_local --reranking
and get the result
==> 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.096/32
Only using global branch
Computing local distance...
Matrix part (17, 80) / (17, 80), +0.23s, total 307.60s
Using global and local branches
Computing CMC and mAP
Results ----------
mAP: 28.9%
CMC curve
Rank-1 : 53.9%
Rank-5 : 75.3%
Rank-10 : 82.6%
Rank-20 : 87.5%

Computing local distance...
Matrix part (17, 17) / (17, 17), +0.20s, total 64.45s
Computing local distance...
Matrix part (80, 80) / (80, 80), +0.25s, total 1443.70s
Using global and local branches for reranking
using GPU to compute original distance
starting re_ranking
Computing CMC and mAP for re_ranking
Results ----------
mAP(RK): 40.3%
CMC curve(RK)
Rank-1 : 56.0%
Rank-5 : 74.0%
Rank-10 : 79.9%
Rank-20 : 85.2%

==> Best Rank-1 56.0%, achieved at epoch 300
Finished. Total elapsed time (h:m:s): 3:02:26. Training time (h:m:s): 2:19:29.

正负样本之间距离的统计

训练过程中对正负样本之间的距离做了个统计,方便确定正负样本之间阈值。Resnet50 ,DukeMTMC-reID数据集。
an
ap

mutual learning

If we use the mutual learning network like AlignedReID, will the effect be better?

No drastic difference btw similar and dissimilar images

Hi, I downloaded the resnet pretrained model weights and ran the demo. I test it with two different images of people as well as two images of the same person whose images are slightly cropped with respect to each other.
Ideally the distance btw the same images should be less while the distance btw the different images should be more. But that's not the result I am getting.
In fact, The distance btw the same person is more than the distance btw dissimilar people as seen in the pictures below.

figure_4
figure_2

Why is this happening?

About mutual learning

It seems that the code not include mutual learning when training , but i guess you should did it in paper. Would it be usable after paper be accepted ?Thanks !

which version of pytorch is used?

Hello Hao,
Would you tell me what's the version of pytorch you are using please?
Will appreciate if u can add a requirements list of this project.
Cheers,
Chao

Reranking Consume way too much memory space especially for MSMT17 dataset

Hi. I am trying to apply reranking on the MSMT17 dataset, which is one of the largest datasets for person reid. However, when I apply rerank it consumes way too much memory space and RAM gets exceeded due to many images in both query and gallery sets. I don't have extremely powerful resources with plenty of RAM space. The highest space I have right now is 25GB. Is there a way to make adjustments in the rerank.py file so that memory does not get exceeded to that much extent? Need help and guidance in this regard.

Basically, I need an algorithm for reranking that is space-efficient.

Out of GPU memory

Hello Hao,
Could tell me how many GPU memories will be used when you trained this model? I use Titan xp will cause out of memory when batch size larger than 4, but when I set batch size 4, it would meet another error when executes hard sample mining, the reason is all the 4 images from the sample identity. By the way, I trained with market1501.

Program code learning and running problems

Hello, I have two questions about your program:
First, as a beginner, I can't understand your program code very well. Can you give me some advice ?
Second, I want to use other dataset for training. What files and parameters should I modify?
Sincerely hope to get your answer, thank you!

couldn't find checkpoint file.

Im redirected to baidunet website where i can't download the file. It expects me to download a .exe which has everything in a language i don't understand.

about run demo issue

The line code of "checkpoint = torch.load("./log/market1501/alignedreid/checkpoint_ep300.pth.tar")" in demo file, how can I get this pretrain model?is here anyone help here? thanks .

error: unrecognized arguments: (--labelsmooth)

root@6e5c9e14f90a:/home/AlignedReID-master# CUDA_VISIBLE_DEVICES=1 python train_alignedreid.py -d dukemtmcreid -a resnet50 --test_distance global_local --reranking (--labelsmooth)

usage: train_alignedreid.py [-h] [--root ROOT]
[-d {market1501,market1501_partial,cuhk03,dukemtmcreid,msmt17,mars,ilidsvid,prid,dukemtmcvidreid}]
[-j WORKERS] [--height HEIGHT] [--width WIDTH]
[--split-id SPLIT_ID] [--cuhk03-labeled]
[--cuhk03-classic-split] [--use-metric-cuhk03]
[--labelsmooth] [--optim OPTIM]
[--max-epoch MAX_EPOCH]
[--start-epoch START_EPOCH]
[--train-batch TRAIN_BATCH]
[--test-batch TEST_BATCH] [--lr LR]
[--stepsize STEPSIZE] [--gamma GAMMA]
[--weight-decay WEIGHT_DECAY] [--margin MARGIN]
[--num-instances NUM_INSTANCES] [--htri-only]
[-a {resnet50,resnet101,densenet121,shufflenet,inceptionv4}]
[--print-freq PRINT_FREQ] [--seed SEED]
[--resume PATH] [--evaluate]
[--eval-step EVAL_STEP] [--start-eval START_EVAL]
[--save-dir SAVE_DIR] [--use_cpu]
[--gpu-devices GPU_DEVICES] [--reranking]
[--test_distance TEST_DISTANCE] [--unaligned]
train_alignedreid.py: error: unrecognized arguments: (--labelsmooth)
root@6e5c9e14f90a:/home/AlignedReID-master#
root@6e5c9e14f90a:/home/AlignedReID-master#
root@6e5c9e14f90a:/home/AlignedReID-master#
root@6e5c9e14f90a:/home/AlignedReID-master#
root@6e5c9e14f90a:/home/AlignedReID-master#
root@6e5c9e14f90a:/home/AlignedReID-master# CUDA_VISIBLE_DEVICES=1 python train_alignedreid.py -d dukemtmcreid -a resnet50 --test_distance global_local --reranking (--labelsmooth)

usage: train_alignedreid.py [-h] [--root ROOT]
[-d {market1501,market1501_partial,cuhk03,dukemtmcreid,msmt17,mars,ilidsvid,prid,dukemtmcvidreid}]
[-j WORKERS] [--height HEIGHT] [--width WIDTH]
[--split-id SPLIT_ID] [--cuhk03-labeled]
[--cuhk03-classic-split] [--use-metric-cuhk03]
[--labelsmooth] [--optim OPTIM]
[--max-epoch MAX_EPOCH]
[--start-epoch START_EPOCH]
[--train-batch TRAIN_BATCH]
[--test-batch TEST_BATCH] [--lr LR]
[--stepsize STEPSIZE] [--gamma GAMMA]
[--weight-decay WEIGHT_DECAY] [--margin MARGIN]
[--num-instances NUM_INSTANCES] [--htri-only]
[-a {resnet50,resnet101,densenet121,shufflenet,inceptionv4}]
[--print-freq PRINT_FREQ] [--seed SEED]
[--resume PATH] [--evaluate]
[--eval-step EVAL_STEP] [--start-eval START_EVAL]
[--save-dir SAVE_DIR] [--use_cpu]
[--gpu-devices GPU_DEVICES] [--reranking]
[--test_distance TEST_DISTANCE] [--unaligned]
train_alignedreid.py: error: unrecognized arguments: (--labelsmooth)

Not able to download pre-trained model.

Hi, I have been trying to download the pre-trained model for a while not. Firstly, I faced the issue when Baidu did not let me download the file in my Ubuntu system. I was asking me to download BaiduNetDisk software. But I could not install it on Ubuntu as only .exe file is available and not supported by wine in U Ubuntu. I also created an account in Baidu and copied the Files into my net-disk, but I was again unable to download it from there since it again asked me to download the BaiduNetDisk software.

Later I used the Baidu-dl chrome extension and J-Downloader to download your file, but I am unable to unzip it. It is asking me for a password. Please solve this issue. Thanks.

Hello? I have some doubts about my results on CUHK03

I have done some improvements on your network structure, but the results on CUHK03(detected) have surprised me, it got 84.6%mAP and 77.3% rank 1 accuracy for CUHK03. I don't believe this result so I doubt whether there is anything wrong with my command? My command is as follows: python train_alignedreid.py -d cuhk03 --use-metric-cuhk03 -a resnet50 --test_distance global_local --stepsize 300 --lr 0.0002 --save-dir ./log/try/ --train-batch 128 --eval-step 150 --max-epoch 60000 --reranking --height 384 --width 128

Pretrained Models cannot be read.

I'm trying to test out the pretrained models, however it fails to read those models. I downloaded it from Google Drive. What can I do?

I have another question too. Can I run the code on PyTorch 1.0 ?

System output and custom dataset

Hello,

I read through the AlignedReID paper and decided to give the system a try. I'm new to the person re-identification field and I wanted to check how good it performs on some personal pictures.

When dealing with object detection systems, we usually input a picture and the system returns a class. In the case of person re-identification, I'm a bit lost. So here are my questions:

  1. From what I understand, the system's input is a set of N pictures. But what is its output? Does the system calculates distances betwen all the images and yield the couple of images that has the lowest distance? From the following picture, I'd say that the output is the triplet loss, but it doesn't make sense to me ...

image

  1. Let's say that I have 1000 images from my own dataset (not used to train the network). By loading the pre-trained weights of the system, and given 1 picture of my dataset, will I be able to retrieve all the pictures of the similar person using your code?

Thanks in advance!

Grouping of persons

@michuanhaohao I have some 1000 images of 4 persons. Ideally I want that 1000 images to get converted into 4 groups i.e group of 4 person.

What code to run and what metrics should I take into account for comparison

Is there any performance (speed) results that I can refer to?

Hello, I wonder if there's an official latency measures performed, because in the paper it's not mentioned how fast is the model both by only using global metric, and by using global and local metrics.

Is there any information about that, and on which graphic card.

Thank you.

DeepSupervision for metric learning

The current training code should fail, e.g. here when we use deep mutual learning. The reason is that DeepSupervision expects a single xs and a single y value.

I was planing to submit a PR, but wanted to double check first what would be the right solution:

  1. Change the code for the aligned triplet losses to accept a single value for features by concatenating local and global features?
  2. Change the DeepSupervision class to deal with this special case?

Even though 2. seems to be much easier to do, 1. feels like the right thing to do.

P.S. Thanks for this nice implementation -- I like the style and it's very easy to read.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 0:

When I try to run the demo it produces this error.
Traceback (most recent call last): File "Alignedreid_demo.py", line 26, in <module> checkpoint = torch.load("./market1501/checkpoint_ep300.pth.tar") File "C:\Anaconda\lib\site-packages\torch\serialization.py", line 585, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Anaconda\lib\site-packages\torch\serialization.py", line 765, in _legacy_load result = unpickler.load() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 0: invalid continuation byte

I'm using -
Pytorch - 1.6.0
torchvision - 0.7.0

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.