GithubHelp home page GithubHelp logo

jackie840129 / ste-nvan Goto Github PK

View Code? Open in Web Editor NEW
140.0 140.0 22.0 9.67 MB

Spatially and Temporally Efficient Non-local Attention Network for Video-based Person Re-Identification (BMVC 2019)

Home Page: https://bmvc2019.org/wp-content/uploads/papers/0398-paper.pdf

License: MIT License

Python 95.81% Shell 4.19%
dukemtmc-video-reid efficient-algorithm mars-dataset person-re-identification python3 pytorch-implementation video-base-re-id

ste-nvan's People

Contributors

jackie840129 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

ste-nvan's Issues

Duke training script

Hi there, are the hyperparams for Duke the same of MARS?
Should changing the _database paths in run_baseline.py enough to get the same results for the baseline (92.7 mAP) ?

随机种子问题

你好,请问一下,我看到train_baseline.py中并没有设置随机种子,请问是如何保证每次运行,数据集采样时随机出的结果都是一样的呢?十分感谢。

the problem is here

Start dataloader...
End dataloader...

Epoch 0
0%| | 0/78 [00:00<?, ?it/s]Traceback (most recent call last):
File "train_baseline.py", line 148, in
trip_loss = criterion_triplet(pool_feat,labels,dis_func='eu')
File "/home/lq/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/lq/code/person-ReID/STE-NVAN/util/loss.py", line 32, in forward
negative_mask = same_id_mask ^ 1
RuntimeError: result type Long can't be cast to the desired output type Bool

pytorch 1.5
cuda 10.0

Evaluate on Duke-Video datasets

i use this code to train model on Duke-video dataset,then i change the path in run_evaluate.sh and run it ,but it has something wrong.
Traceback (most recent call last):
File "evaluate.py", line 77, in
network.load_state_dict(state,strict=True)
File "/home/cczulab515/anaconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
size mismatch for module.classifier.weight: copying a param with shape torch.Size([702, 2048]) from checkpoint, the shape in current model is torch.Size([625, 2048]).

Then i chang the line, network.load_state_dict(state,strict=False),but this problem still exits。Please tell me why. THANK YOU!

About trained model.

Hi~thanks for your code first. Can you offer trained model on DukeMTMC-VID dataset?

Counfusion with position of non-local block

Hi, Thank you for your wonderful job!
I am studying non local block aiming to apply this on another network and your work is a good inspiration. However, I found the position of non-local block in your ResNet_Video_nonlocal is different from the original paper and its repos( repo1 & repo2 ).
They put the non-local block in front of residual block, contrary to you. I consider non-local as a module to connect pixels in order to expand the receptive field of convolution layer, so I think it affect the convolution layer behind it.
What's your opinon about its position and why it work?
Looking forward to your reply!

how to get more rank results?

Hi, thank you for releasing the code, it's helpful. The code only calculates the rank-1, I wonder how to modify the code so as to get more rank results, such as rank-5 rank-10 rank-20.
Hoping for your generous answer
Best regards!

counting FLOPs

Hi, Jackie:
Thanks for sharing your great work! I use this tool to count the FLOPs of the network, but the result is different from those reported by your paper. Would you mind telling me which tool do you use to get the FLOPs results in your paper?

another problem is here.

Start dataloader...
End dataloader...
Inference: 100%|██████████████████████████████████████████████████| 130/130 [00:50<00:00, 2.59it/s]
Traceback (most recent call last):
File "evaluate.py", line 86, in
cmc, map = validation(network, test_dataloader, args)
File "evaluate.py", line 58, in validation
gallery_cams, dataloader.dataset.query_idx, 10000)
File "/home/lq/code/person-ReID/STE-NVAN/util/cmc.py", line 20, in Video_Cmc
q_data = {k:v[q_idx] for k, v in data.items()}
File "/home/lq/code/person-ReID/STE-NVAN/util/cmc.py", line 20, in
q_data = {k:v[q_idx] for k, v in data.items()}
IndexError: index 8298 is out of bounds for axis 0 with size 8298
run_evaluate.sh: 12: run_evaluate.sh: --batch_size: not found

I have another problem.

training on Two GPUs, get the results cmc=87.5, map=33.1. ???

