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

Mismatch of tensor in WHD forward? #49

Open
zlyin opened this issue Jul 11, 2022 · 0 comments
Open

Mismatch of tensor in WHD forward? #49

zlyin opened this issue Jul 11, 2022 · 0 comments

Comments

@zlyin
Copy link

zlyin commented Jul 11, 2022

Hello Javier,
I'm trying to understand your WHD forward function, but fail to understand the dimension of normalized_y.

            # One by one
            prob_map_b = prob_map[b, :, :]
            gt_b = gt[b]
            orig_size_b = orig_sizes[b, :]
            norm_factor = (orig_size_b/self.resized_size).unsqueeze(0)

            # Pairwise distances between all possible locations and the GTed locations
            n_gt_pts = gt_b.size()[0]
            normalized_x = norm_factor.repeat(self.n_pixels, 1) * self.all_img_locations
            normalized_y = norm_factor.repeat(len(gt_b), 1) * gt_b
            d_matrix = cdist(normalized_x, normalized_y)

From my understanding, gt_b.size() = [H, W], normal_factor.size = (1, 2), then n_gt_pts = H; self.all_img_locations.size() = [HxW, 2] which leads to normalized_x.size() = [HxW, 2] ;

Then, here comes my puzzle. norm_factor.repeat(len(gt_b), 1) gives me [B, 2], but gt_b.size() = [H, W], how to multiply these 2 tensors?? Did you use some special reshape operations here?

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