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

About code question #1

Open
cocowy opened this issue Dec 13, 2021 · 1 comment
Open

About code question #1

cocowy opened this issue Dec 13, 2021 · 1 comment

Comments

@cocowy
Copy link

cocowy commented Dec 13, 2021

hi, congratulations! Nice work!
I have a question about /networks/deformable_refine.py/class GetValueV2(nn.Module)/line 72 :

        # clip p
        p_y = torch.clamp(p[..., :N], 0, h-1) / (h-1) * 2 - 1
        p_x = torch.clamp(p[..., N:], 0, w-1) / (w-1) * 2 - 1

According to the context of the code, the p_y and p_x shoud be

        # clip p
        p_x = torch.clamp(p[..., :N], 0, w-1) / (w-1) * 2 - 1
        p_y= torch.clamp(p[..., N:], 0, h-1) / (h-1) * 2 - 1

to achieve bilinear sample operation. Am I right?
THx!

@SpadeLiu
Copy link
Owner

hi, congratulations! Nice work! I have a question about /networks/deformable_refine.py/class GetValueV2(nn.Module)/line 72 :

        # clip p
        p_y = torch.clamp(p[..., :N], 0, h-1) / (h-1) * 2 - 1
        p_x = torch.clamp(p[..., N:], 0, w-1) / (w-1) * 2 - 1

According to the context of the code, the p_y and p_x shoud be

        # clip p
        p_x = torch.clamp(p[..., :N], 0, w-1) / (w-1) * 2 - 1
        p_y= torch.clamp(p[..., N:], 0, h-1) / (h-1) * 2 - 1

to achieve bilinear sample operation. Am I right? THx!

Hi, thanks for your suggestion.

Actually, it doesn't matter whether the first N points are 'x' or 'y', the model learns to regress the coordinates by itself.

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