MCPcopy Create free account
hub / github.com/ActiveVisionLab/DFNet / EfficientNetB3

Class EfficientNetB3

script/dm/pose_model.py:193–209  ·  view source on GitHub ↗

EfficientNet-B3 backbone, model ref: https://github.com/lukemelas/EfficientNet-PyTorch/blob/master/efficientnet_pytorch/model.py

Source from the content-addressed store, hash-verified

191 # vis_pose(vis_info)
192
193class EfficientNetB3(nn.Module):
194 ''' EfficientNet-B3 backbone,
195 model ref: https://github.com/lukemelas/EfficientNet-PyTorch/blob/master/efficientnet_pytorch/model.py
196 '''
197 def __init__(self, feat_dim=12):
198 super(EfficientNetB3, self).__init__()
199 self.backbone_net = EfficientNet.from_pretrained('efficientnet-b3')
200 self.feature_extractor = self.backbone_net.extract_features
201 self.avgpool = nn.AdaptiveAvgPool2d(1)
202 self.fc_pose = nn.Linear(1536, feat_dim) # 1280 for efficientnet-b0, 1536 for efficientnet-b3
203
204 def forward(self, Input):
205 x = self.feature_extractor(Input)
206 x = self.avgpool(x)
207 x = x.reshape(x.size(0), -1)
208 predict = self.fc_pose(x)
209 return predict
210
211# PoseNet (SE(3)) w/ mobilev2 backbone
212class PoseNetV2(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected