快捷方式

batched_nms

torchvision.ops.batched_nms(boxes: Tensor, scores: Tensor, idxs: Tensor, iou_threshold: float) Tensor[source]

以批處理方式執行非極大值抑制。

每個索引值對應一個類別,NMS 不會應用於不同類別的元素之間。

引數:
  • boxes (Tensor[N, 4]) – 將執行 NMS 的邊界框。期望其格式為 (x1, y1, x2, y2),其中 0 <= x1 < x20 <= y1 < y2

  • scores (Tensor[N]) – 每個邊界框的分數

  • idxs (Tensor[N]) – 每個邊界框所屬類別的索引。

  • iou_threshold (float) – 丟棄所有 IoU > iou_threshold 的重疊邊界框

返回:

int64 張量,包含 NMS 保留元素的索引,按分數降序排序

返回型別:

張量

文件

查閱全面的 PyTorch 開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源