SHI-Labs / Self-Similarity-Grouping

Self-similarity Grouping: A Simple Unsupervised Cross Domain Adaptation Approach for Person Re-identification (ICCV 2019, Oral)
187 stars 43 forks source link

why reranking so time-cosuming? #4

Open luissen opened 5 years ago

luissen commented 5 years ago

When I run the selftraining.py, it is very time-consuming to calculate the source distance and original distance, and why?

xiaobaoli15 commented 4 years ago

I have also the same question. The reranking requires high time cost, about 20 minutes each reranking.

yxgeee commented 4 years ago

Hi all,

I have accelerated the reranking process, please refer to def compute_jaccard_dist(...) in MMT/mmt/utils/rerank.py. The function is plug-and-play in this SSG repo, i.e. input_feature, input_feature_source in SSG/reid/rerank.py is the same as target_features, source_features in MMT/mmt/utils/rerank.py. Note that the difference is that target_features, source_features are pytorch tensors while input_feature, input_feature_source are numpy matrix.

For time cost, our MMT/mmt/utils/rerank.py requires around 200s on CPU or 60s on GPU (set use_gpu=True).