Cysu / open-reid

Open source person re-identification library in python
https://cysu.github.io/open-reid/
MIT License
1.34k stars 349 forks source link

how to compute CMC and rank? #22

Closed Phoebe-star closed 6 years ago

Phoebe-star commented 6 years ago

how to compute CMC and rank?

Cysu commented 6 years ago

Suppose you have 3 gallery samples with ID 0,1,1 and 4 query samples with ID 0,0,1,1, then you need to

Compute 3x4 pairwise distance matrix D, where D[i, j] = distance between gallery-i and query-j Create a query ID list qids = [0,0,1,1] Create a gallery ID list gids = [0,1,1] Then you can call reid.evaluation_metrics.cmc(D, qids, gids) to get CMC.

Phoebe-star commented 6 years ago

1.why is ID 0,1,1 ? it mean the second and the third are the same person ?
2.so ID 0,1,1 don't have like cuhk03 ID 0000 0001 0002 0003 .....(many ID) ?

Cysu commented 6 years ago
  1. Yeah, it's just an example. The second and the third belong to the same person identity.
  2. It's just an example to help you understand.
Phoebe-star commented 6 years ago

cuhk03 is use val to compute CMC right?

Cysu commented 6 years ago

I am not sure what you refer to. All the results here in open reid are reported on the test set.

Phoebe-star commented 6 years ago

hi 1. what are the gallery , query and probe ?

  1. if the value of distance matrix is large = the pairwise is not the same person the value of distance matrix is small= the pairwise is the same person right?
Linranran commented 6 years ago

@Phoebe-star query is the same means as probe,you have a query(probe)image and then you should find the image that have the same id in the gallery. and we have a rank list of the gallery images ,CMC is caculated based on the list

Cysu commented 6 years ago

@Linranran Thank you very much for the explanation!

@Phoebe-star Yes, large distance value implies the pair is probably not the same person, and vice versa.

Linranran commented 6 years ago

@Cysu its my pleasure,haha

Phoebe-star commented 6 years ago

I got it , thanks you ^^

Phoebe-star commented 6 years ago

I have another problem how to select cuhk03 dataset validation to compute CMC ??

every time , I got a different cmc value

liangbh6 commented 6 years ago

I have another question in computing CMC and mAP of cuhk03. Open reid gived me the result that rank1 was greater than mAP, but When I read some papers such as “SVDNet for Pedestrian Retrieval”, they showed the results that mAP was greater than rank1. I'm comfused all the time even after I read Evaluation Metrics in docs of open reid. Could anyone help me figure out that or just point me to some helpful website?

Phoebe-star commented 6 years ago

what is your cmc code ?