MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / forward

Method forward

SwissArmyTransformer/examples/yolos/models/detector.py:53–62  ·  view source on GitHub ↗
(self, samples: NestedTensor)

Source from the content-addressed store, hash-verified

51 self.bbox_embed = MLP(hidden_dim, hidden_dim, 4, 3)
52
53 def forward(self, samples: NestedTensor):
54 # import pdb;pdb.set_trace()
55 if isinstance(samples, (list, torch.Tensor)):
56 samples = nested_tensor_from_tensor_list(samples)
57 x = self.backbone(samples.tensors)
58 # x = x[:, 1:,:]
59 outputs_class = self.class_embed(x)
60 outputs_coord = self.bbox_embed(x).sigmoid()
61 out = {'pred_logits': outputs_class, 'pred_boxes': outputs_coord}
62 return out
63
64 def forward_return_attention(self, samples: NestedTensor):
65 if isinstance(samples, (list, torch.Tensor)):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected