RandomZoomOut¶
- class torchvision.transforms.v2.RandomZoomOut(fill: Union[int, float, Sequence[int], Sequence[float], None, dict[Union[type, str], Union[int, float, collections.abc.Sequence[int], collections.abc.Sequence[float], NoneType]] = 0, side_range: Sequence[float] = (1.0, 4.0), p: float = 0.5)[原始碼]¶
“SSD: Single Shot MultiBox Detector” 中的“Zoom out”變換。
此變換會隨機填充影像、影片、邊界框和掩碼,從而產生放大效果。輸出的空間尺寸將從原始尺寸隨機取樣,最多可達
side_range引數配置的最大尺寸。r = uniform_sample(side_range[0], side_range[1]) output_width = input_width * r output_height = input_height * r
如果輸入是
torch.Tensor或TVTensor(例如Image、Video、BoundingBoxes等),則它可能具有任意數量的前導批次維度。例如,影像的形狀可以是[..., C, H, W]。邊界框的形狀可以是[..., 4]。- 引數:
使用
RandomZoomOut的示例