MCPcopy Create free account
hub / github.com/NVIDIA/semantic-segmentation / forward

Method forward

network/ocrnet.py:138–155  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

136 self.ocr = OCR_block(aspp_out_ch)
137
138 def forward(self, inputs):
139 assert 'images' in inputs
140 x = inputs['images']
141
142 _, _, high_level_features = self.backbone(x)
143 aspp = self.aspp(high_level_features)
144 cls_out, aux_out, _ = self.ocr(aspp)
145 aux_out = scale_as(aux_out, x)
146 cls_out = scale_as(cls_out, x)
147
148 if self.training:
149 gts = inputs['gts']
150 loss = cfg.LOSS.OCR_ALPHA * self.criterion(aux_out, gts) + \
151 self.criterion(cls_out, gts)
152 return loss
153 else:
154 output_dict = {'pred': cls_out}
155 return output_dict
156
157
158class MscaleOCR(nn.Module):

Callers

nothing calls this directly

Calls 1

scale_asFunction · 0.90

Tested by

no test coverage detected