zlai0 / MAST

MAST: A Memory-Augmented Self-supervised Tracker (CVPR 2020)
https://zlai0.github.io/MAST/
273 stars 32 forks source link

wrong usage of offset0 #17

Closed InnovArul closed 3 years ago

InnovArul commented 3 years ago

Hi,

I could see that the variable offset0 is used in this line: https://github.com/zlai0/MAST/blob/a57b043ca597b9b7ef6842b1fa965c9f1ee71526/models/colorizer.py#L101

However, it is calculated from the last for loop over nsearch. i.e., it won't contain the correct offset for each searched images. Here: https://github.com/zlai0/MAST/blob/a57b043ca597b9b7ef6842b1fa965c9f1ee71526/models/colorizer.py#L70-L80

Ideally, im_col0 could have been collected inside the same for loop for every image in nsearch to reflect correct offset for each image. Could you please clarify why is this not done?

Thanks!

shoutOutYangJie commented 3 years ago

@InnovArul Yes, I also find this problem. I guess that the author forgeted to append offset0 to a list. like following:

for ...
   ...
  offset0 = (coarse_search_correlation * grid ).sum(1).sum(1) * dirates[searching_index]  # 1,h,w,2
  offsets.append(offset0). # change here.
...
 im_col0 = [deform_im2col(qr[i], offsets[i], kernel_size=self.P)  for i in range(nsearch)] #  change here.
zlai0 commented 3 years ago

Thanks for pointing out! Not sure why I created the list but didn't use it, but I will correct the code.