Comments (3)
@michuanhaohao Thanks for your great work.
But I had a suggestion that when compute the shortest distance will cost O(MN) extra space, where M, N is the size of the dist_mat. We can reduce the extra space from O(MN) to O(N). I implemented it as following:
def shortest_path(dist_mat):
"""
Args:
dist_mat: pytorch Variable, available shape:
1) [m, n]
2) [m, n, N], N is batch size
3) [m, n, *], * can be arbitrary additional dimensions
Returns:
dist: three cases corresponding to `dist_mat`:
1) scalar
2) pytorch Tensor, with shape [N]
3) pytorch Tensor, with shape [*]
"""
if dist_mat.dim() == 3:
M, N, B = dist_mat.size()
helper = torch.zeros(N, B)
elif dist_mat.dim() == 2:
M, N = dist.size()
helper = torch.zeros(N)
for i in range(M):
for j in range(N):
if i == 0 and j == 0:
helper[j] = dist_mat[i][j]
elif i == 0:
helper[j] = helper[j-1] + dist_mat[i][j]
elif j == 0:
helper[j] = helper[j] + dist_mat[i][j]
else:
helper[j] = torch.min(helper[j-1], helper[j]) + dist_mat[i][j]
return helper[-1]
I think we can even do better to reduce the extra space to O(min(N, M))
from alignedreid.
Thank you for you job! If results can be reproduced by your new implementation, you can make a pull request and become a contributor of this project.
from alignedreid.
OK, but I was a little busy with other things recently, I'll make a pull request if I can reimplement the result.
from alignedreid.
Related Issues (20)
- assert num_valid_q > 0, "Error: all query identities do not appear in gallery" HOT 2
- Threshold to say that it's the same person HOT 5
- what globalpooling did you use HOT 2
- how to use the test data to draw a missrate picture? HOT 1
- how to use center loss to train?
- when i train use market1501 i have face some problems HOT 1
- max identities, max images per identity required for training and min identities, min images per identity required for training
- multi-gpu training
- Training on custom dataset tutorials
- Some wrong with the code? HOT 2
- Questions about "mutual learning" in the process of reproducing the paper
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 0: HOT 3
- How to calculate the aligned distance and original distance from the distance map?
- poor metrics when training on market1501 HOT 2
- Is there any performance (speed) results that I can refer to?
- Reranking Consume way too much memory space especially for MSMT17 dataset
- about run demo issue HOT 4
- The actual performance is far from the report HOT 3
- If the person in the detection bbox is incomplete, can the features be aligned?
- Why is local feature (lf) different in training phase and test phase?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alignedreid.