RandomCrop¶
- class torchcodec.transforms.RandomCrop(size: Sequence[int])[source]¶
Crop the decoded frame to a given size at a random location in the frame.
Complementary TorchVision transform:
RandomCrop. Padding of all kinds is disabled. The random location within the frame is determined during the initialization of theVideoDecoderobject that owns this transform. As a consequence, each decoded frame in the video will be cropped at the same location. Videos with variable resolution may result in undefined behavior.- Parameters:
size (Sequence[int]) – Desired output size. Must be a sequence of the form (height, width).