Comments (6)
你好,这是测试时候用的。
测试时候把所有query图片(num_query张图片)的特征提好,所有gallery图片(num_gallery张图片)的特征也提好,这样就可以计算query-gallery之间的一个距离矩阵q_g_dist
,维度为(num_query, num_gallery)。这样的距离矩阵可以直接调用CMC和mAP函数算分数。
想要re-ranking,那还得计算query-query之间的一个距离矩阵q_q_dist
,维度为(num_query, num_query),以及gallery-gallery之间的一个距离矩阵g_g_dist
,维度为(num_gallery, num_gallery)。这样的几个输入就可以进行re-ranking了。Re-Ranking的结果是一个新的query-gallery距离矩阵q_g_dist
,这个时候再调用CMC和mAP函数算分数就行。
from alignedreid-re-production-pytorch.
thanks , I have another problems
- what is the local distance (NxN),
paper define the shortest path from (1,1) to (H,H), so it is calculating HxH times to get the S (total
distance)? or it is calculating other times ? why?
2.the local distance and global distance , how to use hard triplet loss?
the global distance (NxN) is just to pick up the hard sample?
if pick up the hard sample of global distance ,then find the corresponding local distance?
after, adding the local distance and global distance to do triplet loss?
3.how is hard sample mining number ?
- how to calculate local feature 128x7 to local distance (NxN)
is it expand it (128x7 >>> 896 )and use euclidean to get the local distance?
thanks again
from alignedreid-re-production-pytorch.
- Shortest distance is the accumulation of part-to-part distances, so it should calculate a HxH distance matrix and then accumulate the values along the shortest path.
- The global triplet loss is a constraint on global feature, local triplet loss on body part features. TriHard (BatchHard) triplet loss requires mining hard positive and negative. The hard triplets for global triplet loss (Here these triplets/samples are denoted by S_global) is searched from the NxN (N is batch size) global distance matrix Dist_global. The hard triplets/samples for local triplet loss can be S_global or searched from the NxN (N is batch size) local distance matrix Dist_local. In this implementation you can try these two types of triplets for local distance with the script argument
local_dist_own_hard_sample
.local_dist_own_hard_sample=False
means local loss using hard samples S_global, which is the case the authors report the scores in the paper. - Number of triplets is the same as batch size.
- Here
H=7
, so for a pair of images, we first calculate the 7x7 distance matrix between parts of two images, then we calculate shortest distance between these two images from this 7x7 matrix.
from alignedreid-re-production-pytorch.
"" In the paper ,the value is ""
in the distance.py
1.how about m1, m2, n ?
def compute_dist(array1, array2, type='euclidean'):
Args:
array1: numpy array with shape [m1, n]
array2: numpy array with shape [m2, n]
A : [7,128]
2.how about m ,n ?
def shortest_dist(dist_mat):
Args:
dist_mat: numpy array, available shape
1) [m, n]
2) [m, n, N], N is batch size
A : [7,7,N is batch size]
3.how about m , n ,d?
def meta_local_dist(x, y):
Args:
x: numpy array, with shape [m, d]
y: numpy array, with shape [n, d]
A: [7,128]
4.how about M,m,d ,N,n?
def parallel_local_dist(x, y):
Args:
x: numpy array, with shape [M, m, d]
y: numpy array, with shape [N, n, d]
A : [batch size, 7, 128]
A: is my answer , my answer is right?
from alignedreid-re-production-pytorch.
Hi~
I use the distance.py
the function " def shortest_dist(dist_mat): "
is it return the feature distance, right ? ( it is like doing global feature and comoute the distance of two person images)
then directly add local distance to global distance , to do triplet loss, right?
if , it is right , I get the local distance , all vale is 10.XXXX , (same value) is it error
2.the local pooling setp
step1: use resnet50 to exact the feature to get the feature size [batch,7,7,2048]
step2: use local pooling to get the feature size [batch,7,1,2048]
then : use 1x1 conv to get the feature size [batch,7,1,128]
right?
answer can English or 中文 , thanks
from alignedreid-re-production-pytorch.
Closed because I could not explain well.
from alignedreid-re-production-pytorch.
Related Issues (20)
- top-k结果可视化 HOT 2
- CUHK03和DUKE上的识别率 HOT 1
- How to inference my own test set
- Keys not found in source state_dict HOT 1
- Global Feature Extraction HOT 1
- Local feature dimensions
- About performance on market1501 for global learning and mutual learning
- Is it generalised
- TypeError: __init__() got an unexpected keyword argument 'log_dir'
- AssertionError HOT 3
- 请问论文中的Resnet50-Xception结构是不是没有实现? HOT 1
- 论文复现的参数问题
- how to use the test data to draw picture just like roc missrate cmc?
- How to use without GPU? HOT 2
- could you send me a partitions.pkl about market1501 HOT 1
- 为啥用你提供的weight测得market也只有88.78的top1呢 HOT 1
- how to infer some images or videos
- RuntimeError: cannot perform reduction function min on tensor with no elements because the operation does not have an identity
- Poor performnace when reproducing evaluation on market1501 HOT 2
- would you help me to fix this error?
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-re-production-pytorch.