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

Different implementation of PredictionModule #69

Open
anshkumar opened this issue Jun 14, 2022 · 2 comments
Open

Different implementation of PredictionModule #69

anshkumar opened this issue Jun 14, 2022 · 2 comments

Comments

@anshkumar
Copy link

Hi,
I was going through your code and found that you've used len(cfg.aspect_ratios) as a multiplication factor for bbox_layer, conf_layer and coef_layer:

        self.bbox_layer = nn.Conv2d(256, len(cfg.aspect_ratios) * 4, kernel_size=3, padding=1)
        self.conf_layer = nn.Conv2d(256, len(cfg.aspect_ratios) * self.num_classes, kernel_size=3, padding=1)
        self.coef_layer = nn.Sequential(nn.Conv2d(256, len(cfg.aspect_ratios) * self.coef_dim,
                                                  kernel_size=3, padding=1),
                                        nn.Tanh())

But in the official implementation they are using self.num_priors as a multiplication factor:

            self.bbox_layer = nn.Conv2d(out_channels, self.num_priors * 4,                **cfg.head_layer_params)
            self.conf_layer = nn.Conv2d(out_channels, self.num_priors * self.num_classes, **cfg.head_layer_params)
            self.mask_layer = nn.Conv2d(out_channels, self.num_priors * self.mask_dim,    **cfg.head_layer_params)

why ?

@feiyuhuahuo
Copy link
Owner

feiyuhuahuo commented Jun 15, 2022

len(cfg.aspect_ratios) == 3, in each output scale, there are 3 anchors with different aspect ratios per point. This is the original Yolact configuration.

@anshkumar
Copy link
Author

@feiyuhuahuo Thanks for the reply. I was also making Yolact minimal (but in TensorFlow). I tried to match the code as closely as possible with the original code, but still, I'm not able to match the MAP of the official implementation. With Resnet50 I'm getting 25.6 MAP. Will you be able to provide some feedback or review my code please?
link: https://github.com/anshkumar/yolact

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