def __init__(self,
                 stage1=dict(type='GLEncoderDecoder',
                             encoder=dict(type='DeepFillEncoder'),
                             decoder=dict(type='DeepFillDecoder',
                                          in_channels=128),
                             dilation_neck=dict(type='GLDilationNeck',
                                                in_channels=128,
                                                act_cfg=dict(type='ELU'))),
                 stage2=dict(type='DeepFillRefiner'),
                 return_offset=False):
        super(DeepFillEncoderDecoder, self).__init__()
        self.stage1 = build_backbone(stage1)
        self.stage2 = build_component(stage2)

        self.return_offset = return_offset
Exemple #2
0
    def __init__(self,
                 encoder,
                 imnet,
                 local_ensemble=True,
                 feat_unfold=True,
                 cell_decode=True,
                 eval_bsize=None):
        super().__init__()

        self.local_ensemble = local_ensemble
        self.feat_unfold = feat_unfold
        self.cell_decode = cell_decode
        self.eval_bsize = eval_bsize

        # model
        self.encoder = build_backbone(encoder)
        imnet_in_dim = self.encoder.mid_channels
        if self.feat_unfold:
            imnet_in_dim *= 9
        imnet_in_dim += 2  # attach coordinates
        if self.cell_decode:
            imnet_in_dim += 2
        imnet['in_dim'] = imnet_in_dim
        self.imnet = build_component(imnet)