Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

984 B
Raw Blame

RandomRotation90 now raises ValueError on a non-square input when the times range allows an odd number of quarter turns, such as times=(1, 1) or times=(-1, 1), even if a given call would draw an even one. An odd number of turns swaps the height and the width, but the class keeps the input's (H, W), so it used to return an image of the same shape with the part that did not fit cut off and a strip of zeros in its place (a 6 x 8 image lost two of its eight columns), with no warning (#4409). Square images, and ranges of even numbers only such as times=(2, 2), behave as before. The error names RandomRotation with a fixed angle of 90 degrees, to rotate and crop, and torch.rot90, to turn a whole batch exactly. AdaptiveDiscriminatorAugmentation is affected through its default stack, which contains RandomRotation90(times=(0, 3)): it now raises on a non-square image, on the first call, before it selects any sample, so the default preset needs square images.