Person-reID-Evaluation
Person-reID-Evaluation copied to clipboard
No such file or directory: '3368_ResNet-50.mat'
Hi Mr Cherry,
I run the test.py, and the code asks me to provide 3368_ResNet-50.mat, where can I find that, or how can I generate That~? Thanks~!
First of all, thank you for your great interest in our work.
3368_ResNet-50.mat is the distance matrix extracted on Market -1501 with the following data format:
mat:{'distmat':distmat,'gallery_label':gallery_label,'gallery_cam':gallery_cam,'query_label':query_label,'query_cam':query_cam} # Save to Mat for testing
You can use other methods to extract the data in this format according to your needs.
Sorry for the inconvenience, our evaluation code may not be well-written, but we have been working on optimizing the code to make it easier for users to use for evaluation.
For your testing convenience, I have shared 3368_ResNet-50.mat data. https://ws28.cn/f/431f9cku3gs
Hi Mr. Cherry, Thanks for your help! I will test that and I have another question 100_ResNet-50.mat for open-set, how can I generate that~?
You're welcome.
To simulate the open-set re-ID setting, we randomly select 100 images from other datasets as new queries.
100_ResNet-50.mat is obtained like this.
100_ResNet-50.mat has the same format as 3368_ResNet-50.mat:
mat:{'distmat':distmat,'gallery_label':gallery_label,'gallery_cam':gallery_cam,'query_label':query_label,'query_cam':query_cam}
For your testing convenience, I also have shared 100_ResNet-50.mat data.
https://ws28.cn/f/434qc11ssrs
Hi Mr. Cherry, Thanks for your help and I use a distance matrix math to get "distmat" code is in here~
def euclidean_squared_distance(input1, input2): """Computes euclidean squared distance. Args: input1 (torch.Tensor): 2-D feature matrix. input2 (torch.Tensor): 2-D feature matrix. Returns: torch.Tensor: distance matrix. """ m, n = input1.size(0), input2.size(0) mat1 = torch.pow(input1, 2).sum(dim=1, keepdim=True).expand(m, n) mat2 = torch.pow(input2, 2).sum(dim=1, keepdim=True).expand(n, m).t() distmat = mat1 + mat2 distmat.addmm_(1, -2, input1, input2.t()) return distmat
I use old evaluation get 0.88 mAp, but use your evaluation just get 0.080 mAp, Is my euclidean_squared_distance is wrong~? May you provide your way to do that~?
You don't need to calculate the distance. This "distmat" is the European distance that has been calculated and normalized and can be brought directly to the test.
If you test it in your own way, the final distance should be normalized.
Attention:To facilitate the division of thresholds, distances must be normalized to the range of [0, 1].
oh~ sorry~ I forget to say, use your .mat data all is good,
but now I want to use your evaluation to work on my dataset and my re-id model, I want to evaluation my mode, So I get my data's feature and want to calculate the distance ~~
I'm sorry for the confusion in your work.
Note that you get the features directly from your method, then calculate the distances using the original method, and finally, it is important to remember that there is an important step that must normalize the distances you calculate to the [0,1] range.
After that, you can test your method directly!
oh!!!! that means I get my distmat, just need to go through distmat = distmat / distmat.max() ok~~! I will try that~! Thanks for your help again~!
You're welcome, we're using Min-Max Normalization. such as distance = (distance - distance.min()) / (distance.max() - distance.min())
If you encounter any follow-up questions, feel free to ask them. Thank you for your support of our work!
Hi Mr.Cherry Thanks for a Great work ,
Could you provide a link of test data which you mention above before again, because it not working for me.
"For your testing convenience, I also have shared 100_ResNet-50.mat data. https://ws28.cn/f/434qc11ssrs"
Thank you for your attention. I've been busy recently, so I'll organize and share it when I'm done.