VisualComputingInstitute / triplet-reid

Code for reproducing the results of our "In Defense of the Triplet Loss for Person Re-Identification" paper.
https://arxiv.org/abs/1703.07737
MIT License
765 stars 216 forks source link

Not working when testing on our own image dataset! [without training] #41

Open ashishmokalkar opened 6 years ago

ashishmokalkar commented 6 years ago

Hello, I used the pre-trained model given in this repository on my own image dataset to calculate embeddings and then calculated co-sine similarity between the embeddings. Testing on same person with different view, postures, I am getting very less co-sine similarity. But, testing on person with different view of CUHK dataset, the co-sine similarity is very high.

NOTE:

Pandoro commented 6 years ago

Hello @ashishmokalkar ,

we have never really tested the generalization, but I know it can generalize to other data pretty well as long as the data has similar "features". Is the camera quality similar, are the crops the same, do the poses look similar as those in Market-1501, etc.

However, even ignoring the dataset bias, computing the cosine similarity using embeddings from our model doesn't make any sense. It was trained using an euclidean distance and while that is equivalent to the cosine similarity when the embeddings are normalized, this is not the case for our embeddings.

So don't use the cosine similarity, use a euclidean distance instead and even if that doesn't work, there is no guarantee of generalization. CNNs are very good at overfitting certain details in data which might not be present in other datasets. Without seeing your data I don't have any feeling for how good or how bad this is supposed to work.