Person-reID-Evaluation icon indicating copy to clipboard operation
Person-reID-Evaluation copied to clipboard

No such file or directory: '3368_ResNet-50.mat'

Open kobewangSky opened this issue 4 years ago • 13 comments

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~!

kobewangSky avatar Nov 27 '20 00:11 kobewangSky

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.

YuanXinCherry avatar Nov 27 '20 02:11 YuanXinCherry

For your testing convenience, I have shared 3368_ResNet-50.mat data. https://ws28.cn/f/431f9cku3gs

YuanXinCherry avatar Nov 27 '20 02:11 YuanXinCherry

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~?

kobewangSky avatar Nov 27 '20 09:11 kobewangSky

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

YuanXinCherry avatar Nov 27 '20 10:11 YuanXinCherry

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

code

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~?

kobewangSky avatar Dec 01 '20 02:12 kobewangSky

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.

YuanXinCherry avatar Dec 01 '20 02:12 YuanXinCherry

If you test it in your own way, the final distance should be normalized.

YuanXinCherry avatar Dec 01 '20 02:12 YuanXinCherry

Attention:To facilitate the division of thresholds, distances must be normalized to the range of [0, 1].

YuanXinCherry avatar Dec 01 '20 02:12 YuanXinCherry

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 ~~

kobewangSky avatar Dec 01 '20 03:12 kobewangSky

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!

YuanXinCherry avatar Dec 01 '20 03:12 YuanXinCherry

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~!

kobewangSky avatar Dec 01 '20 03:12 kobewangSky

You're welcome, we're using Min-Max Normalization. such as distance = (distance - distance.min()) / (distance.max() - distance.min())

YuanXinCherry avatar Dec 01 '20 04:12 YuanXinCherry

If you encounter any follow-up questions, feel free to ask them. Thank you for your support of our work!

YuanXinCherry avatar Dec 01 '20 04:12 YuanXinCherry

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"

GaberHassan avatar Dec 26 '23 22:12 GaberHassan

Thank you for your attention. I've been busy recently, so I'll organize and share it when I'm done.

YuanXinCherry avatar Dec 27 '23 10:12 YuanXinCherry