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

How to implement the BiSeNetV2 large? #66

Open
Kevinpsk opened this issue Jun 30, 2020 · 1 comment
Open

How to implement the BiSeNetV2 large? #66

Kevinpsk opened this issue Jun 30, 2020 · 1 comment

Comments

@Kevinpsk
Copy link

Hi,

Thanks a lot for sharing your code. I want to ask you if you know how the BiSeNetV2 large is implemented.
In the paper, it mentions that BiSeNetV2 large sets the width multiplier alpha=2 (which I understand looking at Fig 3) and the depth multiplier d=3 (which I am not sure what this refers to). Does this depth multiplier refers to the number of stages in the semantic branch? It was not shown in any figure in the paper.
Thanks a lot for your help in advance.
Cheers
Shuokai

@Asuna88
Copy link

Asuna88 commented Jul 30, 2024

是的,目前并不清楚BiseNetV2-large版本的源码复现是怎样的,毕竟真正的official官方代码到目前为止都没有开源,我们都是用的unofficial的再跑实验 。

况且BiseNetV2论文中并没有说清楚 width multiplier alpha=2 表示什么意思,也没说明 depth multiplier d=3 表示什么意思。
模模糊糊可以看到 width multiplier alpha=2 可能和论文中的Fig 3的通道的宽度有关系,至于是什么关系,代码中没有体现。

并且 depth multiplier d=3 表示应该不是stage的数量,因为stage的数量是定了的,是5,感觉应该是表示的一个深度的重复次数?还是什么?并不得知。

以下是SemanticBranch()的代码,个人初步分析
width multiplier alpha和depth multiplier d 应该在下面的代码中进行修改,希望有其他人可以帮忙看下。


class SemanticBranch(nn.Module):
    def __init__(self, cls):
        super(SemanticBranch,self).__init__()
        self.stem = StemBlock()
        self.s3_ge1 = GatherExpansion(16,32,2)
        self.s3_ge2 = GatherExpansion(32,32)

        self.s4_ge1 = GatherExpansion(32,64,2)
        self.s4_ge2 = GatherExpansion(64,64)

        self.s5_ge1 = GatherExpansion(64,128,2)
        self.s5_ge2 = GatherExpansion(128,128)
        self.s5_ge3 = GatherExpansion(128,128)
        self.s5_ge4 = GatherExpansion(128,128)
        self.s5_ge5 = GatherExpansion(128,128,exp=1)
        if self.training:
            self.seghead1 = SegHead(16,16,cls)
            self.seghead2 = SegHead(32,32,cls)
            self.seghead3 = SegHead(64,64,cls)
            self.seghead4 = SegHead(128,128,cls)
       
        self.ceb = ContextEmbeddingBlock(128)

    def forward(self,bottom):
        stg12 = self.stem(bottom)
        #print(stg12.size())
        stg3 = self.s3_ge1(stg12)
        stg3 = self.s3_ge2(stg3)
        #print(stg3.size())
        stg4 = self.s4_ge1(stg3)
        stg4 = self.s4_ge2(stg4)
        #print(stg4.size())
        stg5 = self.s5_ge1(stg4)
        stg5 = self.s5_ge2(stg5)
        stg5 = self.s5_ge3(stg5)
        stg5 = self.s5_ge4(stg5)
        stg5 = self.s5_ge5(stg5)
        #print(stg5.size())
        out = self.ceb(stg5)
        if self.training:
            seghead1 = self.seghead1(stg12)
            seghead2 = self.seghead2(stg3)
            seghead3 = self.seghead3(stg4)
            seghead4 = self.seghead4(stg5)
            return out,seghead1,seghead2,seghead3,seghead4
        else:
            return out

        


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