Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

927 B
Raw Blame

The functions equalize_clahe, in_range, jpeg_codec_differentiable, the modules InRange and JPEGCodecDifferentiable, and the decorators perform_keep_shape_image and perform_keep_shape_video now accept an empty batch. In 0.9.0, an empty batch or any zero leading dimension raised ValueError: Invalid input tensor, it is empty.. Now an empty batch or any zero leading dimension returns an empty result. For example, an input image of shape (0, 3, H, W) gives an output of (0, 3, H, W); for a mask returned by in_range(..., return_mask=True) or InRange(..., return_mask=True) the output shape is (0, 1, H, W). An image with a zero channel, height or width still raises ValueError, and for video a zero depth does too. The JPEG codec now also accepts an empty quality tensor for an empty batch. A non-empty batch with an empty quality now raises ShapeError instead of the RuntimeError from amin().