MCPcopy Create free account
hub / github.com/ImprintLab/Medical-SAM2 / __init__

Method __init__

sam2_train/modeling/memory_encoder.py:139–156  ·  view source on GitHub ↗
(
        self,
        out_dim,
        mask_downsampler,
        fuser,
        position_encoding,
        in_dim=256,  # in_dim of pix_feats
    )

Source from the content-addressed store, hash-verified

137
138class MemoryEncoder(nn.Module):
139 def __init__(
140 self,
141 out_dim,
142 mask_downsampler,
143 fuser,
144 position_encoding,
145 in_dim=256, # in_dim of pix_feats
146 ):
147 super().__init__()
148
149 self.mask_downsampler = mask_downsampler
150
151 self.pix_feat_proj = nn.Conv2d(in_dim, in_dim, kernel_size=1)
152 self.fuser = fuser
153 self.position_encoding = position_encoding
154 self.out_proj = nn.Identity()
155 if out_dim != in_dim:
156 self.out_proj = nn.Conv2d(in_dim, out_dim, kernel_size=1)
157
158 def forward(
159 self,

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected