MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / build_decoder

Method build_decoder

models/models.py:81–98  ·  view source on GitHub ↗
(arch='ppm',
                      fc_dim=512, num_class=150,
                      weights='', use_softmax=False)

Source from the content-addressed store, hash-verified

79
80 @staticmethod
81 def build_decoder(arch='ppm',
82 fc_dim=512, num_class=150,
83 weights='', use_softmax=False):
84 arch = arch.lower()
85 if arch == 'ppm':
86 net_decoder = PPM(
87 num_class=num_class,
88 fc_dim=fc_dim,
89 use_softmax=use_softmax)
90 else:
91 raise Exception('Architecture undefined!')
92
93 net_decoder.apply(ModelBuilder.weights_init)
94 if len(weights) > 0:
95 print('Loading weights for net_decoder')
96 net_decoder.load_state_dict(
97 torch.load(weights, map_location=lambda storage, loc: storage), strict=False)
98 return net_decoder
99
100
101def conv3x3_bn_relu(in_planes, out_planes, stride=1):

Callers 1

load_seg_moduleFunction · 0.80

Calls 1

PPMClass · 0.85

Tested by

no test coverage detected