Пример #1
0
 def forward(self, boxes, scores):
     return soft_nms(boxes, scores, 0.5, 0.05)
Пример #2
0
 def test_indexing_works(self):
     # Making sure that we can use keep for indexing
     _, keep = soft_nms(self.boxes, self.scores, 0.5, 0.1)
     _ = self.boxes[keep, :]
Пример #3
0
 def test_gpu(self):
     _ = soft_nms(self.boxes.cuda(), self.scores.cuda(), 0.5, 0.1)
Пример #4
0
 def test_correct_keep(self):
     _, keep = soft_nms(self.boxes, self.scores, 0.5, 0.1)
     self.assertTrue(torch.allclose(keep, torch.tensor([1, 0])))