Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for triplet loss #35

Open
ssbilakeri opened this issue Dec 7, 2020 · 20 comments
Open

for triplet loss #35

ssbilakeri opened this issue Dec 7, 2020 · 20 comments

Comments

@ssbilakeri
Copy link

is the python 2.7 and pytorch 1.0.0 are not supportive for tripletloss ??

@huanghoujing
Copy link
Owner

Hi, python 2.7 and pytorch 1.0.0 are absolutely ok to run this code.

By the way, do you run the program in Linux? I ran it in Ubuntu.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 13, 2020 via email

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 13, 2020 via email

@huanghoujing
Copy link
Owner

Hi, thank you for your feedback.

To run triplet loss, we have to

  1. Use PK sampling for batch construction
  2. Increase training epochs

I provide a setting file paper_configs/PAP_S_PS_Triplet_Loss_Market1501.txt, and a script script/exp/train_PAP_S_PS_Triplet_Loss_Market1501.sh, to train with both PS loss and triplet loss on Market1501.

Besides, I also fixed a mistake in part index when feeding feature to triplet loss. You can find the detail in this commit.

Now, you can run the script by

bash script/exp/train_PAP_S_PS_Triplet_Loss_Market1501.sh

The result I obtained is

M -> M      [mAP:  86.0%], [cmc1:  95.0%], [cmc5:  98.0%], [cmc10:  98.8%]
M -> C      [mAP:  11.0%], [cmc1:  12.1%], [cmc5:  24.1%], [cmc10:  31.6%]
M -> D      [mAP:  29.2%], [cmc1:  46.7%], [cmc5:  63.2%], [cmc10:  69.5%]

I hope it helps.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 17, 2020 via email

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 20, 2020 via email

@huanghoujing
Copy link
Owner

Hi ssbilakeri, I did not use triplet loss in the paper.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 26, 2020 via email

@huanghoujing
Copy link
Owner

Hi, ssbilakeri, for which Table of the paper do you need the re-ranking score?

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 27, 2020 via email

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 28, 2020 via email

@huanghoujing
Copy link
Owner

It seems that the trained model weight is not loaded.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 28, 2020 via email

@huanghoujing
Copy link
Owner

Hi, ssbilakeri. I have tested the re-ranking results for PAP_S_PS models (the script to run this is script/exp/test_PAP_S_PS_reranking.sh).

The original scores, as well as the re-ranking scores are as follows.

mAP Rank-1 Rank-5 Rank-10
M -> M 85.6 94.6 98.2 99.0
ReRank M -> M 93.5 95.7 97.5 98.3
M -> C 12.8 14.2 28.1 35.4
ReRank M -> C 19.4 17.6 28.1 35.9
M -> D 31.7 51.4 67.2 72.5
ReRank M -> D 47.6 57.6 67.9 73.4
C -> M 33.3 59.4 73.7 78.7
ReRank C -> M 47.3 64.0 72.0 76.1
C -> C 66.7 72.5 86.1 91.3
ReRank C -> C 80.8 80.1 86.9 92.2
C -> D 22.0 39.3 54.4 60.3
ReRank C -> D 36.1 47.7 57.5 61.8
D -> M 32.8 61.7 77.2 83.0
ReRank D -> M 48.0 65.6 74.1 78.8
D -> C 9.6 11.4 22.7 28.9
ReRank D -> C 15.4 14.4 22.1 28.7
D -> D 74.6 87.5 93.4 95.3
ReRank D -> D 85.5 89.7 93.6 95.2

I update the code, so that it can test with re-ranking now. Please refer to this commit. You can run it for yourself, by setting cfg.eval.rerank to True in package/config/default.py.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 29, 2020 via email

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 30, 2020 via email

@huanghoujing
Copy link
Owner

Hi, ssbilakeri. That's normal. Because segmentation does not learn anything about person re-identification. You have to train with at least one kind of re-identification loss, i.e. id loss or triplet loss.

@ssbilakeri
Copy link
Author

ssbilakeri commented Dec 30, 2020 via email

@ssbilakeri
Copy link
Author

ssbilakeri commented Jan 6, 2021 via email

@huanghoujing
Copy link
Owner

Hi, package/data/kpt_to_pap_mask.py is the code that partitions body into regions using keypoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants