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

PredictionConvolutions separates locs and classes, doesn't follow the paper? #87

Open
hrbigelow opened this issue May 6, 2022 · 0 comments

Comments

@hrbigelow
Copy link

I noticed in the paper each Prediction Convolution is formulated with output channels = n_boxes * (n_classes + 4), but in the code you have separated each level into separate convolutions.

        self.loc_conv4_3 = nn.Conv2d(512, n_boxes['conv4_3'] * 4, kernel_size=3, padding=1)
        self.loc_conv7 = nn.Conv2d(1024, n_boxes['conv7'] * 4, kernel_size=3, padding=1)
        self.loc_conv8_2 = nn.Conv2d(512, n_boxes['conv8_2'] * 4, kernel_size=3, padding=1)
        self.loc_conv9_2 = nn.Conv2d(256, n_boxes['conv9_2'] * 4, kernel_size=3, padding=1)
        self.loc_conv10_2 = nn.Conv2d(256, n_boxes['conv10_2'] * 4, kernel_size=3, padding=1)
        self.loc_conv11_2 = nn.Conv2d(256, n_boxes['conv11_2'] * 4, kernel_size=3, padding=1)

        # Class prediction convolutions (predict classes in localization boxes)
        self.cl_conv4_3 = nn.Conv2d(512, n_boxes['conv4_3'] * n_classes, kernel_size=3, padding=1)
        self.cl_conv7 = nn.Conv2d(1024, n_boxes['conv7'] * n_classes, kernel_size=3, padding=1)
        self.cl_conv8_2 = nn.Conv2d(512, n_boxes['conv8_2'] * n_classes, kernel_size=3, padding=1)
        self.cl_conv9_2 = nn.Conv2d(256, n_boxes['conv9_2'] * n_classes, kernel_size=3, padding=1)
        self.cl_conv10_2 = nn.Conv2d(256, n_boxes['conv10_2'] * n_classes, kernel_size=3, padding=1)
        self.cl_conv11_2 = nn.Conv2d(256, n_boxes['conv11_2'] * n_classes, kernel_size=3, padding=1)...

But, I believe if it were implemented as in the paper, it should be:

        self.conv4_3 = nn.Conv2d(512, n_boxes['conv4_3'] * (4 + n_classes), kernel_size=3, padding=1)
        self.conv7 = nn.Conv2d(1024, n_boxes['conv7'] * (4 + n_classes), kernel_size=3, padding=1)
        self.conv8_2 = nn.Conv2d(512, n_boxes['conv8_2'] * (4 + n_classes), kernel_size=3, padding=1)
        self.conv9_2 = nn.Conv2d(256, n_boxes['conv9_2'] * (4 + n_classes), kernel_size=3, padding=1)
        self.conv10_2 = nn.Conv2d(256, n_boxes['conv10_2'] * (4 + n_classes), kernel_size=3, padding=1)
        self.conv11_2 = nn.Conv2d(256, n_boxes['conv11_2'] * (4 + n_classes), kernel_size=3, padding=1)

Did you try it the original way, or was this an intentional choice for some reason?

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