Kornia v0.4.0 Release Notes

Release Date: 2020-08-06 // about 1 year ago
  • 🚀 Kornia 0.4.0 release

    🚀 In this release we are including the following main features:

    • 👌 Support to PyTorch v1.6.0.
    • Local descriptors matching, homography and epipolar geometry API.
    • 3D augmentations and low level API to work with volumetric data.

    kornia_medical

    Highlights

    Local features matching

    ✅ We include an kornia.feature.matching API to perform local descriptors matching such classical and derived version of the nearest neighbour (NN).

    • match_nn
    • match_mnn
    • match_snn
    • match_smnn

      import torchimport kornia as Kdesc1 = torch.rand(2500, 128)desc2 = torch.rand(2500, 128)dists, idxs = K.feature.matching.match_nn(desc1, desc2) # 2500 / 2500x2

    Homography and epipolar geometry

    ✅ We also introduce kornia.geometry.homography including different functionalities to work with homographies and differentiable estimators based on the DLT formulation and the iteratively-reweighted least squares (IRWLS).

    import torchimport kornia as Kpts1 = torch.rand(1, 8, 2)pts2 = torch.rand(1, 8, 2)H = K.find\_homography\_dlt(pts1, pts2, weights=torch.rand(1, 8)) # 1x3x3
    

    ✅ In addition, we have ported some of the existing algorithms from opencv.sfm to PyTorch under kornia.geometry.epipolar that includes different functionalities to work with Fundamental , Essential or Projection matrices, and Triangulation methods useful for Structure from Motion problems.

    3D augmentations and volumetric

    🚀 We expand the kornia.augmentaion with a series of operators to perform 3D augmentations for volumetric data BxCxDxHxW. In this release, we include the following first set of geometric 3D augmentations methods:

    • RandomDepthicalFlip3D (along depth axis)
    • RandomVerticalFlip3D (along height axis)
    • RandomHorizontalFlip3D (along width axis)
    • RandomRotation3D
    • RandomAffine3D

    The API for 3D augmentation work same as with 2D image augmentations:

    import torchimport kornia as Kx = torch.eye(3).repeat(3, 1, 1)aug = K.augmentation.RandomVerticalFlip3D(p=1.0)print(aug(x))tensor([[[[[0., 0., 1.], [0., 1., 0.], [1., 0., 0.]],\<BLANKLINE\> [[0., 0., 1.], [0., 1., 0.], [1., 0., 0.]],\<BLANKLINE\> [[0., 0., 1.], [0., 1., 0.], [1., 0., 0.]]]]])
    

    ✅ Finally, we introduce also a low level API to perform 4D features transformations kornia.warp_projective and extending the filtering operators to support 3D kernels kornia.filter3D.

    More 2d operators

    We expand as well the list of the 2D image augmentations based on the paper AutoAugment: Learning Augmentation Policies from Data.

    • Solarize
    • Posterize
    • Sharpness
    • Equalize
    • RandomSolarize
    • RandomPosterize
    • RandomShaprness
    • RandomEqualize

    👌 Improvements

    • ➕ add zca whitening (#458)
    • ➕ add epipolar geometry package (#569)
    • Jit warp perspective (#574)
    • Autoaugment functions. (#571)
    • Dog and fix features (#591)
    • implement filter3D (#575)
    • Implement warp_projective (#587)
    • 🔋 Feature matching and H/F/E estimation for SFM (#552)
    • 3D augmentations (#592)

    💥 Breaking changes

    • 👀 Create kornia.enhance submodule (#614) -> see details in here

    🐛 Bugs/Fixes

    • 🛠 fixed affine 2d shearing matrix translations (#612)
    • 👻 Now SIFTdesc throws and exception when the input parameters are incompatible (#598)
    • back to group conv backend for filter2d (#600)
    • ⚡️ updates sosnet git paths (#606)

    📄 Docs

    • ⚡️ Updated doc & example for augmentation (#583)
    • 🛠 fix Tversky equation (#579)
    • ⚠ clean docs warnings (#604)
    • ➕ add kornia.geometry.homography docs (#608)
    • create kornia.geometry.subpix (#610)

    Dev

    • 👌 improve conftest fixtures and remove device, dtype imports (#568)
    • ✅ pin versions for pytest plugins and fix flake8 issues (#580)
    • made kornia versions explicit to pytorch version (#597)