deep-person-reid icon indicating copy to clipboard operation
deep-person-reid copied to clipboard

use cosine_distance or euclidean_squared_distance will get the similar evaluation results?

Open LIUHAO121 opened this issue 2 years ago • 2 comments

use cosine_distance or euclidean_squared_distance will get the similar evaluation results?

LIUHAO121 avatar Nov 17 '22 06:11 LIUHAO121

No, cosine similarity and euclidean_squared_distance do not give the same evaluation results, why??

After the similarity scores /distances have been calculated for query and test/ gallery images, they are sorted in decreasing order, hence the perfect matches are the top ones. Now as there will be slight differences in the distances calculated by either distance metric, the CMC score and Ranks are different.

While evaluating with torchreid, set dist_metric='euclidean' or dist_metric='cosine' in

engine.run(
    save_dir='log/resnet50',
    max_epoch=60,
    eval_freq=10,
    print_freq=10,
    test_only=False,
    fixbase_epoch=5,
    open_layers='classifier'
)

and you will get to know the difference.

Mohit-robo avatar Nov 27 '22 15:11 Mohit-robo

https://github.com/KaiyangZhou/deep-person-reid/issues/502

mikel-brostrom avatar Dec 22 '22 13:12 mikel-brostrom