Hi, thanks for your code. But when i train the baseline by myself, on two GPUs, class_per_bacth(16), track_per_class(3), S(6), other parameters same with you paper,. We get the results cmc=87.5, map=33.1. I can not understand why the mAP is so low. Looking forward your replay, Thanks.

Some questions in reproducing the result of NVAN network

Dear Jackie:
Thanks for your generous in sharing your fantastic codes.
I have some questions in reproducing the results of NVAN network. I just follows the training instruction:
python3 evaluate.py --test_txt $TEST_TXT --test_info $TEST_INFO --query_info $QUERY_INFO \ --batch_size 64 --model_type 'resnet50_NL' --num_workers 8 --S 8 --latent_dim 2048 \ --temporal Done --non_layers 0 2 3 0 --load_ckpt $LOAD_CKPT \
And for other superparameters, I just follows the default settings in parser.py.
I run the codes on 4 * 1080Ti, then I only get the result:
CMC: 0.8672, mAP : 0.7946
Which is far from the result reported in the paper.
Is there something wrong on my operations? I spot that in the validation of NVAN, you just select 8 frames from each video sequence, the other frames are just abandon, is that the main reason on the results decreasing?
Hoping for your generous answer~
Best regards!

DukeMTMC-videoReID dataset preprocess

In create_DukeV_database.py line 64-67

        for track in tracks:
            if [id,track] == query_info[0]:
                track_idx.append(idx)
                del query_info[0]

I'm comfused about the operation...

About Trip loss

My trp loss is always be 0.000

like this in loss.txt:
epoch 20, rank-1 0.634021 , mAP 0.407872
Track ID loss : ['3.6117', '3.6115', '3.6115', '3.6114', '3.6113', '3.6112', '3.6112', '3.6111', '3.6111', '3.6111']
Trip Loss : ['0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000']
best
epoch 30, rank-1 0.632302 , mAP 0.380513
Track ID loss : ['3.6111', '3.6111', '3.6111', '3.6111', '3.6111', '3.6111', '3.6111', '3.6110', '3.6110', '3.6110']
Trip Loss : ['0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000']

I can't solve that and I'd like to know why

runtimeerror:Expected object of scalar type Bool but got scalar type Byte for argument #2 'other' in call to _th_xor

When run to the follow codes:

if mode == 'id':
if id is None:
raise RuntimeError('foward is in id mode, please input id!')
else:
identity_mask = torch.eye(feat.size(0)).byte()
identity_mask = identity_mask.cuda() if id.is_cuda else identity_mask
same_id_mask = torch.eq(id.unsqueeze(1), id.unsqueeze(0))
negative_mask = same_id_mask ^ 1
positive_mask = same_id_mask ^ identity_mask

then this error appear:Expected object of scalar type Bool but got scalar type Byte for argument #2 'other' in call to _th_xor

Training Batch Setting Issue

In run_NL.sh script, default batch setting is "--class_per_batch 8 --track_per_class 4 --S 8". When I used single GPU 1080Ti (11GB) to train model with default setting, I encountered GPU out of memory problem.
(1) If I set class_per_batch or S smaller, the accuracy will be decreased a lot?
(2) It seems that 1080Ti cannot support default setting training task. Which GPU model did you use?

DukeMTMC-videoreid dataset

Dear author,
thank you very much for the code you provided. Now I want to run the dukemtmc-videoreid dataset, but I find it impossible to download the dataset. Can you send me a copy of this dataset?Thank you very much。[email protected]

Cannot reproduce the ideal accuracy of NVAN

Hi,
I reproduce the training procedure and get the results:

baseline: R1=88.54%(+1.12%), mAP=80.71% (2 GPUs)
NVAN: R1=89.55%(-0.45%), mAP=83.05% (3GPUs)
NVAN: R1=89.60%(-0.40%), mAP=82.31% (2GPUs)
STE-NVAN: R1=88.08%(-0.61%), mAO=79.83%(2GPUs)

The training setting and pytorch version is exactly the same as given, the only difference might be that i use several GPUs to train.
The baseline is 1.12% higher than you reported, but NVAN and STE-NVAN is lower. Do you have any ideas on increase NVAN accuracy?

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.