Skip to content

Commit

Permalink
[Fix] Fix docstring about noise in DINO (#9747)
Browse files Browse the repository at this point in the history
  • Loading branch information
nijkah authored Feb 9, 2023
1 parent 78030a6 commit 3446bd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmdet/models/layers/transformer/dino_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def generate_dn_bbox_query(self, gt_bboxes: Tensor,
# calculate the random part of the added noise
rand_part = torch.rand_like(gt_bboxes_expand) # [0, 1)
rand_part[negative_idx] += 1.0 # pos: [0, 1); neg: [1, 2)
rand_part *= rand_sign # pos: (-1, 1); neg: (-2, 1] U [1, 2)
rand_part *= rand_sign # pos: (-1, 1); neg: (-2, -1] U [1, 2)

# add noise to the bboxes
bboxes_whwh = bbox_xyxy_to_cxcywh(gt_bboxes_expand)[:, 2:].repeat(1, 2)
Expand Down

0 comments on commit 3446bd1

Please sign in to comment.