Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some inquires about the confidence offset calculation #38

Closed
Magicboomliu opened this issue Nov 2, 2021 · 2 comments
Closed

Some inquires about the confidence offset calculation #38

Magicboomliu opened this issue Nov 2, 2021 · 2 comments

Comments

@Magicboomliu
Copy link

Hi jinsun!
I looking through #16 . And your lastest version.
if I understand correctly, for a new training model, there is no need to compute the relative coordinate ww and hh.
I think there should better use a if judgement for reduce the computional complexity?
Here:

                ww = idx_off % self.k_f
                hh = idx_off // self.k_f

                if ww == (self.k_f - 1) / 2 and hh == (self.k_f - 1) / 2:
                    continue

                offset_tmp = offset_each[idx_off].detach()

                # NOTE : Use --legacy option ONLY for the pre-trained models
                # for ECCV20 results.
                if self.args.legacy:
                    offset_tmp[:, 0, :, :] = \
                        offset_tmp[:, 0, :, :] + hh - (self.k_f - 1) / 2
                    offset_tmp[:, 1, :, :] = \
                        offset_tmp[:, 1, :, :] + ww - (self.k_f - 1) / 2

                conf_tmp = ModulatedDeformConvFunction.apply(
                    confidence, offset_tmp, modulation_dummy, self.w_conf,
                    self.b, self.stride, 0, self.dilation, self.groups,
                    self.deformable_groups, self.im2col_step)
                list_conf.append(conf_tmp)

            conf_aff = torch.cat(list_conf, dim=1)
            aff = aff * conf_aff.contiguous()```    


  
@zzangjinsun
Copy link
Owner

The calculation you mentioned is still needed to "skip" the reference at the patch center.
You may check how aff and aff_ref are calculated to understand this process!

@Magicboomliu
Copy link
Author

Ok, yeah, I understand. thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants