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

Is it possible to release vgg network pretrained on GCC? #2

Closed
xialeiliu opened this issue Mar 6, 2019 · 6 comments
Closed

Is it possible to release vgg network pretrained on GCC? #2

xialeiliu opened this issue Mar 6, 2019 · 6 comments

Comments

@xialeiliu
Copy link

I would like to do a quick experiment with vgg network, I would appreciate if you could help on it.

@gjy3035
Copy link
Owner

gjy3035 commented Mar 6, 2019

vgg network? you mean sfcn based on vgg or pure vgg? we have conducted two baselines with vgg backbone. unfortunately, the trained models are saved in my server. when i return lab, i can share the pretrained weights and the model definitions with you.

@xialeiliu
Copy link
Author

Pure vgg, I want to compare training from ImageNet-pretrained and GCC-pretrained VGG-16.
Thanks a lot!
By the way, have you observed that GCC-pretrained network is better than ImageNet-pretrained?
I guess you compare these two in your paper.

@Elin24
Copy link

Elin24 commented Mar 6, 2019

@xialeiliu I am a co-author of this paper. The code you want is as follows

VGG :

class VGG(nn.Module):
    def __init__(self, pretrained=True):
        super(VGG, self).__init__()
        vgg = models.vgg16()
        if pretrained:
            vgg.load_state_dict(torch.load(model_path))
        features = list(vgg.features.children())
        self.features4 = nn.Sequential(*features[0:23])

        self.de_pred = nn.Sequential(
            Conv2d(512, 128, 1, same_padding=True, NL='relu'),
            Conv2d(128, 1, 1, same_padding=True, NL='relu')
        )

    def forward(self, x):
        x = self.features4(x)       
        x = self.de_pred(x)
        x = F.upsample(x,scale_factor=8)
        return x

VGG decoder:

class VGG_decoder(nn.Module):
    def __init__(self, pretrained=True):
        super(VGG_decoder, self).__init__()
        vgg = models.vgg16()
        if pretrained:
            vgg.load_state_dict(torch.load(model_path))
        features = list(vgg.features.children())
        self.features4 = nn.Sequential(*features[0:23])

        self.de_pred = nn.Sequential(
            Conv2d( 512, 128, 3, same_padding=True, NL='relu'),
            nn.ConvTranspose2d(128,64,4,stride=2,padding=1,output_padding=0,bias=True),
            nn.ReLU(),
            nn.ConvTranspose2d(64,32,4,stride=2,padding=1,output_padding=0,bias=True),
            nn.ReLU(),
            nn.ConvTranspose2d(32,16,4,stride=2,padding=1,output_padding=0,bias=True),
            nn.ReLU(),
            Conv2d(16, 1, 1, same_padding=True, NL='relu')
        )

    def forward(self, x):
        x = self.features4(x)       
        x = self.de_pred(x)
        return x

@gjy3035 will provide the pretrained vgg model parameters later, if you need.

@gjy3035
Copy link
Owner

gjy3035 commented Mar 6, 2019

@xialeiliu in our paper, we have compared the results using different installation. due to other stuff, our paper can not be polished. we will upload the paper in 5 days.
41a005c5-d589-470f-9f40-756c979054a2

@xialeiliu
Copy link
Author

That's exactly what I want to see, very interesting results. Thanks for posting it here!

@gjy3035
Copy link
Owner

gjy3035 commented Mar 21, 2019

We have upload the download link for VGG and VGG_decoder, which are trained under the C^3 Framework (the performance is better this repo).
https://mailnwpueducn-my.sharepoint.com/:u:/g/personal/gjy3035_mail_nwpu_edu_cn/EVdYCMGL5WRKp-QRSXs6KlsBGinp0XA3KR4No9cC0OuBcw?e=nehYUH

https://mailnwpueducn-my.sharepoint.com/:u:/g/personal/gjy3035_mail_nwpu_edu_cn/EZNmWR2Si25Auz3yGhrjXYUBgcGVY84yCslFS_pHYTqAtw?e=zYtXb0

Thanks for your attention!

@gjy3035 gjy3035 closed this as completed Mar 21, 2019
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

3 participants