快捷方式

clip_boxes_to_image

torchvision.ops.clip_boxes_to_image(boxes: Tensor, size: tuple[int, int]) Tensor[原始碼]

將邊界框剪輯到大小為 size 的影像內。

注意

對於剪輯 BoundingBoxes 物件,請考慮使用變換 ClampBoundingBoxes() 代替。

引數:
  • boxes (Tensor[..., 4]) – 格式為 (x1, y1, x2, y2) 的邊界框,其中 0 <= x1 < x20 <= y1 < y2

  • size (Tuple[height, width]) – 影像的大小

返回:

剪輯後的邊界框

返回型別:

Tensor[…, 4]

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源