Closed zhenght17 closed 5 years ago
Hi there!
If you actually look at how the K images are sampled for a PID in the code, you will see that we always select K images, repeating them several times if needed. This is the simplest way of implementing it, while being a little wasteful since it means we are computing redundant information if less than K images are available for one PID. However, this ensures that every PID gets the same weight in the resulting loss, regardless of how many images are available.
We did not run a significant amount of experiments with different sampling strategies when it comes to this specific detail. It is likely that minor improvements could be made here, but we did not focus on this aspect.
I'll close this for now, since I think your original question is answered, if not feel free to follow up.
Hello, First, thanks a lot for sharing the code! The project about re-id really interests me. I was doing the training process following your steps with dataset(Market1501) and loss(triplet hard). After initialing the resnet_v1_50.cpkt checkpoint, the results seem to be pretty good, but I just have a small question. What would happen if a pid has less than batch_k images? For example, in "data/market1501_train.csv', line 363-365, the pid '0059' has only 3 fids in the training set. 0059,bounding_box_train/0059_c1s1_011176_01.jpg 0059,bounding_box_train/0059_c2s1_010476_01.jpg 0059,bounding_box_train/0059_c4s1_011076_02.jpg Since I used your settings(batch_p = 18, batch_k = 4), the batch_size is 72, if I use this pid in my training process, then in this batch, there would be > 18 pids, am I right? So I wonder if this is correct, or if you have codes that can avoid this kind of situation and I did not see? Looking forward to your reply~ Best wishes!