The-Learning-And-Vision-Atelier-LAVA / PAM

[TPAMI 2020] Parallax Attention for Unsupervised Stereo Correspondence Learning
95 stars 16 forks source link

How to calculate the initial disparity map? #5

Open Sarah20187 opened 3 years ago

Sarah20187 commented 3 years ago

Thank you for your wonderful work and codes. Could you help me understand the code below? https://github.com/LongguangWang/PAM/blob/7200dd201047ceb2d98eeea8215b773d11fff8d4/PASMnet/models/modules.py#L199

Why not directly use the sum of all disparity candidates weighted by the parallax-attention map?

LongguangWang commented 3 years ago

Hi @Sarah20187, thanks for your interests in our work. One can also use the sum of all disparity candidates weighted by the parallax-attention map to regress the disparity (e.g., disp_ini = torch.sum(att * (index.transpose(-1, -2) - index), dim=-1).view(b, 1, h, w)), which is mathematically equivalent to our implementation.