Skip to content

lots of missing imports in pymic/net/net3d/trans3d/transunet3d.py #47

@lyhyl

Description

@lyhyl

lots of missing imports in pymic/net/net3d/trans3d/transunet3d.py.

from ..networks.neural_network import SegmentationNetwork
from .vit_modeling import Transformer
from .vit_modeling import CONFIGS as CONFIGS_ViT

if self.is_masked_attn:
from .mask2former_modeling.transformer_decoder.mask2former_transformer_decoder3d import MultiScaleMaskedTransformerDecoder3d
cfg['num_feature_levels'] = 1 if not self.is_max_ms or self.is_max_ms_fpn else 3
cfg["is_masking"] = True if is_masking else False
cfg["is_masking_argmax"] = True if is_masking_argmax else False
cfg["is_mhsa_float32"] = True if is_mhsa_float32 else False
cfg["no_max_hw_pe"] = True if no_max_hw_pe else False
self.predictor = MultiScaleMaskedTransformerDecoder3d(in_channels=max_hidden_dim, mask_classification=is_max_cls, **cfg)
else:
from .mask2former_modeling.transformer_decoder.maskformer_transformer_decoder3d import StandardTransformerDecoder
cfg["dropout"], cfg["enc_layers"], cfg["deep_supervision"] = 0.1, 0, False
self.predictor = StandardTransformerDecoder(in_channels=max_hidden_dim, mask_classification=is_max_cls, **cfg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions