clip_boxes_to_image: Clip Boxes to Image

View source: R/ops-boxes.R

clip_boxes_to_imageR Documentation

Clip Boxes to Image

Description

Clip boxes so that they lie inside an image of size size.

Usage

clip_boxes_to_image(boxes, size)

Arguments

boxes

(Tensor[N, 4]): boxes in (x_{min}, y_{min}, x_{max}, y_{max}) format with

  • 0 \leq x_{min} < x_{max} and

  • 0 \leq y_{min} < y_{max}.

size

(Tuple[height, width]): size of the image

Value

clipped_boxes (Tensor[N, 4])


torchvision documentation built on Aug. 8, 2025, 7:27 p.m.