Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

646 B
Raw Blame

Under torch.no_grad() or torch.inference_mode(), ALIKED and kornia.feature.aliked.deform_conv2d sample the deformable convolution with one grid_sample call over every offset group instead of four gathers per sample. On an Apple M1 the ALIKED-n16 forward of a 640 x 512 image is 1.8x faster on MPS, in float32 and float16, and 5 % faster on CPU; outputs change by rounding. Half-precision inputs are sampled in float32, as accurately as before. With autograd enabled the previous sampler stays: grid_sample's normalized coordinates can round a sample at an integer position onto the previous pixel and give it that pixel's derivative.