michuanhaohao / alignedreid Goto Github PK
View Code? Open in Web Editor NEWAlignedreid++: Dynamically Matching Local Information for Person Re-Identification.
License: MIT License
Alignedreid++: Dynamically Matching Local Information for Person Re-Identification.
License: MIT License
Hello. What pooling did you use at the end of resnet? Did you use globalaveragepooling or globalmaxpooling?
assert num_valid_q > 0, "Error: all query identities do not appear in gallery"
I know that, since I have same camera ids to all images, all gets discarded. Can you please tell how to eliminate this condition
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 )
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 !
Thanks for sharing the code. I want to ask how to calculate the aligned distance and original distance from the distance map. In the Alignedreid_demo.py, you only give the code for calculating the distance map.
Hi. Is there a version of your code keras?
If you do not have the whole keras code,
can you supply the part of HorizontalMaxPool2d with keras?
@michuanhaohao Can you tell me the threshold value i.e aligned distance to set, to say thats its same person or different person
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)
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
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!
If we use the mutual learning network like AlignedReID, will the effect be better?
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.
@ChrisBellew @michuanhaohao Is there any option to do multi-gpu training
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.
Why is this happening?
Hi thank you for your work, i find the local feat in Alignedreid_demo.py. But when used for inference the global feat is good enough, how to compute the global feat?
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.
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 .
I used densenet121 network training, but I ran Alignedreid_demo.py incorrectly. Tip: IndexError: list index out of range.
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.
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
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:
Thanks in advance!
Hello, during the process of reproducing this paper, I found that the "mutual learning" module was not used in your code. What should I do to achieve higher accuracy? Or am I missing something in the code?
@michuanhaohao 您好,训练生成的模型文件怎么使用呀?生成了best_model.pth.tar 解压也出错,直接调用也不行。是不是我训练的方式没对?还是什么呀?
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.
@ChrisBellew @michuanhaohao Can you please tell me how to train and validate on custom dataset.
Can u please explain the difference between the above terms.
@ChrisBellew @michuanhaohao What is the best metric to go with for testing for just two images
RuntimeError: cublas runtime error : the GPU program failed to execute at /opt/conda/conda-bld/pytorch_1525909934016/work/aten/src/THC/THCBlas.cu:249
@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
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:
features
by concatenating local and global features?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.
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.
==> 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.
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?
Although i am in china , it is inconvenient to use baidu yun on linux with big file .
Even on windows it has very very low speed to down .
Thanks !
I am wondering if you can share the hyper-parameters for resnet50 training. I have trained a model but it is 2% worse than yours.
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 ?
@michuanhaohao I have images from mulitple camera, but I don't have the camera information.
Can I train with out specifying camera id's.
Thanks
Hi, can you share the paper : Alignedreid++: Dynamically Matching Local Information for Person Re-Identification
i want to know what different between it and Alignedreid. thx!
Given 2 images how to find whether they are similar or not?
What is the difference between normalised distance and global distance.
Should we use aligned distance or original distance to compare two images
Firstly, in Alignedreid_demo.py Line 21, we don't import os while using the following code
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
python train_alignedreid.py -d market1501 -a resnet50 --test_distance global_local --reranking --labelsmooth
, finally I got the follow result:==> 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?
@ChrisBellew @michuanhaohao whats the max and min number of identities we can give for training and whats the max and min number of images we can give per identity for training.
Is there any upper limit or lower limit which could affect training
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.