trackformer icon indicating copy to clipboard operation
trackformer copied to clipboard

What does valid ratio mean?

Open mkhoshle opened this issue 3 years ago • 1 comments

Hello,

In the Deformable Transformer, there is a variable called valid_ratios which is used based on the masks. valid_ratios = torch.stack([self.get_valid_ratio(m) for m in masks], 1). If the masks are None in my case how am I supposed to calculate it?

Also, what is the purpose of valid_ratios? I could not find anything in the Trackformer and Original Deformable Detr paper.

I would appreciate it if you could clarify this.

mkhoshle avatar Sep 29 '22 17:09 mkhoshle

These masks specify where padding was added to the image and are used to ignore those regions during the attention computation. If you do not have padding just initialize masks with zeros/False. See here for where the masks are generated.

timmeinhardt avatar Sep 29 '22 17:09 timmeinhardt