visionml / pytracking

Visual tracking library based on PyTorch.
GNU General Public License v3.0
3.23k stars 605 forks source link

Questions about sample area selection in ToMP #370

Open shen-ttt opened 1 year ago

shen-ttt commented 1 year ago

Thank you for the code of ToMP! Really help me a lot in understanding the whole logic.

ToMP uses the sample_patch function to select a sample area and extract features. During normal tracking, the center of this sample area is determined by the following function:

def get_centered_sample_pos(self):
      ""Get the center position for the new sample. Make sure the target is correctly centered."""
      return self.pos + ((self.feature_sz + self.kernel_size) % 2) * self.target_scale * \
           self.img_support_sz / (2*self.feature_sz)

Instead of using self.pos as the center point, the code added another complex term. Could you help me understand the reason behind it?

Really appreciate it if you can help me a bit with this.