MCPcopy Create free account
hub / github.com/PolyU-ChenLab/UniPixel / __init__

Method __init__

sam2/modeling/backbones/image_encoder.py:16–28  ·  view source on GitHub ↗
(
        self,
        trunk: nn.Module,
        neck: nn.Module,
        scalp: int = 0,
    )

Source from the content-addressed store, hash-verified

14class ImageEncoder(nn.Module):
15
16 def __init__(
17 self,
18 trunk: nn.Module,
19 neck: nn.Module,
20 scalp: int = 0,
21 ):
22 super().__init__()
23 self.trunk = trunk
24 self.neck = neck
25 self.scalp = scalp
26 assert (
27 self.trunk.channel_list == self.neck.backbone_channel_list
28 ), f"Channel dims of trunk and neck do not match. Trunk: {self.trunk.channel_list}, neck: {self.neck.backbone_channel_list}"
29
30 def forward(self, sample: torch.Tensor):
31 # Forward through backbone

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected