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

Need your suggestions #105

Closed
haideralimughal opened this issue Sep 22, 2021 · 5 comments
Closed

Need your suggestions #105

haideralimughal opened this issue Sep 22, 2021 · 5 comments

Comments

@haideralimughal
Copy link

Hi, i have designed this SPP module for my network. But i am also interested in your work to replace my his module with JPU. Would you like to give me any suggestions? here is my implementation

class SPP(nn.Module):
def init(self, pool_sizes):
super(SPP, self).init()
self.pool_sizes = pool_sizes

def forward(self, x):
    h, w = x.shape[2:]
    k_sizes = []
    strides = []
    for pool_size in self.pool_sizes:
        k_sizes.append((int(h / pool_size), int(w / pool_size)))
        strides.append((int(h / pool_size), int(w / pool_size)))

    spp_sum = x

    for i in range(len(self.pool_sizes)):
        out = F.avg_pool2d(x, k_sizes[i], stride=strides[i], padding=0)
        out = F.upsample(out, size=(h, w), mode="bilinear")
        spp_sum = spp_sum + out

    return spp_sum  
@wuhuikai
Copy link
Owner

I do not understand your question indeed. Do you mean insert JPU into PSPNet ?

@haideralimughal
Copy link
Author

Basically i have used this SPP module after my encoder part of the network so i mean that how can i modify your JPU module such as i modified SPP module for my network?

@wuhuikai
Copy link
Owner

It's similar, except that JPU requires multiple feature maps as inputs.

@haideralimughal
Copy link
Author

Would you please give me a practical example?

@wuhuikai
Copy link
Owner

See this.

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