Skip to content

Commit

Permalink
dummy test
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox committed Dec 23, 2020
1 parent 64b33a9 commit 6606123
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchvision/models/detection/rpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def __init__(self,
self._pre_nms_top_n = pre_nms_top_n
self._post_nms_top_n = post_nms_top_n
self.nms_thresh = nms_thresh
self.score_thresh = score_thresh
self.score_thresh = float('-inf')
self.min_size = 1e-3

def pre_nms_top_n(self):
Expand Down Expand Up @@ -252,7 +252,7 @@ def filter_proposals(self, proposals, objectness, image_shapes, num_anchors_per_
levels = levels[batch_idx, top_n_idx]
proposals = proposals[batch_idx, top_n_idx]

objectness_prob = F.sigmoid(objectness)
objectness_prob = objectness#F.sigmoid(objectness)

final_boxes = []
final_scores = []
Expand All @@ -264,7 +264,7 @@ def filter_proposals(self, proposals, objectness, image_shapes, num_anchors_per_
boxes, scores, lvl = boxes[keep], scores[keep], lvl[keep]

# remove low scoring boxes
keep = torch.where(scores > self.score_thresh)[0]
keep = torch.where(scores >= self.score_thresh)[0]
boxes, scores, lvl = boxes[keep], scores[keep], lvl[keep]

# non-maximum suppression, independently done per level
Expand Down

0 comments on commit 6606123

Please sign in to comment.