timmeinhardt / trackformer

Implementation of "TrackFormer: Multi-Object Tracking with Transformers”. [Conference on Computer Vision and Pattern Recognition (CVPR), 2022]
https://arxiv.org/abs/2101.02702
Apache License 2.0
502 stars 116 forks source link

What does valid ratio mean? #63

Open mkhoshle opened 1 year ago

mkhoshle commented 1 year ago

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.

timmeinhardt commented 1 year ago

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.