MCPcopy
hub / github.com/facebookresearch/mmf / __init__

Method __init__

pythia/modules/encoders.py:13–25  ·  view source on GitHub ↗
(self, encoder_type, in_dim, **kwargs)

Source from the content-addressed store, hash-verified

11
12class ImageEncoder(nn.Module):
13 def __init__(self, encoder_type, in_dim, **kwargs):
14 super(ImageEncoder, self).__init__()
15
16 if encoder_type == "default":
17 self.module = Identity()
18 self.module.in_dim = in_dim
19 self.module.out_dim = in_dim
20 elif encoder_type == "finetune_faster_rcnn_fpn_fc7":
21 self.module = FinetuneFasterRcnnFpnFc7(in_dim, **kwargs)
22 else:
23 raise NotImplementedError("Unknown Image Encoder: %s" % encoder_type)
24
25 self.out_dim = self.module.out_dim
26
27 def forward(self, *args, **kwargs):
28 return self.module(*args, **kwargs)

Callers 1

__init__Method · 0.45

Calls 2

IdentityClass · 0.90

Tested by

no test coverage detected