aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.37k stars 646 forks source link

method definition of self.bbox_tower #151

Open sdsy888 opened 4 years ago

sdsy888 commented 4 years ago

Hi, I just found the definition of methods, such as self.cls_tower, self.bbox_tower, could not be found in the repo:

https://github.com/aim-uofa/AdelaiDet/blob/f9103480b351330774205ecd6376a0683437bcfa/adet/modeling/fcos/fcos.py#L196-L198

Could you tell me where is the definition of these methods?

Thank you.

WeianMao commented 4 years ago
    for head in head_configs:
        tower = []
        num_convs, use_deformable = head_configs[head]
        if use_deformable:
            conv_func = DFConv2d
        else:
            conv_func = nn.Conv2d
        for i in range(num_convs):
            tower.append(conv_func(
                in_channels, in_channels,
                kernel_size=3, stride=1,
                padding=1, bias=True
            ))
            if norm == "GN":
                tower.append(nn.GroupNorm(32, in_channels))
            tower.append(nn.ReLU())
        self.add_module('{}_tower'.format(head),
                        nn.Sequential(*tower))