Cysu / open-reid

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

Evaluation features #62

Open aytackanaci opened 6 years ago

aytackanaci commented 6 years ago

Hi, First thanks for this repo, it's really handy.

It looks to me this code uses the last FC layer as the feature vector for computing re-id scores. Shouldn't it use the previous layer for as the features? Am I missing something here?

Line 24 at evaluators.py doesn't provide any modules parameter outputs = extract_cnn_feature(model, imgs)

cuhk-hbsun commented 6 years ago

I am a user of open-reid. For my understanding, it's ok to use the output of previous layer as feature, but 2048-d will result much more computation than 128-d.

aytackanaci commented 6 years ago

But it's not using the 128-d layer either. It's using the final FC layer that has dimensions equal to the number labels. For example for market1501, it is 751.

cuhk-hbsun commented 6 years ago
  1. In softmax_loss.py and oim_loss.py, it uses the classification loss for training. So in trainer, the output of fc is the id number; In evaluator, the output of fc layer can be treated as feature vector(it makes no difference that the dimension is 128 or 751)
  2. In triplet_loss.py, the output of fc layer is 128-d, which is the size of feature vector used in train and test.
Tianyu97 commented 5 years ago

I am also confused with this problem. Why does it use the final FC layer output as feature vector? In this way, the dimension of the feature vector is changing as the dataset. I think it should use the final FC layer input for feature vector. Have u dealt with it?