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

sheared feature mapping #117

Open
Luke199010 opened this issue Jul 11, 2023 · 0 comments
Open

sheared feature mapping #117

Luke199010 opened this issue Jul 11, 2023 · 0 comments

Comments

@Luke199010
Copy link

Hello,
Why is sheared_feature_map obtained by sampling on x_feature_map?
I don't understand what sheared_feature_map does? This sampling method is a bit like sampling lane line features in LaneATT. The difference is that you fill in 0 in other positions of the feature map, and only sample on straight lines with specific angles, and these specific angles do not seem to be consistent with the angle of the anchor.

        v_arange = torch.arange(fmap_h).unsqueeze(dim=1).repeat(1,fmap_w*6).to(x.device)
        self.fmap_mapping_interp_index = self.fmap_mapping_interp_index.to(x.device)
        self.fmap_mapping_interp_weight = self.fmap_mapping_interp_weight.to(x.device)

        for batch_idx, x_feature_map in enumerate(x):
            # if True:
            # print("v_arange device: " + str(v_arange.device))
            # print("self.fmap_mapping_interp_index device: " + str(self.fmap_mapping_interp_index.device))
            # print("self.fmap_mapping_interp_weight device: " + str(self.fmap_mapping_interp_weight.device))
            # print("sheared_feature_map device: " + str(sheared_feature_map.device))
            # print("batch_idx device: " + str(v_arange.device))
            # print("x_feature_map device: " + str(x_feature_map.device))

            sheared_feature_map[batch_idx] = \
                x_feature_map[:, v_arange, self.fmap_mapping_interp_index[:,:,0]] * self.fmap_mapping_interp_weight[:,:,0] + \
                x_feature_map[:, v_arange, self.fmap_mapping_interp_index[:,:,1]] * self.fmap_mapping_interp_weight[:,:,1]
        x = torch.cat((x, sheared_feature_map), dim=3)

Looking forward to your reply. Thank you.

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

1 participant