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

edit the LRBranch and HRBranch after changed backbone #213

Open
luoww1992 opened this issue Oct 10, 2023 · 3 comments
Open

edit the LRBranch and HRBranch after changed backbone #213

luoww1992 opened this issue Oct 10, 2023 · 3 comments

Comments

@luoww1992
Copy link

i prepare to change the backbone to use efficient,
while how to edit the func LRBranch and HRBranch ?

@munibkhanali
Copy link

HI @luoww1992
You can use timm https://github.com/huggingface/pytorch-image-models
add the following class in the wrapper.py

class Efficienb0v1(BaseBackbone):
    """ 
        EfficientBackbone 
    """

    def __init__(self, in_channels):
        super(Efficienb0v1, self).__init__(in_channels)

        self.model = timm.create_model('tf_efficientnet_b0.ns_jft_in1k',pretrained=True,features_only=True)
        self.enc_channels = self.model.feature_info.channels()

    def forward(self, x):
       return self.model.forward(x)

then you have to update backbone->init.py accodingly

I hope it will helps
Thank you

@luoww1992
Copy link
Author

@munibkhanali

i use the efficient07 backbone from this project : https://github.com/Fire-friend/dugMatting/blob/main/models/backbones/wrapper.py#L578

how to edit ?

@munibkhanali
Copy link

HI @luoww1992
The code there is pretty straightforward you don't need to change anything in LRBranch or HRBranch. if you are facing any issues please describe them in detail
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

2 participants