(self, samples: NestedTensor)
| 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)): |
nothing calls this directly
no test coverage detected