GithubHelp home page GithubHelp logo

Comments (6)

huanghoujing avatar huanghoujing commented on June 21, 2024

你好,这是测试时候用的。

测试时候把所有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.

Phoebe-star avatar Phoebe-star commented on June 21, 2024

thanks , I have another problems

  1. 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?

image

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 ?

  1. 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.

huanghoujing avatar huanghoujing commented on June 21, 2024
  1. 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.
  2. 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.
  3. Number of triplets is the same as batch size.
  4. 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.

Phoebe-star avatar Phoebe-star commented on June 21, 2024

"" 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.

Phoebe-star avatar Phoebe-star commented on June 21, 2024

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.

huanghoujing avatar huanghoujing commented on June 21, 2024

Closed because I could not explain well.

from alignedreid-re-production-pytorch.

Related Issues (20)

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.