Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion detectron2/layers/nms.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def batched_nms(
# to decide whether to use coordinate trick or for loop to implement batched_nms. So we
# just call it directly.
# Fp16 does not have enough range for batched NMS, so adding float().
return box_ops.batched_nms(boxes.float(), scores, idxs, iou_threshold)
boxes_value = boxes.double() if scores.dtype == torch.float64 else boxes.float()
return box_ops.batched_nms(boxes_value, scores, idxs, iou_threshold)


# Note: this function (nms_rotated) might be moved into
Expand Down