Recent Releases of kornia

kornia - v0.7.3

What's Changed

  • Pre commit update hooks by @johnnv1 in https://github.com/kornia/kornia/pull/2844
  • fix: typing ignore for dedode.tranformer by @johnnv1 in https://github.com/kornia/kornia/pull/2849
  • Fix datakey retreival for BBOXXYWH and BBOXXYXY by @ashnair1 in https://github.com/kornia/kornia/pull/2846
  • Fix: DeDoDe tests coverage by @johnnv1 in https://github.com/kornia/kornia/pull/2850
  • fix: dedode pretained type ignore dedode init by @johnnv1 in https://github.com/kornia/kornia/pull/2858
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2857
  • added kornia's euclidian_distance function in kmeans algorithm by @smruthi-sumanth in https://github.com/kornia/kornia/pull/2861
  • gaussian illumination device improvements by @edgarriba in https://github.com/kornia/kornia/pull/2860
  • feat: 2d augmentation benchmarks by @johnnv1 in https://github.com/kornia/kornia/pull/2853
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2864
  • Support instance masks (N,H,W) by @ashnair1 in https://github.com/kornia/kornia/pull/2856
  • color jitter compile and set right device / dtype by @edgarriba in https://github.com/kornia/kornia/pull/2863
  • [Fix] Transformation Matrix Mis-calculation for autoaugmentations by @shijianjian in https://github.com/kornia/kornia/pull/2852
  • [Fix] Add Support for Images not Div by 16 (Diff. JPEG) by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2865
  • support compile for random gaussian blur by @edgarriba in https://github.com/kornia/kornia/pull/2866
  • Feat: random channel dropout by @vgilabert94 in https://github.com/kornia/kornia/pull/2859
  • fix [aug]: gaussian blur compile and compile tests skips by @johnnv1 in https://github.com/kornia/kornia/pull/2872
  • Fixes the use of the gtag extension by @johnnv1 in https://github.com/kornia/kornia/pull/2871
  • remove unused dependencies by @johnnv1 in https://github.com/kornia/kornia/pull/2870
  • Delete manual robots.txt from docs by @johnnv1 in https://github.com/kornia/kornia/pull/2869
  • fix: skip dynamo test for visual prompter by @johnnv1 in https://github.com/kornia/kornia/pull/2874
  • DataKey: add 'label' as alias of 'class' by @ashnair1 in https://github.com/kornia/kornia/pull/2873
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2878
  • Add torch.compile to RandomGaussianIllumination by @vgilabert94 in https://github.com/kornia/kornia/pull/2868
  • adds weight parameter to dice and lovasz_softmax losses by @ducha-aiki in https://github.com/kornia/kornia/pull/2879
  • Vectorize lovasz_softmax loss by @ducha-aiki in https://github.com/kornia/kornia/pull/2884
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2885
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2889
  • bump: workflows to 1.8.1 and torch to 2.2.2 by @johnnv1 in https://github.com/kornia/kornia/pull/2888
  • dedode v2 weights by @Parskatt in https://github.com/kornia/kornia/pull/2887
  • Automatic updates of copyright year in lib by @chirizxc in https://github.com/kornia/kornia/pull/2890
  • Fix: rasanc maxsamplesby_conf to not return negative by @vicsyl in https://github.com/kornia/kornia/pull/2897
  • Change sold2 detector config to dataclass by @lappemic in https://github.com/kornia/kornia/pull/2880
  • chore: remove repetitive words by @peicuiping in https://github.com/kornia/kornia/pull/2902
  • CI: Drop macos-latest runner for torch 1.9.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2905
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2894
  • feat: in_range filtering by @vgilabert94 in https://github.com/kornia/kornia/pull/2895
  • Unify sold2 config dataclasses by @lappemic in https://github.com/kornia/kornia/pull/2899
  • Refactor SOLD2 and WunschLineMatcher Dict Config to Dataclasses by @lappemic in https://github.com/kornia/kornia/pull/2901
  • compute_area fix for ndim=3 tensors by @Isalia20 in https://github.com/kornia/kornia/pull/2915
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2916
  • chore (CI): ensure support to pytorch 2.3.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2912
  • Bump pytest from 8.1.1 to 8.2.1 by @dependabot in https://github.com/kornia/kornia/pull/2917
  • Speed up differentiable 5PC and fix the batch size issue by @weitong8591 in https://github.com/kornia/kornia/pull/2914
  • feat: support batched and float data in apply colormap by @vgilabert94 in https://github.com/kornia/kornia/pull/2886
  • Bump pytest from 8.2.1 to 8.2.2 by @dependabot in https://github.com/kornia/kornia/pull/2925
  • Bugfix: LoFTR was ignoring mask input by @Yosshi999 in https://github.com/kornia/kornia/pull/2923
  • new E decomposition without svd by @weitong8591 in https://github.com/kornia/kornia/pull/2920
  • chore (CI): bump pytorch to 2.3.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2922
  • Fix empty descriptor by @ducha-aiki in https://github.com/kornia/kornia/pull/2927
  • chore (test suite): skip or xfail random failures by @johnnv1 in https://github.com/kornia/kornia/pull/2930
  • chore (CI): ensure support to py312 by @johnnv1 in https://github.com/kornia/kornia/pull/2929
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2919
  • Add pre and post processing steps to allow non float dtypes by @ashnair1 in https://github.com/kornia/kornia/pull/2882
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2933
  • chore (dev deps): pin numpy to lower than 2.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2937
  • chore: typos fixes for codespell by @johnnv1 in https://github.com/kornia/kornia/pull/2936

New Contributors

  • @smruthi-sumanth made their first contribution in https://github.com/kornia/kornia/pull/2861
  • @chirizxc made their first contribution in https://github.com/kornia/kornia/pull/2890
  • @peicuiping made their first contribution in https://github.com/kornia/kornia/pull/2902
  • @Isalia20 made their first contribution in https://github.com/kornia/kornia/pull/2915
  • @Yosshi999 made their first contribution in https://github.com/kornia/kornia/pull/2923

Full Changelog: https://github.com/kornia/kornia/compare/v0.7.2...v0.7.3

- Python
Published by edgarriba over 1 year ago

kornia - v0.7.2

What's Changed

  • rename missing main by @edgarriba in https://github.com/kornia/kornia/pull/2723
  • Bump pytest from 7.4.3 to 7.4.4 by @dependabot in https://github.com/kornia/kornia/pull/2712
  • Replace docs source link from viewcode to github by @johnnv1 in https://github.com/kornia/kornia/pull/2727
  • Bump readthedocs python version by @johnnv1 in https://github.com/kornia/kornia/pull/2729
  • Bump accelerate from 0.25.0 to 0.26.1 by @dependabot in https://github.com/kornia/kornia/pull/2730
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2734
  • Fixes extract_tensor_patches to work with partial patches cases by @johnnv1 in https://github.com/kornia/kornia/pull/2735
  • [SAM] document the image (tensor) should be scaled between [0,1] by @scott-vsi in https://github.com/kornia/kornia/pull/2738
  • add ProjectionZ1, Orthographic, Affine, KannalaBrandt by @edgarriba in https://github.com/kornia/kornia/pull/2728
  • bump torch 2.1.2 by @johnnv1 in https://github.com/kornia/kornia/pull/2742
  • remove retrigger CI on PR's when labeled by @johnnv1 in https://github.com/kornia/kornia/pull/2744
  • rename directory: test -> tests by @johnnv1 in https://github.com/kornia/kornia/pull/2743
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2747
  • Depreciates kornia.testing by @johnnv1 in https://github.com/kornia/kornia/pull/2745
  • Add salt and pepper noise with docs and tests by @vgilabert94 in https://github.com/kornia/kornia/pull/2746
  • alphabetical order augmentations docs and add salt pepper by @edgarriba in https://github.com/kornia/kornia/pull/2757
  • Added DogHardNet LightGlue by @ducha-aiki in https://github.com/kornia/kornia/pull/2758
  • fix F841 by @johnnv1 in https://github.com/kornia/kornia/pull/2759
  • feat: differentiable jpeg by @johnnv1 in https://github.com/kornia/kornia/pull/2760
  • [CI] split coverage into multiple jobs by @johnnv1 in https://github.com/kornia/kornia/pull/2756
  • Ci: fix old torch install by @johnnv1 in https://github.com/kornia/kornia/pull/2763
  • RandomSaltAndPepperNoise: Update algorithm to use indexing by @vgilabert94 in https://github.com/kornia/kornia/pull/2762
  • add dedode descriptor B weights for lightglue by @ducha-aiki in https://github.com/kornia/kornia/pull/2769
  • skip unsupported tests cases for torch==1.9.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2770
  • remove typing report by @johnnv1 in https://github.com/kornia/kornia/pull/2765
  • Bump pytest from 7.4.4 to 8.0.0 by @dependabot in https://github.com/kornia/kornia/pull/2766
  • Ensure support to torch==2.2.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2772
  • Resize compile by @edgarriba in https://github.com/kornia/kornia/pull/2774
  • [FIX] ColorJiggle works on non-3-channel images by @shijianjian in https://github.com/kornia/kornia/pull/2767
  • Introduces benchmarks/ by @johnnv1 in https://github.com/kornia/kornia/pull/2777
  • Add [*, 3, H, W] support to Diff. JPEG by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2776
  • [test suite] add slow marker vit by @johnnv1 in https://github.com/kornia/kornia/pull/2779
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2783
  • Fix ruff 0.2.1 config by @johnnv1 in https://github.com/kornia/kornia/pull/2784
  • force solve with torch.float64 by @edgarriba in https://github.com/kornia/kornia/pull/2785
  • Fix robots for web crawlers by @edgarriba in https://github.com/kornia/kornia/pull/2790
  • Remove device from getplanckiancoeffs and register self.pl as a buffer by @Modexus in https://github.com/kornia/kornia/pull/2792
  • ViT: Load Jax augreg weights by @gau-nernst in https://github.com/kornia/kornia/pull/2786
  • docs: add not-found option by @johnnv1 in https://github.com/kornia/kornia/pull/2796
  • Feat: Support list of masks in AugmentationSequential by @johnnv1 in https://github.com/kornia/kornia/pull/2740
  • test suite: skip fp64 canny dynamo test by @johnnv1 in https://github.com/kornia/kornia/pull/2797
  • Test suite: separate losses tests into individual files by @fleventy-5 in https://github.com/kornia/kornia/pull/2801
  • Test suite: separate contrib tests into individual files by @fleventy-5 in https://github.com/kornia/kornia/pull/2802
  • Test suite: separate metrics tests into individual files by @fleventy-5 in https://github.com/kornia/kornia/pull/2805
  • Feat: add Gradient Illumination augmentations (gaussian) by @vgilabert94 in https://github.com/kornia/kornia/pull/2780
  • add missing docs for RandomGaussianIllumination by @edgarriba in https://github.com/kornia/kornia/pull/2806
  • feat: Add RandomJPEG Augmentation by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2803
  • Update augmentation.module.rst by @edgarriba in https://github.com/kornia/kornia/pull/2808
  • Add: differentiable clipping, floor and rounding functions by @jeffin07 in https://github.com/kornia/kornia/pull/2795
  • [feat] KMeans implementation by @avinashselvam in https://github.com/kornia/kornia/pull/2804
  • Bump pytest from 8.0.0 to 8.0.1 by @dependabot in https://github.com/kornia/kornia/pull/2810
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2811
  • Aug: Add simple support to dict for AugSequential by @johnnv1 in https://github.com/kornia/kornia/pull/2799
  • Bump pytest from 8.0.1 to 8.0.2 by @dependabot in https://github.com/kornia/kornia/pull/2815
  • Fix: Typo auto rand augment by @harsh1504660 in https://github.com/kornia/kornia/pull/2817
  • Fix Typo: Corrected SUBPLOLICYCONFIG to SUBPOLICYCONFIG by @harsh1504660 in https://github.com/kornia/kornia/pull/2819
  • remove image prompter in favor of visual prompter by @johnnv1 in https://github.com/kornia/kornia/pull/2814
  • Upgrade model checkpointing by @machineko in https://github.com/kornia/kornia/pull/2820
  • Update torch.inverse to torch.linalg.inv by @wangshuai09 in https://github.com/kornia/kornia/pull/2824
  • Refactor and add more palettes of colormaps by @vgilabert94 in https://github.com/kornia/kornia/pull/2794
  • feat: RandomLinearIllumination and RandomLinearCornerIllumination by @vgilabert94 in https://github.com/kornia/kornia/pull/2823
  • fix (docs): add RandomLinearIllumination and `RandomLinearCornerIll… by @johnnv1 in https://github.com/kornia/kornia/pull/2827
  • ColorMap tests coverage by @johnnv1 in https://github.com/kornia/kornia/pull/2825
  • Bump pytest from 8.0.2 to 8.1.1 by @dependabot in https://github.com/kornia/kornia/pull/2829
  • feat: augmentation sequential supports mask (B, H, W) with images (B, C, H, W) by @johnnv1 in https://github.com/kornia/kornia/pull/2800
  • fix(docs): remove Jina AI QAbot from Kornia documentation by @nan-wang in https://github.com/kornia/kornia/pull/2831
  • update kornia_rs and make sure contiguous data by @edgarriba in https://github.com/kornia/kornia/pull/2828
  • CI: ensure pytorch 2.2.1 support by @johnnv1 in https://github.com/kornia/kornia/pull/2833
  • fix visual prompter test in dynamo by @edgarriba in https://github.com/kornia/kornia/pull/2834
  • Fix of possible CPU and GPU device error by @Fleyderer in https://github.com/kornia/kornia/pull/2838
  • Add DeDoDe (clean version) by @ducha-aiki in https://github.com/kornia/kornia/pull/2835
  • bump version 0.7.2 by @edgarriba in https://github.com/kornia/kornia/pull/2832

New Contributors

  • @scott-vsi made their first contribution in https://github.com/kornia/kornia/pull/2738
  • @vgilabert94 made their first contribution in https://github.com/kornia/kornia/pull/2746
  • @Modexus made their first contribution in https://github.com/kornia/kornia/pull/2792
  • @fleventy-5 made their first contribution in https://github.com/kornia/kornia/pull/2801
  • @avinashselvam made their first contribution in https://github.com/kornia/kornia/pull/2804
  • @harsh1504660 made their first contribution in https://github.com/kornia/kornia/pull/2817
  • @machineko made their first contribution in https://github.com/kornia/kornia/pull/2820
  • @wangshuai09 made their first contribution in https://github.com/kornia/kornia/pull/2824
  • @nan-wang made their first contribution in https://github.com/kornia/kornia/pull/2831
  • @Fleyderer made their first contribution in https://github.com/kornia/kornia/pull/2838

Full Changelog: https://github.com/kornia/kornia/commits/v0.7.2

- Python
Published by edgarriba almost 2 years ago

kornia - v0.7.1

What's Changed

  • Lie groups docs update by @cjpurackal in https://github.com/kornia/kornia/pull/2495
  • Fixed RandomJigsaw #2494 by @shijianjian in https://github.com/kornia/kornia/pull/2504
  • Fixed video batching bug #2410 #2497 by @shijianjian in https://github.com/kornia/kornia/pull/2502
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2508
  • LG-test by @ducha-aiki in https://github.com/kornia/kornia/pull/2510
  • Fix docs build - sphinx==7.0.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2518
  • [feat] add right and left jacobian for So3 by @cjpurackal in https://github.com/kornia/kornia/pull/2509
  • Fix: update random_rain.py by @f-amerehi in https://github.com/kornia/kornia/pull/2514
  • Fix docs: Unpin sphinx by @johnnv1 in https://github.com/kornia/kornia/pull/2527
  • Fix tutorials links to use the github page by @johnnv1 in https://github.com/kornia/kornia/pull/2529
  • Bump accelerate from 0.21.0 to 0.22.0 by @dependabot in https://github.com/kornia/kornia/pull/2530
  • Update precommit hooks by @johnnv1 in https://github.com/kornia/kornia/pull/2521
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2528
  • Added kornia resize in object detection by @jeffin07 in https://github.com/kornia/kornia/pull/2526
  • [feat] Add transplantation augmentation by @JanSellner in https://github.com/kornia/kornia/pull/2523
  • Use grid_sample from F without importing it. by @antoinebrl in https://github.com/kornia/kornia/pull/2532
  • Clarify documentation to get shear matrices by @priba in https://github.com/kornia/kornia/pull/2533
  • Bump pytest from 7.4.0 to 7.4.1 by @dependabot in https://github.com/kornia/kornia/pull/2537
  • Add support for class data keys in AugmentationSequential by @miquelmarti in https://github.com/kornia/kornia/pull/2536
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2538
  • fix readme badges by @johnnv1 in https://github.com/kornia/kornia/pull/2539
  • Bump pytest from 7.4.1 to 7.4.2 by @dependabot in https://github.com/kornia/kornia/pull/2542
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2543
  • Bump accelerate from 0.22.0 to 0.23.0 by @dependabot in https://github.com/kornia/kornia/pull/2547
  • [feature] rt-detr onnx by @edgarriba in https://github.com/kornia/kornia/pull/2548
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2550
  • Make transforms Spawn Multiprocessing Context Friendly by @NielsPichon in https://github.com/kornia/kornia/pull/2499
  • Fix TestEqualization by @johnnv1 in https://github.com/kornia/kornia/pull/2553
  • add coverage CI by @johnnv1 in https://github.com/kornia/kornia/pull/2551
  • fixes zero division in depthfromdisparity by @edgarriba in https://github.com/kornia/kornia/pull/2556
  • Fix improper importlib.util import by @Avasam in https://github.com/kornia/kornia/pull/2558
  • Depth to 3d improvements by @edgarriba in https://github.com/kornia/kornia/pull/2557
  • fix object detection onnx by @edgarriba in https://github.com/kornia/kornia/pull/2555
  • reduce repository size (history rewriting) by @johnnv1 in https://github.com/kornia/kornia/pull/2561
  • fix typing by @edgarriba in https://github.com/kornia/kornia/pull/2563
  • Add missing tests (losses, io, connected components) by @johnnv1 in https://github.com/kornia/kornia/pull/2565
  • allow warpaffine fill numchannels other than three by @edgarriba in https://github.com/kornia/kornia/pull/2568
  • Fix depth to 3d docs by @edgarriba in https://github.com/kornia/kornia/pull/2569
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2570
  • Update augmentation.rst by @Otteri in https://github.com/kornia/kornia/pull/2584
  • fix bucket off-by-one-error by @Seanny123 in https://github.com/kornia/kornia/pull/2582
  • update version to dev by @johnnv1 in https://github.com/kornia/kornia/pull/2586
  • drop torchvision from docs deps by @johnnv1 in https://github.com/kornia/kornia/pull/2591
  • Adds 7pt solver to RANSAC by @ducha-aiki in https://github.com/kornia/kornia/pull/2595
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2596
  • [feat] Add Average Endpoint Error to Metrics by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2500
  • Add torch.jit.script support for warp_affine by @balbok0 in https://github.com/kornia/kornia/pull/2588
  • Update readthedocs.yml by @edgarriba in https://github.com/kornia/kornia/pull/2598
  • [speed up CI tests suite] Skip slow tests as default by @johnnv1 in https://github.com/kornia/kornia/pull/2587
  • Fix of multi head attention implementation by @yarkoslav in https://github.com/kornia/kornia/pull/2589
  • fix doctest by @edgarriba in https://github.com/kornia/kornia/pull/2604
  • drop cv2 as dev dependency by @johnnv1 in https://github.com/kornia/kornia/pull/2593
  • Optimize the connected components labeling algorithm by @SonyPony in https://github.com/kornia/kornia/pull/2609
  • xpass rasanc randomness tests by @johnnv1 in https://github.com/kornia/kornia/pull/2613
  • #2348 Fix bug in ycbcrtorgb function by @juliaaz in https://github.com/kornia/kornia/pull/2610
  • bump pytorch version to 2.1.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2605
  • add deps info to tests header by @johnnv1 in https://github.com/kornia/kornia/pull/2585
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2616
  • xfail TestRandAugment::testtransformmat based in torch version by @johnnv1 in https://github.com/kornia/kornia/pull/2617
  • Ensure python 3.11 support by @johnnv1 in https://github.com/kornia/kornia/pull/2606
  • Fix incorrect computation of affine shear matrix around center point by @Vihtoriaaa in https://github.com/kornia/kornia/pull/2608
  • Add alias 'averageendpointerror' for aepe method by @be-unkind in https://github.com/kornia/kornia/pull/2615
  • skip dynamo test for py311 torch 2.0.x by @johnnv1 in https://github.com/kornia/kornia/pull/2621
  • expose average_endpoint_error metric by @johnnv1 in https://github.com/kornia/kornia/pull/2620
  • replace deprecated prompter test and fix skiping dynamo test by @johnnv1 in https://github.com/kornia/kornia/pull/2623
  • Update docs CI by @johnnv1 in https://github.com/kornia/kornia/pull/2624
  • Add differentiable 5PC (five point algorithm) for essential matrix estimation by @weitong8591 in https://github.com/kornia/kornia/pull/2580
  • add RandomClahe by @michael-2956 in https://github.com/kornia/kornia/pull/2614
  • [feat] Add NamedPose by @cjpurackal in https://github.com/kornia/kornia/pull/2482
  • Fix visual prompter bug (#2627) by @kaftanski in https://github.com/kornia/kornia/pull/2630
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2632
  • [feat] Raw to rgb conversion with downscaling by @bogdanmagometa in https://github.com/kornia/kornia/pull/2629
  • feat: LightGlue-ONNX by @fabio-sim in https://github.com/kornia/kornia/pull/2631
  • Drop scipy from dev dependencies by @johnnv1 in https://github.com/kornia/kornia/pull/2634
  • fix: docs: OnnxLightGlue by @fabio-sim in https://github.com/kornia/kornia/pull/2635
  • Bump pytest from 7.4.2 to 7.4.3 by @dependabot in https://github.com/kornia/kornia/pull/2641
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2644
  • Bump accelerate from 0.23.0 to 0.24.1 by @dependabot in https://github.com/kornia/kornia/pull/2645
  • Make use of composition for augmentation multiprocessing friendliness by @johnnv1 in https://github.com/kornia/kornia/pull/2637
  • Rename variables shadowing build-in input function by @alorthius in https://github.com/kornia/kornia/pull/2628
  • addopt ruff formatter by @johnnv1 in https://github.com/kornia/kornia/pull/2638
  • add deprecated decorator depth_to_3d by @johnnv1 in https://github.com/kornia/kornia/pull/2636
  • Add EfficientViT model by @edgarriba in https://github.com/kornia/kornia/pull/2607
  • feat: CPU support for OnnxLightGlue by @fabio-sim in https://github.com/kornia/kornia/pull/2643
  • Typo fix in focal.py by @omerferhatt in https://github.com/kornia/kornia/pull/2654
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2653
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2660
  • Doc Fix: lafs2 shape in matchers by @maxc303 in https://github.com/kornia/kornia/pull/2663
  • skip TestEfficientViT::testsmokelarge for torch lower than 2.0.0 by @edgarriba in https://github.com/kornia/kornia/pull/2664
  • fix unused type ignore by @johnnv1 in https://github.com/kornia/kornia/pull/2666
  • Bump pytorch to 2.1.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2667
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2669
  • Allow CombineTensorPatches to work with overlapping patches by @ashnair1 in https://github.com/kornia/kornia/pull/2650
  • kornia.nerf improvements by @edgarriba in https://github.com/kornia/kornia/pull/2661
  • improve nerf docs by @edgarriba in https://github.com/kornia/kornia/pull/2673
  • refactor kornia geometry to use kornia core rather than torch. Part 1… by @Tchaikovic in https://github.com/kornia/kornia/pull/2676
  • move onnxruntime to x requirements by @johnnv1 in https://github.com/kornia/kornia/pull/2670
  • Multiplication with torch.ones not needed for kernel_values by @kunaltyagi in https://github.com/kornia/kornia/pull/2678
  • Bump accelerate from 0.24.1 to 0.25.0 by @dependabot in https://github.com/kornia/kornia/pull/2677
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2679
  • fix a typo, change "perpenducular" into "perpendicular" by @cherichy in https://github.com/kornia/kornia/pull/2680
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2683
  • Doc fix for padding arg in extract_patches by @ashnair1 in https://github.com/kornia/kornia/pull/2686
  • Add from / to euler angle in Quaternion by @Tchaikovic in https://github.com/kornia/kornia/pull/2682
  • Reduce multiplication in calculating positive and negative angle indices for canny by @kunaltyagi in https://github.com/kornia/kornia/pull/2687
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2693
  • Release 0.7.2 by @edgarriba in https://github.com/kornia/kornia/pull/2696
  • downgrade version to 0.7.1 by @edgarriba in https://github.com/kornia/kornia/pull/2700

New Contributors

  • @f-amerehi made their first contribution in https://github.com/kornia/kornia/pull/2514
  • @antoinebrl made their first contribution in https://github.com/kornia/kornia/pull/2532
  • @NielsPichon made their first contribution in https://github.com/kornia/kornia/pull/2499
  • @Avasam made their first contribution in https://github.com/kornia/kornia/pull/2558
  • @Otteri made their first contribution in https://github.com/kornia/kornia/pull/2584
  • @Seanny123 made their first contribution in https://github.com/kornia/kornia/pull/2582
  • @balbok0 made their first contribution in https://github.com/kornia/kornia/pull/2588
  • @yarkoslav made their first contribution in https://github.com/kornia/kornia/pull/2589
  • @SonyPony made their first contribution in https://github.com/kornia/kornia/pull/2609
  • @juliaaz made their first contribution in https://github.com/kornia/kornia/pull/2610
  • @Vihtoriaaa made their first contribution in https://github.com/kornia/kornia/pull/2608
  • @be-unkind made their first contribution in https://github.com/kornia/kornia/pull/2615
  • @weitong8591 made their first contribution in https://github.com/kornia/kornia/pull/2580
  • @michael-2956 made their first contribution in https://github.com/kornia/kornia/pull/2614
  • @kaftanski made their first contribution in https://github.com/kornia/kornia/pull/2630
  • @bogdanmagometa made their first contribution in https://github.com/kornia/kornia/pull/2629
  • @fabio-sim made their first contribution in https://github.com/kornia/kornia/pull/2631
  • @alorthius made their first contribution in https://github.com/kornia/kornia/pull/2628
  • @omerferhatt made their first contribution in https://github.com/kornia/kornia/pull/2654
  • @maxc303 made their first contribution in https://github.com/kornia/kornia/pull/2663
  • @Tchaikovic made their first contribution in https://github.com/kornia/kornia/pull/2676
  • @cherichy made their first contribution in https://github.com/kornia/kornia/pull/2680

Full Changelog: https://github.com/kornia/kornia/compare/v0.7.0...v0.7.1

- Python
Published by edgarriba about 2 years ago

kornia - v0.7.0 Image API, RT-DETR and Object Detection API, LightGlue Matcher, MobileSam, new Sensors API and many more

Highlights

Image API

In this release we have added a new Image API as placeholder to support a more generic multibackend api. You can export/import from files, numpy and dlapck.

```python

from a torch.tensor

data = torch.randint(0, 255, (3, 4, 5), dtype=torch.uint8) # CxHxW pixelformat = PixelFormat( ... colorspace=ColorSpace.RGB, ... bitdepth=8, ... ) layout = ImageLayout( ... imagesize=ImageSize(4, 5), ... channels=3, ... channelsorder=ChannelsOrder.CHANNELSFIRST, ... ) img = Image(data, pixel_format, layout) assert img.channels == 3 ```

Object Detection API

We have added the ObjectDetector that includes by default the RT-DETR model. The detection pipeline is fully configurable by supplying a pre-processor, a model, and a post-processor. Example usage is shown below.

```python from io import BytesIO

import cv2 import numpy as np import requests import torch from PIL import Image import matplotlib.pyplot as plt

from kornia.contrib.models.rtdetr import RTDETR, DETRPostProcessor, RTDETRConfig from kornia.contrib.objectdetection import ObjectDetector, ResizePreProcessor

modeltype = "hgnetv2x" # also available: resnet18d, resnet34d, resnet50d, resnet101d, hgnetv2l checkpoint = f"https://github.com/kornia/kornia/releases/download/v0.7.0/rtdetr{modeltype}.ckpt" config = RTDETRConfig(modeltype, 80, checkpoint=checkpoint) model = RTDETR.from_config(config).eval()

detector = ObjectDetector(model, ResizePreProcessor(640), DETRPostProcessor(0.3))

url = "https://github.com/kornia/data/raw/main/soccer.jpg" img = Image.open(BytesIO(requests.get(url).content)) img = np.asarray(img, dtype=np.float32) / 255 imgpt = torch.fromnumpy(img).permute(2, 0, 1) detection = detector.predict([img_pt])

for clsscorexywh in detection[0].numpy(): classid = int(clsscorexywh[0]) score = clsscorexywh[1] x, y, w, h = clsscore_xywh[2:].round().astype(int) cv2.rectangle(img, (x, y, w, h), (255, 0, 0), 3)

text = f"{class_id}, {score:.2f}"
font = cv2.FONT_HERSHEY_SIMPLEX
(text_width, text_height), _ = cv2.getTextSize(text, font, 1, 2)
cv2.rectangle(img, (x, y - text_height, text_width, text_height), (255, 0, 0), cv2.FILLED)
cv2.putText(img, text, (x, y), font, 1, (255, 255, 255), 2)

plt.imshow(img) plt.show() ```

img

Deep Models

As part of the kornia.contrib module, we started building a models module where Deep Learning models for Computer Vision (Semantic Segmentation, Object Detection, etc.) will exist.

From an abstract base class ModelBase, we will implement and make available these deep learning models (eg Segment anything). Similarly, we provide standard structures to be used with the results of these models such as SegmentationResults.

The idea is that we can abstract and standardize how these models will behave with our High level APIs. Like for example interacting with the Visual Prompter backend (today Segment Anything is available).

ModelBase provides methods for loading checkpoints (load_checkpoint), and compiling itself via the torch.compile API. And we plan to increase it according to the needs of the community.

Within this release, we are also making other models available to be used like RT_DETR and tiny_vit.

Example of using these abstractions to implement a model:

```python

Each model should be a submodule inside the kornia.contrib.models, and the Model class itself will be exposed under this

models module.

from kornia.contrib.models.base import ModelBase from dataclasses import dataclass from kornia.contrib.models.structures import SegmentationResults from enum import Enum

class MyModelType(Enum): """Map the model types.""" a = 0 ...

@dataclass class MyModelConfig: model_type: str | int | SamModelType | None = None checkpoint: str | None = None ...

class MyModel(ModelBase[MyModelConfig]): def init(...) -> None: ...

@staticmethod
def from_config(config: MyModelConfig) -> MyModel:
    """Build the model based on the config"""
    ...

def forward(...) -> SegmentationResults:
    ...

```

RT-DETR

In most object detection models, non-maximum suppression (NMS) is necessary to remove overlapping and similar bounding boxes. This post-processing algorithm has high latency, preventing object detectors from reaching real-time speed. DETR is a new class of detectors that eliminate NMS step by using transformer decoder to directly predict bounding boxes. RT-DETR enhances Deformable DETR to achieve real-time speed on server-class GPUs by using an efficient backbone. More details can be seen here

TinyViT

TinyViT is an efficient and high-performing transformer model for images. It achieves a top-1 accuracy of 84.8% on ImageNet-1k with only 21M parameters. See TinyViT for more information.

MobileSAM

MobileSAM replaces the heavy ViT-H backbone in the original SAM with TinyViT, which is more than 100 times smaller in terms of parameters and around 40 times faster in terms of inference speed. See MobileSAM for more details.

To use MobileSAM, simply specify "mobile_sam" in the SamConfig:

```python from kornia.contrib.visual_prompter import VisualPrompter from kornia.contrib.models.sam import SamConfig

prompter = VisualPrompter(SamConfig("mobile_sam", pretrained=True)) ```

LightGlue matcher

Added the LightGlue LightGlue-based matcher in kornia API. This is based on the original code from paper “LightGlue: Local Feature Matching at Light Speed”. See [LSP23] for more details.

The LightGlue algorithm won a money prize in the Image Matching Challenge 2023 @ CVPR23: https://www.kaggle.com/competitions/image-matching-challenge-2023/overview

See a working example integrating with COLMAP: https://github.com/kornia/kornia/discussions/2469 image

New Sensors API

New kornia.sensors module to interface with sensors like Camera, IMU, GNSS etc.

We added CameraModel , PinholeModel , CameraModelBase for now.

Usage example:

Define a CameraModel

```python

Pinhole Camera Model

cam = CameraModel(ImageSize(480, 640), CameraModelType.PINHOLE, torch.Tensor([328., 328., 320., 240.]))

Brown Conrady Camera Model

cam = CameraModel(ImageSize(480, 640), CameraModelType.BROWN_CONRADY, torch.Tensor([1.0, 1.0, 1.0, 1.0, ... 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]))

Kannala Brandt K3 Camera Model

cam = CameraModel(ImageSize(480, 640), CameraModelType.KANNALABRANDTK3, torch.Tensor([1.0, 1.0, 1.0, ... 1.0, 1.0, 1.0, 1.0, 1.0]))

Orthographic Camera Model

cam = CameraModel(ImageSize(480, 640), CameraModelType.ORTHOGRAPHIC, torch.Tensor([328., 328., 320., 240.])) cam.params tensor([328., 328., 320., 240.]) ```

Added kornia.geometry.solvers submodule

New module for geometric vision solvers that include the following: - solve_quadratic - solve_cubic

This is part of an upgrade of the find_fundamental to support the 7POINT algorithm.

Image terminal printing

Added kornia.utils.print_image API for printing any given image tensors or image path to terminal.

```python

kornia.utils.print_image("panda.jpg") ``` Screenshot 2023-07-26 at 11 39 00 PM

What's Changed

  • fix skipped tests for cuda TestColorJiggleGen by @johnnv1 in https://github.com/kornia/kornia/pull/2341
  • remove inplace operation by @Parskatt in https://github.com/kornia/kornia/pull/2346
  • Replace bandit, flake8, isort, pyupgrade, and yesqa with ruff by @cclauss in https://github.com/kornia/kornia/pull/2292
  • fix unused import on geometry.conversions by @johnnv1 in https://github.com/kornia/kornia/pull/2357
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2345
  • Visual prompter by @edgarriba in https://github.com/kornia/kornia/pull/2356
  • Integrate vector to liegroups by @cjpurackal in https://github.com/kornia/kornia/pull/2344
  • add fromwxyz and fromqxyz to So3 and Se3 by @cjpurackal in https://github.com/kornia/kornia/pull/2359
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2360
  • RandomGrayscale: add rgb_weights parameter by @adamjstewart in https://github.com/kornia/kornia/pull/2361
  • add support for tuple of types on KORNIACHECKTYPE + bug fix by @cjpurackal in https://github.com/kornia/kornia/pull/2353
  • Remove examples in favor of kornia/tutorials repo by @johnnv1 in https://github.com/kornia/kornia/pull/2366
  • add tutorials testing ci by @johnnv1 in https://github.com/kornia/kornia/pull/2367
  • Update version to 0.6.13-dev by @johnnv1 in https://github.com/kornia/kornia/pull/2368
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2370
  • Optional raise in kornia check functions by @alex-jw-brooks in https://github.com/kornia/kornia/pull/2375
  • remove unused circle ci by @johnnv1 in https://github.com/kornia/kornia/pull/2378
  • Bump accelerate from 0.18.0 to 0.19.0 by @dependabot in https://github.com/kornia/kornia/pull/2381
  • Replace miniconda for setup-python@v4 on env setup CI by @johnnv1 in https://github.com/kornia/kornia/pull/2380
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2382
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2388
  • Use separable filter for SSIM calculation to speed up. by @dodobyte in https://github.com/kornia/kornia/pull/2383
  • Bump pytest-cov from 4 to 4.1.0 by @dependabot in https://github.com/kornia/kornia/pull/2392
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2394
  • Batched quaternion to matrix by @jatentaki in https://github.com/kornia/kornia/pull/2395
  • Batched draw_lines by @cjpurackal in https://github.com/kornia/kornia/pull/2373
  • Fix AugmentationSequential support for RandomResizedCrop by @adamjstewart in https://github.com/kornia/kornia/pull/2398
  • drop python 3.7 support by @johnnv1 in https://github.com/kornia/kornia/pull/2400
  • Bump accelerate from 0.19.0 to 0.20.3 by @dependabot in https://github.com/kornia/kornia/pull/2402
  • Bump pytest from 7.3.1 to 7.3.2 by @dependabot in https://github.com/kornia/kornia/pull/2401
  • Makefile: Drop Python code formatter yapf in favor of psf/black by @cclauss in https://github.com/kornia/kornia/pull/2404
  • update the kornia governance page by @edgarriba in https://github.com/kornia/kornia/pull/2403
  • Update readthedocs.yml with python 3.8 by @edgarriba in https://github.com/kornia/kornia/pull/2406
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2408
  • Add collector job on CI PR's, reusable typing CI and remove unused CI by @johnnv1 in https://github.com/kornia/kornia/pull/2379
  • remove old artefacts in visual_prompting.rst by @edgarriba in https://github.com/kornia/kornia/pull/2409
  • use reshape instead view to convert matrix from quaternion by @edgarriba in https://github.com/kornia/kornia/pull/2413
  • Revamped camera API(introduce kornia.sensors) by @cjpurackal in https://github.com/kornia/kornia/pull/2349
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2415
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2418
  • Bump pytest from 7.3.2 to 7.4.0 by @dependabot in https://github.com/kornia/kornia/pull/2416
  • Fix PLR0124 by @ashnair1 in https://github.com/kornia/kornia/pull/2422
  • Add missing docs for warp_grid by @edgarriba in https://github.com/kornia/kornia/pull/2423
  • Add GPU support apple silicon augmentation 2D by @NripeshN in https://github.com/kornia/kornia/pull/2425
  • Add mps to testing init and fixing test cases by @NripeshN in https://github.com/kornia/kornia/pull/2428
  • drop JIT support from geometry.conversions by @johnnv1 in https://github.com/kornia/kornia/pull/2424
  • Update rst(docs) files to support MPS by @NripeshN in https://github.com/kornia/kornia/pull/2430
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2429
  • fix engine arg missing in opening and closing by @wintertee in https://github.com/kornia/kornia/pull/2431
  • Added terminal printing by @shijianjian in https://github.com/kornia/kornia/pull/2407
  • add support for quaternion in Se3 instantiation by @cjpurackal in https://github.com/kornia/kornia/pull/2433
  • fix missing assertion by @qingpeng9802 in https://github.com/kornia/kornia/pull/2435
  • Add RT-DETR and ObjectDetection API by @gau-nernst in https://github.com/kornia/kornia/pull/2363
  • Update ruff configs by @johnnv1 in https://github.com/kornia/kornia/pull/2358
  • Use ruff to discover and limit code complexity by @cclauss in https://github.com/kornia/kornia/pull/2442
  • Apply some ruff pytest fixes by @cclauss in https://github.com/kornia/kornia/pull/2444
  • Remove deprecated code from kornia.geometry.conversion by @pri1311 in https://github.com/kornia/kornia/pull/2437
  • Python linting: Add more ruff rules by @cclauss in https://github.com/kornia/kornia/pull/2441
  • fix the alpha of focal loss by @qingpeng9802 in https://github.com/kornia/kornia/pull/2393
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2448
  • Enable disallow_untyped_defs on mypy by @johnnv1 in https://github.com/kornia/kornia/pull/2252
  • Adding LightGlue by @ducha-aiki in https://github.com/kornia/kornia/pull/2449
  • Add MobileSAM by @gau-nernst in https://github.com/kornia/kornia/pull/2446
  • Make TinyViT available as a standalone image classifier by @gau-nernst in https://github.com/kornia/kornia/pull/2455
  • Add doc for MobileSAM by @gau-nernst in https://github.com/kornia/kornia/pull/2458
  • Add 7 point algorithm by @anandhupvr in https://github.com/kornia/kornia/pull/2390
  • Add pre-trained flag for SAM by @gau-nernst in https://github.com/kornia/kornia/pull/2456
  • Add Image API by @edgarriba in https://github.com/kornia/kornia/pull/1562
  • Fix auto augmentation transformation matrix by @shijianjian in https://github.com/kornia/kornia/pull/2355
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2462
  • Fix some docs by @qingpeng9802 in https://github.com/kornia/kornia/pull/2461
  • fix aug sharpness duplicated typing by @johnnv1 in https://github.com/kornia/kornia/pull/2468
  • axis_angle typo fix by @cjpurackal in https://github.com/kornia/kornia/pull/2463
  • solvers : Separating General Functionalities(polynomial solver) into solvers Submodule by @anandhupvr in https://github.com/kornia/kornia/pull/2465
  • kornia.sensors docs update by @cjpurackal in https://github.com/kornia/kornia/pull/2477
  • Fix KORNIA_CHECK_SAME_DEVICE cuda test by @johnnv1 in https://github.com/kornia/kornia/pull/2479
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2472
  • Bump accelerate from 0.20.3 to 0.21.0 by @dependabot in https://github.com/kornia/kornia/pull/2459
  • [feat] from_matrix for Se3 and Se2 by @cjpurackal in https://github.com/kornia/kornia/pull/2473
  • Add draw point2d by @alex-jw-brooks in https://github.com/kornia/kornia/pull/2387
  • [CI] bump pytorch to 2.0.1 by @johnnv1 in https://github.com/kornia/kornia/pull/2369
  • include print image in the Image API by @edgarriba in https://github.com/kornia/kornia/pull/2481
  • Fix typo SAM docs by @johnnv1 in https://github.com/kornia/kornia/pull/2483
  • kornia.geometry.solvers (polynomial_solvers) docs by @anandhupvr in https://github.com/kornia/kornia/pull/2484
  • fix image print docs by @edgarriba in https://github.com/kornia/kornia/pull/2488
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2491
  • Add missing docs for new PinholeModel camera model by @edgarriba in https://github.com/kornia/kornia/pull/2492
  • bump version 0.7.0 by @edgarriba in https://github.com/kornia/kornia/pull/2476

New Contributors

  • @alex-jw-brooks made their first contribution in https://github.com/kornia/kornia/pull/2375
  • @dodobyte made their first contribution in https://github.com/kornia/kornia/pull/2383
  • @NripeshN made their first contribution in https://github.com/kornia/kornia/pull/2425
  • @wintertee made their first contribution in https://github.com/kornia/kornia/pull/2431
  • @qingpeng9802 made their first contribution in https://github.com/kornia/kornia/pull/2435
  • @anandhupvr made their first contribution in https://github.com/kornia/kornia/pull/2390

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.12...v0.7.0

- Python
Published by edgarriba over 2 years ago

kornia - v0.6.12 ImagePrompter API (SAM), Guided Filter and bugfixes

Highlights

ImagePrompter API

In this release we have added a new ImagePrompter API that settles the basis as a foundational api for the task to query geometric information to images inspired by LLM. We leverage the ImagePrompter API via the Segment Anything (SAM) making the model more accessible, packaged and well maintained for industry standards.

Check the full tutorial: https://github.com/kornia/tutorials/blob/master/nbs/image_prompter.ipynb

```python import kornia as K from kornia.contrib.image_prompter import ImagePrompter from kornia.geometry.keypoints import Keypoints from kornia.geometry.boxes import Boxes

image: Tensor = K.io.load_image("soccer.jpg", ImageLoadType.RGB32, "cuda")

Load the prompter

prompter = ImagePrompter(config, device="cuda")

set the image: This will preprocess the image and already generate the embeddings of it

prompter.set_image(image)

Generate the prompts

keypoints = Keypoints(torch.tensor([[[500, 375]]], device="cuda")) # BxNx2

For the keypoints label: 1 indicates a foreground point; 0 indicates a background point

keypoints_labels = torch.tensor([[1]], device="cuda") # BxN boxes = Boxes( torch.tensor([[[[425, 600], [425, 875], [700, 600], [700, 875]]]], device="cuda"), mode='xyxy' )

Runs the prediction with all prompts

prediction = prompter.predict( keypoints=keypoints, keypointslabels=keypointslabels, boxes=boxes, multimask_output=True, ) ```

image

Guided Blurring

Blur images by preserving edges via Bilateral and Guided Blurring -> https://kornia.readthedocs.io/en/latest/filters.html#kornia.filters.guided_blur

image

What's Changed

  • Fixed typo in face_detection.rst by @Aneesh02 in https://github.com/kornia/kornia/pull/2308
  • Fix elastic transformation if only partially applied by @JanSellner in https://github.com/kornia/kornia/pull/2303
  • Fix current typing errors by @johnnv1 in https://github.com/kornia/kornia/pull/2305
  • remove numpy link from image utils by @johnnv1 in https://github.com/kornia/kornia/pull/2306
  • Update io.rst with ImageLoadType by @edgarriba in https://github.com/kornia/kornia/pull/2309
  • improve local feature orientation by @ducha-aiki in https://github.com/kornia/kornia/pull/2310
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2266
  • fix: Fix links to CONTRIBUTING.md by @timleslie in https://github.com/kornia/kornia/pull/2312
  • Fix readme links by @johnnv1 in https://github.com/kornia/kornia/pull/2311
  • Bump pytest from 7.2.2 to 7.3.0 by @dependabot in https://github.com/kornia/kornia/pull/2316
  • Update nerf test to use kornia/data by @johnnv1 in https://github.com/kornia/kornia/pull/2319
  • Fix pos_weight in focal loss by @roytseng-tw in https://github.com/kornia/kornia/pull/2323
  • Fix bugs in Bilateral filter tests by @gau-nernst in https://github.com/kornia/kornia/pull/2320
  • Add Guided filter by @gau-nernst in https://github.com/kornia/kornia/pull/2322
  • Bump pytest from 7.3.0 to 7.3.1 by @dependabot in https://github.com/kornia/kornia/pull/2327
  • Fix kernel size ordering by @gau-nernst in https://github.com/kornia/kornia/pull/2326
  • update url collect_env.py by @edgarriba in https://github.com/kornia/kornia/pull/2329
  • Fixes LAF visualization due to kornia_moons update by @ducha-aiki in https://github.com/kornia/kornia/pull/2331
  • add keypoints to the docs by @johnnv1 in https://github.com/kornia/kornia/pull/2330
  • Fix missing file keypoints docs by @johnnv1 in https://github.com/kornia/kornia/pull/2332
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2318
  • Ensure support to torch 2.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2272
  • Use separable filter2d for box filter by @gau-nernst in https://github.com/kornia/kornia/pull/2328
  • [feat] add segment anything base by @johnnv1 in https://github.com/kornia/kornia/pull/2315
  • make api docs more visible by @edgarriba in https://github.com/kornia/kornia/pull/2334

New Contributors

  • @Aneesh02 made their first contribution in https://github.com/kornia/kornia/pull/2308
  • @timleslie made their first contribution in https://github.com/kornia/kornia/pull/2312
  • @roytseng-tw made their first contribution in https://github.com/kornia/kornia/pull/2323

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.11...v0.6.12

- Python
Published by edgarriba almost 3 years ago

kornia - v0.6.11 DISK local features, new augmentations and bugfixes

Highlights

In this release we have added DISK, which is the best free local feature for 3D reconstruction. (part of winning solutions in IMC2021 together with SuperGlue). Thanks to @jatentaki for the great work and relicensing the DISK to Apache 2!

```python3 import kornia.feature as KF

disk = KF.DISK.frompretrained('depth').to(device) with torch.inferencemode(): inp = torch.cat([img1, img2], dim=0) features1, features2 = disk(inp, 2048, padifnotdivisible=True) kps1, descs1 = features1.keypoints, features1.descriptors kps2, descs2 = features2.keypoints, features2.descriptors dists, idxs = KF.matchsmnn(descs1, descs2, 0.98) ``` image

What's Changed

  • Release 0.6.10 by @edgarriba in https://github.com/kornia/kornia/pull/2212
  • Update contributing guide by @johnnv1 in https://github.com/kornia/kornia/pull/2217
  • Fix RandomGaussianBlur error when sigma is passed as a tensor. by @juliendenize in https://github.com/kornia/kornia/pull/2220
  • Separate gradcheck for test_conversions by @ducha-aiki in https://github.com/kornia/kornia/pull/2223
  • Drop JIT support for core.check, Boxes, and some others by @johnnv1 in https://github.com/kornia/kornia/pull/2219
  • PEP621: Move more configuration into pyproject.toml by @cclauss in https://github.com/kornia/kornia/pull/2225
  • enable disallow_incomplete_defs on mypy by @johnnv1 in https://github.com/kornia/kornia/pull/2094
  • Update tensor equality tests to useassert_close() by @gau-nernst in https://github.com/kornia/kornia/pull/2233
  • Feat/random median blur by @DariaMinieieva in https://github.com/kornia/kornia/pull/2234
  • Clean up metadata and fix requirements by @johnnv1 in https://github.com/kornia/kornia/pull/2232
  • Feat/random snow by @just1ce415 in https://github.com/kornia/kornia/pull/2229
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2236
  • add random snow and median blur to docs by @edgarriba in https://github.com/kornia/kornia/pull/2238
  • Use more pythonic expressions in rgb to hls by @alinamuliak in https://github.com/kornia/kornia/pull/2235
  • Fix typo in doc for RandAugment by @gau-nernst in https://github.com/kornia/kornia/pull/2243
  • Add bilateral filter by @gau-nernst in https://github.com/kornia/kornia/pull/2242
  • Feature LAF docs fix by @ducha-aiki in https://github.com/kornia/kornia/pull/2245
  • Drop JIT support for geometry.subpix by @johnnv1 in https://github.com/kornia/kornia/pull/2253
  • small cleanup on root files by @johnnv1 in https://github.com/kornia/kornia/pull/2251
  • Add Joint Bilateral Filter by @gau-nernst in https://github.com/kornia/kornia/pull/2249
  • Remove Re-definition found for builtin input function - Update tests by @alexg-lviv in https://github.com/kornia/kornia/pull/2255
  • Bump pytest from 7.2.1 to 7.2.2 by @dependabot in https://github.com/kornia/kornia/pull/2256
  • fix extract_patches and consequent bugs by @ducha-aiki in https://github.com/kornia/kornia/pull/2262
  • Remove typecheck for 2D kernel size on filters by @johnnv1 in https://github.com/kornia/kornia/pull/2259
  • Bump accelerate from 0.16 to 0.17.0 by @dependabot in https://github.com/kornia/kornia/pull/2265
  • Feat/dice loss averaging by @ViriAldi in https://github.com/kornia/kornia/pull/2264
  • Fix SOLD2 on CUDA by @ducha-aiki in https://github.com/kornia/kornia/pull/2270
  • Fix Normalize with integer inputs by @adamjstewart in https://github.com/kornia/kornia/pull/2269
  • Add warnings as error on documentation build by @johnnv1 in https://github.com/kornia/kornia/pull/2273
  • Bump accelerate from 0.17.0 to 0.17.1 by @dependabot in https://github.com/kornia/kornia/pull/2280
  • add batchsquarednorm to kornia/geometry/linalg all by @xoiga123 in https://github.com/kornia/kornia/pull/2279
  • remove numpy dependency by @edgarriba in https://github.com/kornia/kornia/pull/2277
  • Update release workflow by @edgarriba in https://github.com/kornia/kornia/pull/2278
  • Fix/diamond square normalize by @hennels in https://github.com/kornia/kornia/pull/2283
  • Add Random rain augmentation by @BohdanVey in https://github.com/kornia/kornia/pull/2268
  • Add typehints for kornia.geometry.linalg.inverse_transformation by @xoiga123 in https://github.com/kornia/kornia/pull/2286
  • Bump accelerate from 0.17.1 to 0.18.0 by @dependabot in https://github.com/kornia/kornia/pull/2289
  • [WIP] Integrating DISK by @jatentaki in https://github.com/kornia/kornia/pull/2285
  • Add releases 0.6.6 - 0.6.10 to Changelog by @ducha-aiki in https://github.com/kornia/kornia/pull/2295
  • fix the padding bug 32 -> 16 by @ducha-aiki in https://github.com/kornia/kornia/pull/2294
  • expose DISKFeatures structure by @ducha-aiki in https://github.com/kornia/kornia/pull/2297
  • added conv-mode to filter2d by @ducha-aiki in https://github.com/kornia/kornia/pull/2271
  • Disk features docs by @jatentaki in https://github.com/kornia/kornia/pull/2299
  • Remove print contrast by @juliendenize in https://github.com/kornia/kornia/pull/2291
  • [bugfix] make adalam work w/o scale and ori by @ducha-aiki in https://github.com/kornia/kornia/pull/2300
  • Bump version for 0.6.11 release by @ducha-aiki in https://github.com/kornia/kornia/pull/2296

New Contributors

  • @gau-nernst made their first contribution in https://github.com/kornia/kornia/pull/2233
  • @DariaMinieieva made their first contribution in https://github.com/kornia/kornia/pull/2234
  • @just1ce415 made their first contribution in https://github.com/kornia/kornia/pull/2229
  • @alinamuliak made their first contribution in https://github.com/kornia/kornia/pull/2235
  • @alexg-lviv made their first contribution in https://github.com/kornia/kornia/pull/2255
  • @ViriAldi made their first contribution in https://github.com/kornia/kornia/pull/2264
  • @xoiga123 made their first contribution in https://github.com/kornia/kornia/pull/2279
  • @hennels made their first contribution in https://github.com/kornia/kornia/pull/2283
  • @BohdanVey made their first contribution in https://github.com/kornia/kornia/pull/2268

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.10...v0.6.11

- Python
Published by ducha-aiki almost 3 years ago

kornia - v0.6.10 Auto Augmentations module, apply_colormap, disparity utitlities, start to support torchdynamo and MUCH more

What's Changed

  • add depth_from_disparity function by @pri1311 in https://github.com/kornia/kornia/pull/2096
  • update config tests by @johnnv1 in https://github.com/kornia/kornia/pull/2107
  • update CI nightly by @johnnv1 in https://github.com/kornia/kornia/pull/2106
  • Fix AugmentationSequential to return list of boxes by @johnnv1 in https://github.com/kornia/kornia/pull/2114
  • Bump pytorch version by @johnnv1 in https://github.com/kornia/kornia/pull/2100
  • add PadTo to docs by @johnnv1 in https://github.com/kornia/kornia/pull/2122
  • add colormap and apply_ColorMap for integer tensor by @johnnv1 in https://github.com/kornia/kornia/pull/1996
  • Fix numerical stability for binary focal loss by @zimka in https://github.com/kornia/kornia/pull/2125
  • Add RandomGaussianBlur with instance-level gaussian kernel generation by @juliendenize in https://github.com/kornia/kornia/pull/1663
  • add transparent pad to CenterCrop docs example by @johnnv1 in https://github.com/kornia/kornia/pull/2124
  • Fix support for (*, 3, H, W) tensors in yuv by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2108
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2113
  • Ensure support to Python 3.9 and 3.10 by @johnnv1 in https://github.com/kornia/kornia/pull/2025
  • Add Vector2 by @cjpurackal in https://github.com/kornia/kornia/pull/2134
  • Add 3D-SSIM loss by @pri1311 in https://github.com/kornia/kornia/pull/2130
  • Fix different warning and errors when building doc by @johnnv1 in https://github.com/kornia/kornia/pull/2127
  • Add Common Regression Losses by @ChristophReich1996 in https://github.com/kornia/kornia/pull/2109
  • fix TensorWrapper serialization by @edgarriba in https://github.com/kornia/kornia/pull/2132
  • Run nightly CI just with labeled PR by @johnnv1 in https://github.com/kornia/kornia/pull/2128
  • Split the half precision tests workflow by @johnnv1 in https://github.com/kornia/kornia/pull/2118
  • move deps to setup.py by @johnnv1 in https://github.com/kornia/kornia/pull/2137
  • move tests workflow to reusable workflow by @johnnv1 in https://github.com/kornia/kornia/pull/2133
  • rename to have the right readme at front page by @johnnv1 in https://github.com/kornia/kornia/pull/2141
  • Fixe DoG accuracy, add upscale_double by @vicsyl in https://github.com/kornia/kornia/pull/2105
  • Update nightly labeled condition by @johnnv1 in https://github.com/kornia/kornia/pull/2140
  • improve TestUpscaleDouble by @johnnv1 in https://github.com/kornia/kornia/pull/2147
  • fix adalam tests for py310 by @johnnv1 in https://github.com/kornia/kornia/pull/2145
  • add fail-fast:false as default on tests workflow by @johnnv1 in https://github.com/kornia/kornia/pull/2146
  • Added Face detection Interactive demo by @jeffin07 in https://github.com/kornia/kornia/pull/2142
  • Bump pytest from 7.2.0 to 7.2.1 by @dependabot in https://github.com/kornia/kornia/pull/2148
  • add SSIM3D and depth_from_disparity to docs by @pri1311 in https://github.com/kornia/kornia/pull/2150
  • Explicitly cast output to input type to avoid type mismatch errors by @JanSellner in https://github.com/kornia/kornia/pull/1842
  • Fix params computation for LongestMaxSize and SmallestMaxSize by @johnnv1 in https://github.com/kornia/kornia/pull/2131
  • torchversiongeq -> torchversionge according to todo by @ducha-aiki in https://github.com/kornia/kornia/pull/2157
  • fix doc build - sphinx-autodoc-typehints==1.21.3 by @johnnv1 in https://github.com/kornia/kornia/pull/2159
  • ScaleSpaceDetector -> Fast ScaleSpaceDetector by @ducha-aiki in https://github.com/kornia/kornia/pull/2154
  • Improve losses tests, add TestSSIM3d, and BaseTester.gradcheck by @johnnv1 in https://github.com/kornia/kornia/pull/2152
  • modify comments of rgb and lab conversion by @gravitychen in https://github.com/kornia/kornia/pull/2153
  • add repr and getitem to vector by @cjpurackal in https://github.com/kornia/kornia/pull/2163
  • Augmentation Base Refactor by @shijianjian in https://github.com/kornia/kornia/pull/2117
  • unpin sphinx-autodoc-typehints by @johnnv1 in https://github.com/kornia/kornia/pull/2166
  • Fix adalam-config by @ducha-aiki in https://github.com/kornia/kornia/pull/2170
  • Fix docs of boxes, MultiResolutionDetector. apply colormap, AugmentationSequential by @johnnv1 in https://github.com/kornia/kornia/pull/2167
  • add exception test for se2 + small bug fix by @cjpurackal in https://github.com/kornia/kornia/pull/2160
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2174
  • Fix MobileViT by @chinhsuanwu in https://github.com/kornia/kornia/pull/2172
  • Fix output types of augmentations on autocast regions by @johnnv1 in https://github.com/kornia/kornia/pull/2168
  • Fix planckian jitter for cuda by @johnnv1 in https://github.com/kornia/kornia/pull/2177
  • [enhance] improve flipping and cropping speed by @shijianjian in https://github.com/kornia/kornia/pull/2179
  • Replace jit test method in favor of dynamo in BaseTester by @johnnv1 in https://github.com/kornia/kornia/pull/2120
  • downgrade docformatter to 1.5.1 by @edgarriba in https://github.com/kornia/kornia/pull/2176
  • Fix: resample method None default missing for inverse masks by @miquelmarti in https://github.com/kornia/kornia/pull/2185
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2194
  • Move padding_size to device in pad for boxes by @miquelmarti in https://github.com/kornia/kornia/pull/2197
  • Return boxes tensor directly if no boxes by @miquelmarti in https://github.com/kornia/kornia/pull/2196
  • The isinstance checks order are inverted by @csaybar in https://github.com/kornia/kornia/pull/2192
  • Skip x tests for torch=1.12.1 and accelerate not available by @johnnv1 in https://github.com/kornia/kornia/pull/2178
  • Drop some ci job by @johnnv1 in https://github.com/kornia/kornia/pull/2191
  • Make value an attribute of RandomErasing instances again by @miquelmarti in https://github.com/kornia/kornia/pull/2195
  • TensorWrapper bug fix + add radd, rmul, rsub by @cjpurackal in https://github.com/kornia/kornia/pull/2190
  • Run CI to just test fp64 on ubuntu and nightly run dynamo tests on PR's by @johnnv1 in https://github.com/kornia/kornia/pull/2199
  • Small refactor on filters module: Dropping JIT support by @johnnv1 in https://github.com/kornia/kornia/pull/2187
  • Bump accelerate from 0.15.0 to 0.16.0 by @dependabot in https://github.com/kornia/kornia/pull/2202
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2203
  • Add integral_image and integral_tensor by @AnimeshMaheshwari22 in https://github.com/kornia/kornia/pull/1779
  • move kornia check api to kornia.core.check by @edgarriba in https://github.com/kornia/kornia/pull/2143
  • Fix/repr bug by @neyazbasheer in https://github.com/kornia/kornia/pull/2207
  • Replace assert_allclose by assert_close by @johnnv1 in https://github.com/kornia/kornia/pull/2210
  • Fix random crop for keypoints on CUDA device by @johnnv1 in https://github.com/kornia/kornia/pull/2209
  • Remove outdated augmentation example by @johnnv1 in https://github.com/kornia/kornia/pull/2206
  • DataKey: add 'image' as alias of 'input' by @adamjstewart in https://github.com/kornia/kornia/pull/2193
  • Remove py 3.7 for nightly CI by @johnnv1 in https://github.com/kornia/kornia/pull/2204
  • [Feat] Initiate AutoAugment modules by @shijianjian in https://github.com/kornia/kornia/pull/2181
  • Fix CUDA failling tests of same device on Augmentations by @johnnv1 in https://github.com/kornia/kornia/pull/2215

New Contributors

  • @pri1311 made their first contribution in https://github.com/kornia/kornia/pull/2096
  • @zimka made their first contribution in https://github.com/kornia/kornia/pull/2125
  • @vicsyl made their first contribution in https://github.com/kornia/kornia/pull/2105
  • @jeffin07 made their first contribution in https://github.com/kornia/kornia/pull/2142
  • @gravitychen made their first contribution in https://github.com/kornia/kornia/pull/2153
  • @csaybar made their first contribution in https://github.com/kornia/kornia/pull/2192
  • @AnimeshMaheshwari22 made their first contribution in https://github.com/kornia/kornia/pull/1779
  • @neyazbasheer made their first contribution in https://github.com/kornia/kornia/pull/2207
  • @adamjstewart made their first contribution in https://github.com/kornia/kornia/pull/2193

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.9...v0.6.10

- Python
Published by edgarriba about 3 years ago

kornia - v0.6.9 Revamp kornia.geometry: Hyperplane, Ray, Quaternion, liegroup; restructure CI and typing robustness

What's Changed

  • Quaternion pow bug fix (div by zero) by @cjpurackal in https://github.com/kornia/kornia/pull/1946
  • fix cuda init by @ducha-aiki in https://github.com/kornia/kornia/pull/1953
  • Bump accelerate from 0.13.1 to 0.13.2 by @dependabot in https://github.com/kornia/kornia/pull/1957
  • add kornia.testing api in docs by @edgarriba in https://github.com/kornia/kornia/pull/1954
  • Fix line numbers of included examples. by @colllin in https://github.com/kornia/kornia/pull/1950
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1949
  • Feat/randombrightness contrast saturation hue by @duc12111 in https://github.com/kornia/kornia/pull/1955
  • Normalize with intrinsics by @ducha-aiki in https://github.com/kornia/kornia/pull/1727
  • Liegroups by @edgarriba in https://github.com/kornia/kornia/pull/1887
  • Add sepia by @johnnv1 in https://github.com/kornia/kornia/pull/1947
  • fix doctest in kornia.geometry.liegroup by @edgarriba in https://github.com/kornia/kornia/pull/1960
  • minor improvements to So3 by @cjpurackal in https://github.com/kornia/kornia/pull/1966
  • Documentation: proper Sørensen–Dice coefficient by @sergiev in https://github.com/kornia/kornia/pull/1961
  • use torch lts in doctest ci by @edgarriba in https://github.com/kornia/kornia/pull/1968
  • Add Hyperplane and Ray API by @edgarriba in https://github.com/kornia/kornia/pull/1963
  • Bump pytest from 7.1.3 to 7.2.0 by @dependabot in https://github.com/kornia/kornia/pull/1972
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1975
  • drop python 3.6 by @johnnv1 in https://github.com/kornia/kornia/pull/1971
  • Add some ortho tests for so3 by @stevenlovegrove in https://github.com/kornia/kornia/pull/1970
  • fix some typing annotations by @johnnv1 in https://github.com/kornia/kornia/pull/1967
  • ZCA Whiteing demo by @marianna13 in https://github.com/kornia/kornia/pull/1932
  • doctest to minimal python 3.8 by @edgarriba in https://github.com/kornia/kornia/pull/1974
  • fix import in assert_close helper by @pmeier in https://github.com/kornia/kornia/pull/1982
  • Remove unnecessary configs by @johnnv1 in https://github.com/kornia/kornia/pull/1984
  • Remove mypy from running on tests by @johnnv1 in https://github.com/kornia/kornia/pull/1983
  • Remove some # type: ignore from kornia.feature by @johnnv1 in https://github.com/kornia/kornia/pull/1995
  • add quaternion to euler conversion by @edgarriba in https://github.com/kornia/kornia/pull/1994
  • Update google analytics is for G4 property by @edgarriba in https://github.com/kornia/kornia/pull/1999
  • implement kornia.geometry.linalg.euclidean_distance by @edgarriba in https://github.com/kornia/kornia/pull/2000
  • quaternion, so3 and se3 as non batched by @edgarriba in https://github.com/kornia/kornia/pull/1997
  • Bump accelerate from 0.13.2 to 0.14.0 by @dependabot in https://github.com/kornia/kornia/pull/2004
  • Remove unused type: ignore by @johnnv1 in https://github.com/kornia/kornia/pull/1998
  • Bump pytest-mypy from 0.10.0 to 0.10.1 by @dependabot in https://github.com/kornia/kornia/pull/2005
  • Join the gh-actions for docs by @johnnv1 in https://github.com/kornia/kornia/pull/2003
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2010
  • [feat] liegroup so2 by @cjpurackal in https://github.com/kornia/kornia/pull/1973
  • add rotation and translation classmethods in se3 and so3 by @edgarriba in https://github.com/kornia/kornia/pull/2001
  • [feat] implement adjoint for liegroups by @cjpurackal in https://github.com/kornia/kornia/pull/2007
  • Fix typing errors by @johnnv1 in https://github.com/kornia/kornia/pull/2012
  • remove unused deepsource by @johnnv1 in https://github.com/kornia/kornia/pull/2016
  • So2 bug fix by @cjpurackal in https://github.com/kornia/kornia/pull/2015
  • use resample instead of mode argument in RandomElasticTransform per default by @JanSellner in https://github.com/kornia/kornia/pull/2017
  • Add reusable workflow to env setup and update CI's by @johnnv1 in https://github.com/kornia/kornia/pull/2009
  • Remove redudant casts by @johnnv1 in https://github.com/kornia/kornia/pull/2022
  • Fix type annotation for torch 1.13.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2023
  • Drop pytorch 1.8 (LTS) support by @johnnv1 in https://github.com/kornia/kornia/pull/2024
  • Fix an error in match_smnn by @anstadnik in https://github.com/kornia/kornia/pull/2020
  • Remove deprecated code in kornia.augmentation by @johnnv1 in https://github.com/kornia/kornia/pull/2028
  • so2 tests update and cleanup by @cjpurackal in https://github.com/kornia/kornia/pull/2029
  • Fix PR action trigger by @johnnv1 in https://github.com/kornia/kornia/pull/2026
  • Set equalnan to False in assertclose by @edgarriba in https://github.com/kornia/kornia/pull/1986
  • drop flake8 dependency by @johnnv1 in https://github.com/kornia/kornia/pull/2032
  • Improves performance of the slowest CPU tests by @johnnv1 in https://github.com/kornia/kornia/pull/2036
  • add default python and update pre-commit hooks by @johnnv1 in https://github.com/kornia/kornia/pull/2040
  • facedetector now returns a list of tensors containing the boxes x image by @lferraz in https://github.com/kornia/kornia/pull/2034
  • add random for liegroups by @cjpurackal in https://github.com/kornia/kornia/pull/2041
  • Add/ensure support for pytorch 1.13.0 by @johnnv1 in https://github.com/kornia/kornia/pull/2035
  • Update constants to be able to inherit types from get method by @johnnv1 in https://github.com/kornia/kornia/pull/2047
  • Pass along datakeys or extraargs in *ApplyInverse with containers by @miquelmarti in https://github.com/kornia/kornia/pull/2046
  • update mul for so2 by @cjpurackal in https://github.com/kornia/kornia/pull/2051
  • None for align_corners arg of resize op with nearest mode by @miquelmarti in https://github.com/kornia/kornia/pull/2049
  • Remove type ignore from the codebase by @johnnv1 in https://github.com/kornia/kornia/pull/2030
  • making RandomGaussianNoise play nicely on GPU by @nitaifingerhut in https://github.com/kornia/kornia/pull/2050
  • fix pep561 and remove deprecated license_file by @johnnv1 in https://github.com/kornia/kornia/pull/2057
  • Set padding mode to zeros for inverse of resize aug via crop by @miquelmarti in https://github.com/kornia/kornia/pull/2054
  • replacing .repeat(...) with .expand(...) by @nitaifingerhut in https://github.com/kornia/kornia/pull/2059
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2065
  • Bump accelerate from 0.14.0 to 0.15.0 by @dependabot in https://github.com/kornia/kornia/pull/2058
  • Fix GHA macos queued and coverage upload by @johnnv1 in https://github.com/kornia/kornia/pull/2038
  • Fix F401 by @johnnv1 in https://github.com/kornia/kornia/pull/2067
  • enable fast_mode on grandchecks by @johnnv1 in https://github.com/kornia/kornia/pull/2069
  • BUGFIX: RandomMotionBlur is not deterministic when using self._params by @nitaifingerhut in https://github.com/kornia/kornia/pull/2068
  • Motion blur by @nitaifingerhut in https://github.com/kornia/kornia/pull/2075
  • bugfix: KORNIACHECKSHAPE by @nitaifingerhut in https://github.com/kornia/kornia/pull/2076
  • [feat] Implement se2 by @cjpurackal in https://github.com/kornia/kornia/pull/2019
  • Fix f401 by @johnnv1 in https://github.com/kornia/kornia/pull/2077
  • remove type ignore by @johnnv1 in https://github.com/kornia/kornia/pull/2078
  • bug fix for getitem in liegroups and quaternion by @cjpurackal in https://github.com/kornia/kornia/pull/2079
  • Remove deprecated code in kornia.augmentation by @johnnv1 in https://github.com/kornia/kornia/pull/2052
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2081
  • Disable fail-fast on CI by @johnnv1 in https://github.com/kornia/kornia/pull/2085
  • enable check_untyped_defs on mypy by @johnnv1 in https://github.com/kornia/kornia/pull/2086
  • enable disallow_any_generics on mypy by @johnnv1 in https://github.com/kornia/kornia/pull/2092
  • [feat] add vee to so2, se2 by @cjpurackal in https://github.com/kornia/kornia/pull/2091
  • Fix padding for random crops by @miquelmarti in https://github.com/kornia/kornia/pull/2087
  • fix failing tests related to solve_cast on torch 1.9 by @johnnv1 in https://github.com/kornia/kornia/pull/2066
  • Add TensorWrapper, Vector3, Scalar and improvements in fit_plane by @edgarriba in https://github.com/kornia/kornia/pull/1987
  • fix parameters generator to be reproducible (3D) by @johnnv1 in https://github.com/kornia/kornia/pull/2088
  • Fix tests on CUDA by @johnnv1 in https://github.com/kornia/kornia/pull/2098
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/2099
  • [feat] adjoint for se2, so2 by @cjpurackal in https://github.com/kornia/kornia/pull/2101
  • add trans, transx, transy + minor changes se2 by @cjpurackal in https://github.com/kornia/kornia/pull/2103

New Contributors

  • @colllin made their first contribution in https://github.com/kornia/kornia/pull/1950
  • @sergiev made their first contribution in https://github.com/kornia/kornia/pull/1961
  • @stevenlovegrove made their first contribution in https://github.com/kornia/kornia/pull/1970
  • @JanSellner made their first contribution in https://github.com/kornia/kornia/pull/2017
  • @anstadnik made their first contribution in https://github.com/kornia/kornia/pull/2020

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.8...v0.6.9

- Python
Published by edgarriba about 3 years ago

kornia - v0.6.8 Experimental Nerf, Deep Edge Detection, community demos, Quaternion slerp, augmentations dispatcher, image matching and other bug fixes

Highlights

NeRF API

In this release in we include an experimental kornia.nerf submodule with a high level API that implements a vanilla Neural Radiance Field (NeRF). Read more about the roadmap of this project: https://github.com/kornia/kornia/issues/1936 // contribution done by @YanivHollander

```python from kornia.nerf import NerfSolver from kornia.geomtry.camera import PinholeCamera

camera: PinholeCamera = createonecamera(5, 9, device, dtype) img = createredimagesforcameras(camera, device)

nerfobj = NerfSolver(device=device, dtype=dtype) numimgrays = 15 nerfobj.inittraining(camera, 1.0, 3.0, False, img, numimgrays, batchsize=5, numraypoints=10, lr=1e-2) nerfobj.run(numepochs=10)

imgrendered = nerfobj.render_views(camera)[0].permute(2, 0, 1) ``` ezgif com-gif-maker

Improvements, docs and tutorials soon!

Edge Detection

Added kornia.contrib.EdgeDetection API that implements dexined: https://github.com/xavysp/DexiNed

```python import kornia as K from kornia.contrib import EdgeDetection

edge_detection = EdgeDetector().to(device)

preprocess

img = K.imagetotensor(frame, keepdim=False).to(device) img = K.color.bgrtorgb(img.float())

detect !

with torch.nograd(): edges = edgedetection(img)

imgvis = K.tensorto_image(edges.byte()) ``` amiga_edge

Image matching bugfixes:

After testing kornia LoFTR and AdaLAM under big load, our users and we have experiences some bugs in corners cases, such as big images or no input correspondences, which caused pipeline to crash. Not anymore!

  • Fixes typo bug that influences LoFTR training by @georg-bn in https://github.com/kornia/kornia/pull/1854
  • Enlargen LoFTR positional encoding map if large images are input by @georg-bn in https://github.com/kornia/kornia/pull/1853
  • Make AdaLAM output match confidence by @ducha-aiki in https://github.com/kornia/kornia/pull/1862
  • fix AdaLAM crash by @ducha-aiki in https://github.com/kornia/kornia/pull/1881
  • Adalam fix2 by @ducha-aiki in https://github.com/kornia/kornia/pull/1888
  • No crash in local feature matching if empty tensor output by @ducha-aiki in https://github.com/kornia/kornia/pull/1890
  • Fix warning in AdaLAM by @Skydes in https://github.com/kornia/kornia/pull/1925

Various kornia demos in gradio by community:

See demos in our HuggingFace space: https://huggingface.co/kornia image

  • Added gradio Image Stitching demo link by @kadirnar in https://github.com/kornia/kornia/pull/1871
  • edge detection demo by @p-mishra1 in https://github.com/kornia/kornia/pull/1876
  • Added Hugging Face edge detection demo link by @ramon-rd in https://github.com/kornia/kornia/pull/1874
  • [docs] add gradio app html and embeddings in filters by @lappemic in https://github.com/kornia/kornia/pull/1883
  • Geometry image transform demo by @dvando in https://github.com/kornia/kornia/pull/1922
  • add spaces demo by @johko in https://github.com/kornia/kornia/pull/1905
  • add space demo for homography warping by @johko in https://github.com/kornia/kornia/pull/1924
  • created resize_antialias.html file by @gauthamk28 in https://github.com/kornia/kornia/pull/1877
  • I added html file for module Line Fitting by @kadirnar in https://github.com/kornia/kornia/pull/1886
  • Add edge detector and morphological operator demos in the rst docs files by @ramon-rd in https://github.com/kornia/kornia/pull/1884
  • Image registration demo by @marianna13 in https://github.com/kornia/kornia/pull/1897
  • [docs] Add totalvariationdenoising gradio by @gagan3012 in https://github.com/kornia/kornia/pull/1880
  • [Docs] Refactor the embedded Gradio demos by @NimaBoscarino in https://github.com/kornia/kornia/pull/1901

RANSAC improvements

We have added homography-from-line-segments solver, as well as various speed-ups. We are not yet at OpenCV RANSAC quality level, more improvements to come :) But the line-solver is pretty unique! We also have example in our tutorials https://kornia-tutorials.readthedocs.io/en/latest/linedetectionandmatchingsold2.html

image

  • Added homography from line segment correspondences by @ducha-aiki in https://github.com/kornia/kornia/pull/1851
  • RANSAC improvements by @ducha-aiki in https://github.com/kornia/kornia/pull/1435
  • Add getperpendicular and getclosestpointonepipolarline by @ducha-aiki in https://github.com/kornia/kornia/pull/1915
  • Fix svdvals usage by @ducha-aiki in https://github.com/kornia/kornia/pull/1926

Apple Silicon M1 support is closer, CI improvements

We are slowly working on being able to run kornia on M1. So far we have added possibility to test locally on M1 and mostly report Pytorch MPS backend crashes in various use-cases. Once this work is finished, we may provide some workarounds to have kornia-M1

  • remove conv3d from spatial_gradient by @ducha-aiki in https://github.com/kornia/kornia/pull/1898
  • Added possibility to run tests for mps locally by @ducha-aiki in https://github.com/kornia/kornia/pull/1716
  • CI update pytorch-->-1.12.1 by @ducha-aiki in https://github.com/kornia/kornia/pull/1892
  • lts is not supported on mac-os, separate it by @ducha-aiki in https://github.com/kornia/kornia/pull/1904
  • Update setup to declarative metadata by @johnnv1 in https://github.com/kornia/kornia/pull/1885
  • Bump pytest from 7.1.2 to 7.1.3 by @dependabot in https://github.com/kornia/kornia/pull/1860
  • add concurrency cancel-in-progress in cpu workflow by @edgarriba in https://github.com/kornia/kornia/pull/1865
  • Use --no-implicit-optional for type checking by @hauntsaninja in https://github.com/kornia/kornia/pull/1910

Quaternion improvements

Implemented Quaternion.slerp to interpolate between quaternions using quaternion arithmetic -- contributed by @cjpurackal

```python import torch from kornia.geometry.quaternion import Quaternion

q0 = Quaternion.identity(batch_size=1) q1 = Quaternion(torch.tensor([[1., .5, 0., 0.]])) q2 = q0.slerp(q1, .3)

```

More augmentations!

  • [feat] Added Jigsaw Augmentation by @shijianjian in https://github.com/kornia/kornia/pull/1852
  • [Feat] Added AugmentationDispatcher by @shijianjian https://github.com/kornia/kornia/pull/191

What's Changed

  • Added homography from line segment correspondences by @ducha-aiki in https://github.com/kornia/kornia/pull/1851
  • Fixes typo bug that influences LoFTR training by @georg-bn in https://github.com/kornia/kornia/pull/1854
  • Enlargen LoFTR positional encoding map if large images are input by @georg-bn in https://github.com/kornia/kornia/pull/1853
  • docs: clarify the relation of colorjitter and colorjiggle by @kunaltyagi in https://github.com/kornia/kornia/pull/1858
  • Bump pytest from 7.1.2 to 7.1.3 by @dependabot in https://github.com/kornia/kornia/pull/1860
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1833
  • Binary focal loss: Use pre-computed probs and increase readability by @klieret in https://github.com/kornia/kornia/pull/1848
  • add concurrency cancel-in-progress in cpu workflow by @edgarriba in https://github.com/kornia/kornia/pull/1865
  • modifying add_weighted to accept Tensors for alpha/beta/gamma by @nitaifingerhut in https://github.com/kornia/kornia/pull/1868
  • Make AdaLAM output match confidence by @ducha-aiki in https://github.com/kornia/kornia/pull/1862
  • fix bugs shift_rgb by @duc12111 in https://github.com/kornia/kornia/pull/1861
  • Added gradio Image Stitching demo link by @kadirnar in https://github.com/kornia/kornia/pull/1871
  • edge detection demo by @p-mishra1 in https://github.com/kornia/kornia/pull/1876
  • Added Hugging Face edge detection demo link by @ramon-rd in https://github.com/kornia/kornia/pull/1874
  • fix AdaLAM crash by @ducha-aiki in https://github.com/kornia/kornia/pull/1881
  • [feat] Added Jigsaw Augmentation by @shijianjian in https://github.com/kornia/kornia/pull/1852
  • [docs] add gradio app html and embeddings in filters by @lappemic in https://github.com/kornia/kornia/pull/1883
  • created resize_antialias.html file by @gauthamk28 in https://github.com/kornia/kornia/pull/1877
  • Adalam fix2 by @ducha-aiki in https://github.com/kornia/kornia/pull/1888
  • Add edge detector and morphological operator demos in the rst docs files by @ramon-rd in https://github.com/kornia/kornia/pull/1884
  • I added html file for module Line Fitting by @kadirnar in https://github.com/kornia/kornia/pull/1886
  • No crash in local feature matching if empty tensor output by @ducha-aiki in https://github.com/kornia/kornia/pull/1890
  • CI update pytorch-->-1.12.1 by @ducha-aiki in https://github.com/kornia/kornia/pull/1892
  • Fix fail test by @ducha-aiki in https://github.com/kornia/kornia/pull/1896
  • Added possibility to run tests for mps locally by @ducha-aiki in https://github.com/kornia/kornia/pull/1716
  • remove conv3d from spatial_gradient by @ducha-aiki in https://github.com/kornia/kornia/pull/1898
  • lts is not supported on mac-os, separate it by @ducha-aiki in https://github.com/kornia/kornia/pull/1904
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1900
  • quaternion index bug fix by @cjpurackal in https://github.com/kornia/kornia/pull/1903
  • Update setup to declarative metadata by @johnnv1 in https://github.com/kornia/kornia/pull/1885
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1912
  • Image registration demo by @marianna13 in https://github.com/kornia/kornia/pull/1897
  • [docs] Add totalvariationdenoising gradio by @gagan3012 in https://github.com/kornia/kornia/pull/1880
  • [Docs] Refactor the embedded Gradio demos by @NimaBoscarino in https://github.com/kornia/kornia/pull/1901
  • Add getperpendicular and getclosestpointonepipolarline by @ducha-aiki in https://github.com/kornia/kornia/pull/1915
  • Use --no-implicit-optional for type checking by @hauntsaninja in https://github.com/kornia/kornia/pull/1910
  • Add Random Gamma and test by @duc12111 in https://github.com/kornia/kornia/pull/1837
  • Add device query to Pinhole class by @YanivHollander in https://github.com/kornia/kornia/pull/1760
  • Quaternion from axis angle representation by @cjpurackal in https://github.com/kornia/kornia/pull/1917
  • NeRF Implementation by @YanivHollander in https://github.com/kornia/kornia/pull/1911
  • Bump pytest-mypy from 0.9.1 to 0.10.0 by @dependabot in https://github.com/kornia/kornia/pull/1919
  • Geometry image transform demo by @dvando in https://github.com/kornia/kornia/pull/1922
  • add spaces demo by @johko in https://github.com/kornia/kornia/pull/1905
  • add space demo for homography warping by @johko in https://github.com/kornia/kornia/pull/1924
  • RANSAC improvements by @ducha-aiki in https://github.com/kornia/kornia/pull/1435
  • Fix warning in AdaLAM by @Skydes in https://github.com/kornia/kornia/pull/1925
  • Fix svdvals usage by @ducha-aiki in https://github.com/kornia/kornia/pull/1926
  • Bump pytest-cov from 3.0.0 to 4.0.0 by @dependabot in https://github.com/kornia/kornia/pull/1918
  • fix shift_rgb stack dimension by @nmichlo in https://github.com/kornia/kornia/pull/1930
  • Bump accelerate from 0.12.0 to 0.13.1 by @dependabot in https://github.com/kornia/kornia/pull/1937
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1939
  • [Fix] Fixed mypy warnings by @shijianjian in https://github.com/kornia/kornia/pull/1920
  • Update kernels.py by @farhankhot in https://github.com/kornia/kornia/pull/1940
  • Quaternion.norm bug fix by @cjpurackal in https://github.com/kornia/kornia/pull/1935
  • [Feat] Added AugmentationDispatcher by @shijianjian in https://github.com/kornia/kornia/pull/1914
  • Add EdgeDetection api by @edgarriba in https://github.com/kornia/kornia/pull/1483
  • [feat] slerp implementation for Quaternion by @cjpurackal in https://github.com/kornia/kornia/pull/1931
  • add laplacian pyramid by @lafith in https://github.com/kornia/kornia/pull/1816
  • Fix quaternion doctests by @edgarriba in https://github.com/kornia/kornia/pull/1943
  • Remove unnecessary CI jobs by @johnnv1 in https://github.com/kornia/kornia/pull/1933
  • fix cuda tests failing by @ducha-aiki in https://github.com/kornia/kornia/pull/1941

New Contributors

  • @georg-bn made their first contribution in https://github.com/kornia/kornia/pull/1854
  • @kunaltyagi made their first contribution in https://github.com/kornia/kornia/pull/1858
  • @klieret made their first contribution in https://github.com/kornia/kornia/pull/1848
  • @duc12111 made their first contribution in https://github.com/kornia/kornia/pull/1861
  • @kadirnar made their first contribution in https://github.com/kornia/kornia/pull/1871
  • @p-mishra1 made their first contribution in https://github.com/kornia/kornia/pull/1876
  • @ramon-rd made their first contribution in https://github.com/kornia/kornia/pull/1874
  • @lappemic made their first contribution in https://github.com/kornia/kornia/pull/1883
  • @gauthamk28 made their first contribution in https://github.com/kornia/kornia/pull/1877
  • @cjpurackal made their first contribution in https://github.com/kornia/kornia/pull/1903
  • @johnnv1 made their first contribution in https://github.com/kornia/kornia/pull/1885
  • @marianna13 made their first contribution in https://github.com/kornia/kornia/pull/1897
  • @gagan3012 made their first contribution in https://github.com/kornia/kornia/pull/1880
  • @hauntsaninja made their first contribution in https://github.com/kornia/kornia/pull/1910
  • @dvando made their first contribution in https://github.com/kornia/kornia/pull/1922
  • @johko made their first contribution in https://github.com/kornia/kornia/pull/1905
  • @Skydes made their first contribution in https://github.com/kornia/kornia/pull/1925
  • @nmichlo made their first contribution in https://github.com/kornia/kornia/pull/1930
  • @farhankhot made their first contribution in https://github.com/kornia/kornia/pull/1940
  • @lafith made their first contribution in https://github.com/kornia/kornia/pull/1816

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.7...v0.6.8

- Python
Published by edgarriba over 3 years ago

kornia - v0.6.7 SOLD2, AdaLAM, Quaternion, Mosaic Aug and Edge-aware Blur

Highlights

SOLD2 line segment detector & descriptor

Contributed by SOLD2 original authors

Geometry-aware matchers: AdaLAM & FGINN

image Good old Lowe ratio-test is good for descriptor matching (implemented as match_snn, match_smnn in kornia, but it is often not enough: it does not take into account keypoint positions. With this version we started to add geometry aware descriptor matchers, starting with FGINN and AdaLAM. Later we plan to add something like SuperGlue (but free version, ofc).

AdaLAM works particularly well with kornia.feature.KeyNetAffNetHardNet. AdaLAM is adopted from original author's implementation.

```python3 import matplotlib.pyplot as plt import cv2 import kornia as K import kornia.feature as KF import numpy as np import torch from kornia_moons.feature import *

def loadtorchimage(fname): img = K.imagetotensor(cv2.imread(fname), False).float() /255. img = K.color.bgrtorgb(img) return img

device = K.utils.getcudadeviceifavailable()

fname1 = 'knchurch-2.jpg' fname2 = 'knchurch-8.jpg'

img1 = loadtorchimage(fname1) img2 = loadtorchimage(fname2)

feature = KF.KeyNetAffNetHardNet(5000, True).eval().to(device)

inputdict = {"image0": K.color.rgbtograyscale(img1), # LofTR works on grayscale images only "image1": K.color.rgbto_grayscale(img2)}

hw1 = torch.tensor(img1.shape[2:]) hw2 = torch.tensor(img1.shape[2:])

adalam_config = {"device": device}

with torch.inferencemode(): lafs1, resps1, descs1 = feature(K.color.rgbtograyscale(img1)) lafs2, resps2, descs2 = feature(K.color.rgbtograyscale(img2)) dists, idxs = KF.matchadalam(descs1.squeeze(0), descs2.squeeze(0), lafs1, lafs2, # Adalam takes into account also geometric information config=adalam_config, hw1=hw1, hw2=hw2) # Adalam also benefits from knowing image size ``` More - in our Tutorials section

Geometry conversions

Converting camera pose from (R,t) to actually pose in world coordinates can be a pain. We are relieving you from it, by implementing various conversion functions, such as camtoworld_to_worldtocam_Rt, worldtocam_to_camtoworld_Rt, camtoworld_graphics_to_vision_4x4, etc. The conversions come with two variants: for (R,t) tensor tuple, or with since extrinsics mat4x4.

Quaternion API

More geometry-related stuff! We have added Quaternion API to make work with rotation representations easy. Checkout the PR

```python

q = Quaternion.identity(batchsize=4) q.data Parameter containing: tensor([[1., 0., 0., 0.], [1., 0., 0., 0.], [1., 0., 0., 0.], [1., 0., 0., 0.]], requiresgrad=True) q.real tensor([[1.], [1.], [1.], [1.]], gradfn=) q.vec tensor([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.], [0., 0., 0.]], gradfn=) ```

Mosaic Augmentation

We recently included the RandomMosaic to mosaic image transforms and combine them into one output image. The output image is composed of the parts from each sub-image.

The mosaic transform steps are as follows: - Concate selected images into a super-image. - Crop out the outcome image according to the top-left corner and crop size.

```python

mosaic = RandomMosaic((300, 300), datakeys=["input", "bboxxyxy"]) boxes = torch.tensor([[ ... [70, 5, 150, 100], ... [60, 180, 175, 220], ... ]]).repeat(8, 1, 1) input = torch.randn(8, 3, 224, 224) out = mosaic(input, boxes) out[0].shape, out[1].shape (torch.Size([8, 3, 300, 300]), torch.Size([8, 8, 4])) ```

image

Edge-aware blurring

Thanks to @nitaifingerhut

```python3 !wget https://github.com/kornia/data/raw/main/drslump.jpg

import torch import kornia import cv2 import matplotlib.pyplot as plt

read the image with OpenCV

img: np.ndarray = cv2.imread('./drslump.jpg') img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

convert to torch tensor

data: torch.tensor = kornia.imagetotensor(img, keepdim=False)/255. # BxCxHxW data-=0.2*torch.rand_like(data).abs()

plt.figure(figsize=(12,8)) edgeblurred = kornia.filters.edgeawareblurpool2d(data, 19) plt.imshow(kornia.tensortoimage(torch.cat([data, edge_blurred],axis=3)))

``` image

What's Changed

  • 0.8 is too strict for smnn matching, 0.95 is much better default by @ducha-aiki in https://github.com/kornia/kornia/pull/1807
  • fix bug and add scale coef by @ducha-aiki in https://github.com/kornia/kornia/pull/1808
  • No crash matching by @ducha-aiki in https://github.com/kornia/kornia/pull/1810
  • Added FGINN matching by @ducha-aiki in https://github.com/kornia/kornia/pull/1813
  • Added SOLD2 by @rpautrat https://github.com/kornia/kornia/pull/1507 https://github.com/kornia/kornia/pull/1844
  • disable accelerate for macos and pytorch 1.10.2 by @edgarriba in https://github.com/kornia/kornia/pull/1811
  • update flake8 to 5.0.4 and fixes by @edgarriba in https://github.com/kornia/kornia/pull/1818
  • Bump accelerate from 0.10.0 to 0.11.0 by @dependabot in https://github.com/kornia/kornia/pull/1802
  • Bump accelerate from 0.11.0 to 0.12.0 by @dependabot in https://github.com/kornia/kornia/pull/1820
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1821
  • Allowing more than 3/4 dims for total_variation + adding reduction by @nitaifingerhut in https://github.com/kornia/kornia/pull/1815
  • edge aware blur2d by @nitaifingerhut in https://github.com/kornia/kornia/pull/1822
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1828
  • Adds conversions between graphics and vision coordinate frames by @ducha-aiki in https://github.com/kornia/kornia/pull/1823
  • Add Quaternion API by @edgarriba in https://github.com/kornia/kornia/pull/1801
  • fix tests float16 module losses by @MrShevan in https://github.com/kornia/kornia/pull/1809
  • AdaLAM match filtering (clean) by @ducha-aiki in https://github.com/kornia/kornia/pull/1831
  • [Feat] Init Mosaic Augmentation by @shijianjian in https://github.com/kornia/kornia/pull/1713
  • Change embedded Gradio demo to use web component instead of iframe by @NimaBoscarino in https://github.com/kornia/kornia/pull/1835
  • fix tests and warnings by @MrShevan in https://github.com/kornia/kornia/pull/1834

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.6...v0.6.7

- Python
Published by edgarriba over 3 years ago

kornia - v0.6.6 ParametrizedLine API and load_image macos and windows

Highlights

ParametrizedLine API

First of integrations to revamp kornia.geometry to align with Eigen and Sophus. Docs: https://kornia.readthedocs.io/en/latest/geometry.line.html?#kornia.geometry.line.ParametrizedLine See: example: https://github.com/kornia/kornia/blob/master/examples/geometry/fit_line2.py

Figure_1

Support for macos and windows in load_image

Automated the packaging infra in kornia_rs to handle multi architecture builds. Arm64 soon :) See: https://github.com/kornia/kornia-rs

python # load the image using the rust backend img: Tensor = K.io.load_image(file_name, K.io.ImageLoadType.RGB32) img = img[None] # 1xCxHxW / fp32 / [0, 1]

HuggingFacce integration

Created Kornia AI org under the HuggingFace platform. Starting to port the tutorials under HuggingFace kornia org to rapidly show live docs and make community. Link: https://huggingface.co/kornia

Demos: - kornia enhance: https://kornia.readthedocs.io/en/latest/enhance.html#interactive-demo - augmentations playground: https://huggingface.co/spaces/kornia/kornia-augmentations-tester

What's new ?

  • update slack link by @edgarriba in https://github.com/kornia/kornia/pull/1719
  • fixes EarlyStoppping condition by @edgarriba in https://github.com/kornia/kornia/pull/1718
  • Fix warning: meshgrid need indexing argument by @FavorMylikes in https://github.com/kornia/kornia/pull/1629
  • Bump accelerate from 0.8.0 to 0.9.0 by @dependabot in https://github.com/kornia/kornia/pull/1720
  • fixes for half precision in imgwarp by @edgarriba in https://github.com/kornia/kornia/pull/1723
  • Fix transforms for empty boxes and keypoints inputs by @hal-314 in https://github.com/kornia/kornia/pull/1741
  • few mypy fixes by @edgarriba in https://github.com/kornia/kornia/pull/1724
  • Implement project and unproject in PinholeCamera by @YanivHollander in https://github.com/kornia/kornia/pull/1729
  • deprecate filter2D filter3D api by @edgarriba in https://github.com/kornia/kornia/pull/1725
  • fixing doctest in pinhole by @edgarriba in https://github.com/kornia/kornia/pull/1743
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1742
  • Fix/crop transforms by @hal-314 in https://github.com/kornia/kornia/pull/1739
  • Fix Boxes.from_tensor(boxes, mode="vertices") by @hal-314 in https://github.com/kornia/kornia/pull/1740
  • adding rgb_to_y by @nitaifingerhut in https://github.com/kornia/kornia/pull/1734
  • fix typing callable in load storage by @edgarriba in https://github.com/kornia/kornia/pull/1768
  • Add rgbtoy to all by @ashnair1 in https://github.com/kornia/kornia/pull/1762
  • Fix bug preventing sample wise augmentations by @ashnair1 in https://github.com/kornia/kornia/pull/1761
  • update pytorch ci matrix 1.10.2 and 1.11.0 by @edgarriba in https://github.com/kornia/kornia/pull/1771
  • docs: Fix a few typos by @timgates42 in https://github.com/kornia/kornia/pull/1774
  • Refactor and add tests in get_perspective_transform by @edgarriba in https://github.com/kornia/kornia/pull/1767
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1776
  • update libfacedetection url path by @edgarriba in https://github.com/kornia/kornia/pull/1780
  • enable black in the precommit by @edgarriba in https://github.com/kornia/kornia/pull/1777
  • Bump kornia-rs from 0.0.2 to 0.0.5 by @dependabot in https://github.com/kornia/kornia/pull/1784
  • kornia io support for macos and win by @edgarriba in https://github.com/kornia/kornia/pull/1785
  • deploy docs to gh-pages by @edgarriba in https://github.com/kornia/kornia/pull/1787
  • update pytest 7.1.2; pytest-flake8 1.1.1; flake8 4.0.1 by @edgarriba in https://github.com/kornia/kornia/pull/1786
  • adding weights to positive examples by @MrShevan in https://github.com/kornia/kornia/pull/1765
  • [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com/kornia/kornia/pull/1789
  • add KORNIA_CHECK_SAME_DEVICES by @MrShevan in https://github.com/kornia/kornia/pull/1788
  • Bump accelerate from 0.9.0 to 0.10.0 by @dependabot in https://github.com/kornia/kornia/pull/1748
  • Add sphinxcontrib.gtagjs to track docs by @edgarriba in https://github.com/kornia/kornia/pull/1790
  • Add an interactive demo to the kornia.enhance docs by @NimaBoscarino in https://github.com/kornia/kornia/pull/1793
  • Update the Gradio demo URL to point to Kornia HF org by @NimaBoscarino in https://github.com/kornia/kornia/pull/1795
  • Add ParametrizedLine and fit_line by @edgarriba in https://github.com/kornia/kornia/pull/1794
  • add link to interactive augmentations demo by @cceyda in https://github.com/kornia/kornia/pull/1797

New Contributors

  • @FavorMylikes made their first contribution in https://github.com/kornia/kornia/pull/1629
  • @MrShevan made their first contribution in https://github.com/kornia/kornia/pull/1765
  • @NimaBoscarino made their first contribution in https://github.com/kornia/kornia/pull/1793

Full Changelog: https://github.com/kornia/kornia/compare/v0.6.5...v0.6.6

- Python
Published by edgarriba over 3 years ago

kornia - Kornia 0.6.5: Image i/o module with Rust, diamond_square and plasma augmentations, new geometric metrics and gradients estimators for differentiable augmentations.

:rocket: [0.6.5] - 2022-05-16

:new: New Features

  • Create kornia.io and implement load_image with rust (#1701)
  • Implement diamond_square and plasma augmentations: RandomPlasmaBrightness, RandomPlasmaContrast, RandomPlasmaShadow (#1700)
  • Added RandomRGBShift augmentation (#1694)
  • Added STE gradient estimator (#1666)
  • More epipolar geometry metrics (+linalg utility) (#1674)
  • Add Lovasz-Hinge/Softmax losses (#1682)
  • Add adjust_sigmoid and adjust_log initial implementation (#1685)
  • Added distribution mapper (#1667)

:lady_beetle: Bug fixes

  • Fixes filter2d's output shape shrink when padding='same' (#1661)
  • fix: added eps in geometry/rotmattoquaternion (#1665)
  • [fix] receive num_features as an arg to KeyNetDetector constructor (#1686

:zap: Improvements

  • Add reduction option to MS_SSIMLoss (#1655)
  • Making epipolar metrics work with volumetric tensors (#1656)
  • Add getsafedevice util (#1662)
  • Added antialiasing option to Resize augmentation (#1687)
  • Use nearest neighbour interpolation for masks (#1630)
  • grayscale to rgb for torch.uint8 (#1705)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @Jonas1312 @nitaifingerhut @qwertyforce @ashnair1 @ducha-aiki @z0gSh1u @simon-schaefer @shijianjian @edgarriba @HJoonKwon @ChristophReich1996 @Tanmay06 @dobosevych @miquelmarti @Oleksandra2020

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba almost 4 years ago

kornia - Kornia 0.6.4: RandomPlanckianJitter, KeyNet detector, HyNet descriptor, MS-SSIMLoss and draw_convex_polygon

:rocket: [0.6.4] - 2022-03-21

:new: New Features

  • Adds MS-SSIMLoss reconstruction loss function (#1551)
  • Added HyNet descriptor (#1573)
  • Add KeyNet detector (#1574)
  • Add RandomPlanckianJitter in color augmentations (#1607)
  • Add Jina AI QAbot to Kornia documentation (#1628)
  • Add draw_convex_polygon (#1636)

:lady_beetle: Bug fixes

  • RandomCrop fix and improvement (#1571)
  • Fix draw_line produce wrong output for coordinates larger than uint8
  • Fix mask bug for loftr (#1580)
  • Fix gradient bug for distance_transform (#1584)
  • Fix translation sampling in AffineGenerator3D (#1581)
  • Fix AugmentationSequential bbox keypoints transformation fix (#1570)
  • Fix CombineTensorPatches (#1558)
  • Fix overblur in AA (#1612)

:exclamation: Changes

  • Deprecated return_transform, enabled 3D augmentations in AugmentionSequential (#1590)

:zap: Improvements

  • Making computecorrespondepilines work with fundamental and point of volumetric tensor (#1585)
  • Update batch shape when augmentations change size of image (#1609)
  • Remap accepts arbitrary grid size (#1617)
  • Rename variables named 'input' to 'sample' (in tests). (#1614)
  • Remove half log2 in extract_patches (#1616)
  • Add orientation-preserving option for AffNet and make it default (#1620)
  • Add option for sampling_method in 2d perspective transform generation (#1591) (#1592)
  • Fix adjust brightness (#1586)
  • Added default params for laf construction from xy and new tensor shape check (#1633)
  • Make nms2d jittable (#1637)
  • Add fn to automatically compute padding (#1634)
  • Add pillow_like option for ColorJitter to match torchvision. (#1611)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @ducha-aiki @edgarriba @shijianjian @juliendenize @ashnair1 @KhaledSharif @Parskatt @shazhou2015 @JoanFM @nrupatunga @kristijanbartol @miquelmarti @riegerfr @nitaifingerhut @dichen-cd @lamhoangtung @hasibzunair @wendy-xiaozong @rsomani95 @huuquan1994 @twsl

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba almost 4 years ago

kornia - Kornia 0.6.3: Distance Transform, Pytorch 1.10.1, support, Hanning kernel, Resize augmentations and bug fixes

:rocket: [0.6.3] - 2022-01-30

:new: New Features

  • Update CI to pytorch 1.10.1 (#1518)
  • Added Hanning kernel, prepare for KCF tracking (#1519)
  • Add distance transform implementation (#1490)
  • Add Resize augmentation module (#1545)

:lady_beetle: Bug fixes

  • Precompute padding parameters when RandomCrop aug in container (#1494)
  • Padding error with RandomCrop #1520
  • Fix correct shape after cropping when forwarding parameters (#1533)
  • Fixed #1534 nested augmentation sequential bug (#1536)
  • Fixes to device in augmentations (#1546)
  • Bugfix for larger MotionBlur kernel size ranges (#1543)
  • Fix RandomErasing applied to mask keys (#1541)

:exclamation: Changes

  • Restructure augmentation package (#1515)

:zap: Improvements

  • Add missing keepdims with fixed type (#1488)
  • Allow to pass a second K to distort and undistort points (#1506)
  • Augmentation Sequential with a list of bboxes as a batch (#1497)
  • Adde Devcontainer for development (#1515)
  • Improve the histogram_matching function (#1532)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @ducha-aiki @edgarriba @shijianjian @julien-blanchon @lferraz @miquelmarti @twsl @nitaifingerhut @eungbean @aaroswings @huuquan1994 @rsomani95

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba about 4 years ago

kornia - Kornia 0.6.2: Face Detection, Bounding Box API, histogram matching, drawing and more.

:rocket: [0.6.2] - 2021-12-03

:new: New Features

  • Add face detection API (#1469)
  • Add ObjectDetectorTrainer (#1414)
  • Add container operation weights and OneOf documentation (#1443)
  • Add oriented contraint check to Homography RANSAC (#1453)
  • Add background color selection in warp_perspective (#1452)
  • Add draw_line image utility (#1456)
  • Add Bounding Boxes API (#1304)
  • Add histogram_matching functionality (#1395)

:lady_beetle: Bug fixes

  • fix catch type for torch.svd error (#1431)
  • Fix for nested AugmentationSequential containers (#1467)
  • Use common bbox format xywh (#1472)

:exclamation: Changes

  • Add padding_mode for RandomElasticTransform augmentation (#1439)
  • Expose inliers sum to HomographyTracker (#1463)

:zap: Improvements

  • Switch to one-way error RANSAC for speed-up (#1454)
  • Few improvements on homography tracking (#1434)
  • Enable all bandit tests, add separate hook for tests (#1437)
  • Merge homographywarp to warpperspective (#1438)
  • Random generator refactor (#1459)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @ducha-aiki @edgarriba @chinhsuanwu @chinhsuanwu @dobosevych @shijianjian @rvorias @rvorias @fmiotello @hal-314 @trysomeway @miquelmarti @calmdown13 @twsl Abdelrhman-Hosny

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba about 4 years ago

kornia - Kornia 0.6.1 - Packaging hotfix

:rocket: Release Note (0.6.1)

  • Fixes PyPI tarball missing required files #1421
  • hotfix: remove mutable object in constructor #1423

- Python
Published by edgarriba over 4 years ago

kornia - Kornia 0.6.0 - High Level and experimental training APIs, bug fixes and much more

:rocket: Release Note (0.6.0)

Release time: 2021-10-22

:new: New Features

  • Add Training API (#1307)
  • Added combine patches (#1309)
  • Add semantic segmentation trainer (#1323)
  • Add vanilla LO-RANSAC (#1335)
  • Add Lambda function module (#1346)
  • Add support for YUV420 and YUV422 to complement current YUV444 (#1360)
  • Add raw to rgb color conversion (#1380)
  • Implement separable_filter2d (#1385)
  • Add MobileViT to contrib (#1388)
  • Add solvepnpdlt (#1349)
  • Add function imagelistto_tensor to utils (#1393)
  • Add undistort_image function (#1303)
  • Create kormia.metrics submodule (#1325)
  • Add Image Stitching API (#1358)
  • Add Homography Tracker API (#1389)

:exclamation: Changes

  • Refactor library namespaces [pre-release]0.6-rc1
  • Deprecate PyTorch 1.6/1.7 and add 1.9.1 (#1399)

:zap: Improvements

  • Improve bboxtomask (#1351)
  • Refactor unfold->conv for morphology backbone (#1107)
  • Improve focal loss for numerical stability (#1362)
  • Add more border_type options for filter2D (#1375)
  • Replace deprecated torch.qr (#1376)
  • Add special case hardcoded implementtion for local features speed up (#1387)
  • Enable non/batched connected components (#1193)
  • Remove warnings during testing (#1401)

:lady_beetle: Bug fixes

  • Fix binary focal loss (#1313)
  • Fix kornia.geometry.subpix.spatialsoftargmax imports (#1318)
  • Fixed a simple typo in init.py (#1319)
  • Fix path to dev requirements file in a setupdevenv.sh (#1324)
  • Fix bug in create_meshgrid3d along depth (#1330)
  • Fix anisotropic scale error (#1340)
  • Fix rgbtohsv for onnx (#1329)
  • Fixed useless return in ransac.py (#1352)
  • Fixed classificationhead typo and leave out some of the guesswork (#1354)
  • Fix clahe differentiability and tests (#1356)
  • Fixes singular matrix inverse/solve for RANSAC and ConvQuad3d (#1408)
  • Change intermediate datatype to fix imgwarp (#1413)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @AK391 @cclauss @edgarriba @ducha-aiki @isaaccorley @justanhduc @jatentaki @shijianjian @shiyangc-intusurg @SravanChittupalli @thatbrguy @nvshubhsharma @PWhiddy @oskarflordal @tacoelho @YanivHollander @jhacsonmeza

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - Vision Transformer (ViT), Image Registration, Image Matching APIs and Hausdorff Distance loss

:rocket: Release Note (0.5.11)

Release time: 2021-09-19

:new: New Features

  • Add Vision Transformer (ViT) (#1296)
  • Add ImageRegistrator API (#1253)
  • Add LoFTR inference (#1218)
  • Added differentiable Hausdorff Distance (HD) loss (#1254)
  • Add PadTo to kornia.augmentation (#1286)

:zap: Code refactor

  • Return all learned modules by default in eval() mode (#1266)
  • Enable ImageSequential and VideoSequential to AugmentationSequential (#1231)
  • Specify that angles are in radians (#1287)
  • Removed deprecated codes for v6.0 (#1281)

:lady_beetle: Bug fixes

  • Fix savepointcloudply fn counting point with inf coordinates (#1263)
  • Fixes torch version parse and add temporal packaging dependency (#1284)
  • Fix issue of image_histogram2d (#1295)

:womantechnologist: :mantechnologist: We would like to thank all contributors for this new release ! @Abdelrhman-Hosny @ducha-aiki @edgarriba @EStorm21 @lyhyl @shijianjian @thatbrguy

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - Connected Components Labelling algorithm, Differentiable image histogram, and bug fixes

Kornia release

[0.5.8] - 2021-08-06

Added

  • Add the connected components labeling algorithm (#1184)

Fixed

  • Partial fix for horizontal and vertical flips (#1166)
  • Fix even kernel and add test (#1183)
  • Fix wrong source points for RandomThinPlateSpline (#1187)
  • Fix RandomElasticTransform ignores sameonbatch (#1189)
  • Fixed bugs in patchsequential. Remove fill_diagonal operation for better ONNX support (#1178)

Changed

  • Differentiable image histogram using kernel density estimation (#1172)

Contributors

@bkntr @bsuleymanov @ducha-aiki @edgarriba @hal-314 @kingsj0405 @shijianjian

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - Grayscale to RGB image conversion. Add keepdim param to tensor_to_image function.

Kornia 0.5.7 release

[0.5.7] - 2021-07-27

### Added - Grayscale to RGB image conversion. (#1162) - Add keepdim param to tensortoimage function. (#1168)

### Fixed - Fix checks on wrong tensor shape condition in depth.py (#1164)

Contributors

@bsuleymanov @dhernandez0 @ducha-aiki

If we forgot someone let us know :sunglasses:

- Python
Published by shijianjian over 4 years ago

kornia - Add Bounding Boxes module, remove Numpy from core and RGB to HLS optimisations

Kornia 0.5.6 release

[0.5.6] - 2021-07-12

Added

  • Added mix augmentations in containers (#1139)

Fixed

  • Fixed non-4-dim input error for sequential (#1146)

Changed

  • Moving bbox-related functionality to bbox module (#1103)
  • Optimized version of hlstorgb and rgbtohls (#1154)

Removed

  • Remove numpy dependency (#1136)

Contributors

@dkoguciuk @edgarriba @lferraz @shijianjian

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - PyTorch 1.9.0, Stereo Camera and auto-images in documentation

Kornia 0.5.5 release

[0.5.5] - 2021-06-27

Added

Changed

  • Change GaussianBlur to RandomGaussianBlur (#1118)
  • Update ci with pytorch 1.9.0 (#1120)
  • Changed option for mean and std to be tuples in normalization (#987)
  • Adopt torch.testing.assert_close (#1031)

Removed

  • Remove numpy import (#1116)

Contributors

@copaah @ducha-aiki @edgarriba @eugene87222 @JoanFM @justanhduc @pmeier @shijianjian

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - Camera Calibration, Canny edge detection and more adavanced augmentation containers

Kornia 0.5.4 release

[0.5.4] - 2021-06-11

Added

  • Add Canny edge detection (#1020)
  • Added Batched forward function (#1058)
  • Added denormalize homography function (#1061)
  • Added more augmentations containers (#1014)
  • Added calibration module and Undistort 2D points function (#1026)
  • Added patch augmentation container (#1095)

Fixed

Changed

  • Resize regardless of number of dims, considering the last two dims as image (#1047)
  • Raise error if converting to unit8 image to gray with float weights (#1057)
  • Filter 2D->2d, 3D->3d (#1069)
  • Removed augmentation functional module. (#1067)
  • Make Morphology compatible with both OpenCV and Scipy (#1084)

Contributors

@asottile @Borda @ducha-aiki @edgarriba @jhacsonmeza @justanhduc @Manza12 @priba @shijianjian

Special thanks to @Borda @carmocca @asottile for the help to improve the code health of the package.

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - More augmentations, inverse augmentations and optimised CLAHE

Kornia 0.5.3 release

[0.5.3] - 2021-05-29

Added

  • Added inverse for augmentations (#1013)
  • Add advanced augmentations: RandomFisheye, RandomElasticTransform, RandomThinPlateSpline, RandomBloxBlur (#1015)

Fixed

  • Correct Sobel test_noncontiguous. Nothing was tested before. (#1018)
  • Fixing #795: findhomographydlt_iterated sometimes fails (#1022)

Changed

  • Refactorization of the morphology package (#1034)
  • Optimised clipping in clahe and some other minor optimisation (#1035)

Contributors

@Borda @dkoguciuk @edgarriba @Manza12 @lferraz @priba @shijianjian

If we forgot someone let us know :sunglasses:

- Python
Published by edgarriba over 4 years ago

kornia - Angle axis and Quaternion fixes, added Unsharped Mask

Kornia 0.5.2 release

[0.5.2] - 2021-05-14

Added

  • Added unsharp mask filtering (#1004)

Fixed

  • Fixed angle axis to quaternion order bug (#926)
  • Fixed type error for labtorgb conversion when using coremltools. (#1002)

Changed

  • Mask with unbatched motion from essential choose solution (#998)

thanks to all your contributions @amonszpart @AnimeshMaheshwari22 @askaradeniz @edgarriba @jatentaki

The Kornia Team :nerd_face:

- Python
Published by edgarriba almost 5 years ago

kornia - Bug fixes, augmentations, fp16 and more

Kornia 0.5.1 release

Highlights

In this patch release we include the following features - Fast version of RandomCropResize, RandomCrop - Add antialias support in kornia.geometry.resize - Added HardNet8 deep features - Experimental support for torch.float16 - Added the following modules for augmentations: - ImageToTensor - RandomInvert - RandomChannelShuffle - RandomGaussianNoise

[0.5.1] - 2021-04-30

Added

  • Added dtype for create_mesh (#919)
  • Added Hardnet8 (#955)
  • Added normalize boolean for remap (#921)
  • Added custom weights option for rgb2gray (#944)
  • Added fp16 support (#963)
  • Added ImageToTensor module and resize for non-batched images (#978)
  • Add more augmentations (#960)
  • Anti alias resize (#989)

Changed

  • Improve kornia porphology (#965)
  • Improve cuda ci workflow speed (#975)
  • Refactor augmentation module (#948)
  • Implement fast version of crop function in augmentations (#967)
  • Implement missing jit ops in kornia.geometry.transform (#981)

Fixed

  • Fixed RandomAffine translation range check (#917
  • Fixed the issue of NaN gradients by adding epsilon in focal loss (#924)
  • Allow crop size greater than input size. (#957)
  • Fixed RandomCrop bug (#951)

Removed

  • Deprecate some augmentation functionals (#943)

- Python
Published by edgarriba almost 5 years ago

kornia - Morphological operators, Deep descriptors, Video Augmentations and more

Kornia 0.5.0 release

In this release we have focus in bringing more classic Computer Vision functionalities to the PyTorch ecosystem, like morphological operators and more diversity with Deep Local Descriptors, color conversions and drawing functions. In addition, we have worked towards improving the integration with TPU and better support with Torchscript.

Highlights

Morphological Operators

As a highlight we include a kornia.morphology that implements several functionalities to work with morphological operators on high-dimensional tensors and differentiability. Contributed by @Juclique

Morphology implements the following methods: dilation, erosion, open, close, close, gradient, top_hat and black_hat.

```python from kornia import morphology as morph

dilatedimage = morph.dilation(tensor, kernel) # Dilation plotmorphimage(dilatedimage) # Plot ``` image

See a full tutorial here: https://github.com/kornia/tutorials/blob/master/source/morphology_101.ipynb

Deep Descriptors

We have added a set of local feature-related models: MKDDescriptor #841 by implemented and ported to kornia by @manyids2; also we ported TFeat, AffNet, OriNet from authors repos #846.

Here is notebook, showing the usage and benefits of new features. We also show how to seamlessly integrate kornia and opencv code via new conversion library kornia_moons.

Also: exposed set_laf_orientation function #869

image

Video Augmentations

We include a new operator to perform augmentations with videos VideoSequential. The module is based in nn.Sequential and has the ability to concatenate our existing kornia.augmentations for multi-dimensional video tensors. Contributed by @shijianjian

```python import kornia import torchvision

clip, , _ = torchvision.io.readvideo("drop.avi") clip = clip.permute(3, 0, 1, 2)[None] / 255. # To BCTHW input = torch.randn(2, 3, 1, 5, 6).repeat(1, 1, 4, 1, 1)

auglist = VideoSequential( kornia.augmentation.ColorJitter(0.1, 0.1, 0.1, 0.1, p=1.0), kornia.augmentation.RandomAffine(360, p=1.0), dataformat="BTCHW", sameonframe=False) )

out = aug(input) ``` image

See a full example in the following Colab: https://colab.research.google.com/drive/12dmHNkvEQrG-PHElbCXT9FgCr_aAGQSI?usp=sharing

Draw functions

We include an experimental functionality draw rectangle implemented in pure torch.tensor. Contributed by @mmathew23

```python rects = torch.tensor([[[110., 50., 310., 275.], [325., 100., 435., 275.]]]) color = torch.tensor([255., 0., 0.])

xout = K.utils.drawrectangle(x_rgb, rects, color) ``` image

See full example here: https://colab.research.google.com/drive/1me_DxgMvsHIheLh-Pao7rmrsafKO5Lg3?usp=sharing

More user contrib

Infrastructure

  • Update CI to pytorch 1.7.x and 1.8.0 @edgarriba
  • Improve testing matrix with different versions
  • TPU support @edgarriba @shijianjian
  • Better JIT support @edgarriba @shijianjian @ducha-aiki
  • Improved and test docs @shijianjian @edgarriba

Deprecations

  • Deprecated kornia.geometry.warp module.
    • DepthWarper is now in kornia.geometry.depth
    • HomographyWarper and related functions are now inside kornia.geometry.transform.
  • Deprecated kornia.contrib module.
    • max_pool_blurd2d is now in kornia.filters
  • Dropped support of Pytorch 1.5.1 #854

Warp and Crop

We refactored the interface of the functions warp_perspective, warp_affine, center_crop, crop_and_resize and crop_by_boxes in order to expose to the user the needed parameters by grid_sample [mode, padding_mode, align_corners]. #896

The param align_corners has been set by default to None that maps to True in case the user does not specify. This comes from the motivation to match the behavior of the warping functions with OpenCV.

Example of warp_perspective: python def warp_perspective(src: torch.Tensor, M: torch.Tensor, dsize: Tuple[int, int], mode: str = 'bilinear', padding_mode: str = 'zeros', align_corners: Optional[bool] = None) -> torch.Tensor:


Please review the full release notes here: https://github.com/kornia/kornia/blob/master/CHANGELOG.md

Thanks to all our contributors !!! :tada: :sunglasses:

- Python
Published by edgarriba almost 5 years ago

kornia - Improve 3D augmentations and 3D transforms low level API

Kornia 0.4.1 release

Highlights

We include new features for 3D augmentations:

  • RandomCrop3D
  • CenterCrop3D
  • RandomMotionBlur3D
  • RandomEqualize3D

Few more core functionalities to work on 3D volumetric tensors: - warp_affine3d - warp_perspective3d - get_perspective_transform3d - crop_by_boxes3d - motion_blur3d - equalize3d - warp_grid3d

Details changes

Added

  • Update docs for get_affine_matrix2d and get_affine_matrix3d (#618)
  • Added docs for solarize, posterize, sharpness, equalize (#623)
  • Added tensor device conversion for solarize params (#624)
  • Added rescale functional and transformation (#631)
  • Added Mixup data augmentation (#609)
  • Added equalize3d (#639)
  • Added decompose 3x4projection matrix (#650)
  • Added normalize_min_max functionality (#684)
  • Added random equalize3d (#653)
  • Added 3D motion blur (#713)
  • Added 3D volumetric crop implementation (#689)
    • warp_affine3d
    • warp_perspective3d
    • get_perspective_transform3d
    • crop_by_boxes3d
    • warp_grid3d

Changed

  • Replace convolution with unfold in contrib.extract_tensor_patches (#626)
  • Updates Affine scale with non-isotropic values (#646)
  • Enabled param p for each augmentation (#664)
  • Enabled RandomResizedCrop batch mode when sameonbatch=False (#683)
  • Increase speed of transform_points (#687)
  • Improves find_homography_dlt performance improvement and weights params made optional (#690)
  • Enable variable side resizing in kornia.resize (#628)
  • Added Affine transformation as nn.Module (#630)
  • Accelerate augmentations (#708)

Fixed

  • Fixed error in normaltransformpixel3d (#621)
  • Fixed pipelining multiple augmentations return wrong transformation matrix (#645)(645)
  • Fixed flipping returns wrong transformation matrices (#648)
  • Fixed 3d augmentations return wrong transformation matrix (#665)
  • Fix the SOSNet loading bug (#668)
  • Fix/random perspective returns wrong transformation matrix (#667)
  • Fixes Zca inverse transform (#695)
  • Fixes Affine scale bug (#714)

Removed

  • Removed warp_projective (#689)

Contributors

@gaurav104 @shijianjian @mshalvagal @pmeier @ducha-aiki @qxcv @FGeri @vribeiro1 @ChetanPatil28 @alopezgit @jatentaki @dkoguciuk @ceroytres @ag14774

- Python
Published by edgarriba over 5 years ago

kornia - 3D augmentations, local features matching, homographies and epipolar geometry

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).

```python import torch import kornia as K

desc1 = 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). ```python

import torch import kornia as K

pts1 = torch.rand(1, 8, 2) pts2 = torch.rand(1, 8, 2) H = K.findhomographydlt(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:

```python import torch import kornia as K

x = 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.]], [[0., 0., 1.], [0., 1., 0.], [1., 0., 0.]], [[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)

- Python
Published by edgarriba over 5 years ago

kornia - Kornia 0.3.2 release

Kornia 0.3.2 release

This release is just a checkpoint for the features in v0.4.0 with support to PyTorch 1.5.1.

To see the new set of features check the release notes for Kornia 0.4.0.

- Python
Published by edgarriba over 5 years ago

kornia - Expose align corners, add support to Python 3.8 and more fixes

Kornia 0.3.1 release

This release mainly introduces the following items: - Add support to Python 3.8 - Exposes and fixes issues around align_corners. - Improve testing infrastructure adding parametrize for different devices and dtype and flake8/mypy support throw pytest by caching intermediate results. Test usage example:

```pytest -v --device cpu,cuda --dtype float16,float32,float64 --flake8 --mypy```

Improvements

  • Update to python 3.8 (#550)
  • Improve testing framework (#560)
  • Local feature fixes and nms improvements (#545)
  • Random motion blur improvments (#562)

Fixes

  • Expose align_corners everywhere, where interpolation occurs (#546)
  • Soft-argmax test fixes, renaming and enables jit (#553)

Bugs

  • Fix tests in TestSpatialSoftArgmax2d (#544)

Docs

  • Updated docstring for augmentation module (#554)

- Python
Published by edgarriba almost 6 years ago

kornia - PyTorch 1.5 support, accelerated Data Augmentation, stable GPU testing and easy ecosystem integration

Kornia 0.3.0 release

Today we released 0.3.0 which aligns with PyTorch releases cycle and includes:

  • Full support to PyTorch v1.5.
  • Semi-automated GPU tests coverage.
  • Documentation has been reorganized [docs]
  • Data augmentation API compatible with torchvision v0.6.0.
  • Well integration with ecosystem e.g. Pytorch-Lightning.

For more detailed changes check out v0.2.1 and v0.2.2.

Highlights

Data Augmentation

We provide kornia.augmentation a high-level framework that implements kornia-core functionalities and is fully compatible with torchvision supporting batched mode, multi device cpu, gpu, and xla/tpu (comming), auto differentiable and able to retrieve (and chain) applied geometric transforms. To check how to reproduce torchvision in kornia refer to this Colab: Kornia vs. Torchvision @shijianjian

```python import kornia as K import torchvision as T

kornia

transformfcn = torch.nn.Sequential( K.augmentation.RandomAffine( [-45., 45.], [0., 0.5], [0.5, 1.5], [0., 0.5], returntransform=True), K.color.Normalize(0.1307, 0.3081), )

torchvision

transform_fcn = T.transforms.Compose([ T.transforms.RandomAffine( [-45., 45.], [0., 0.5], [0.5, 1.5], [0., 0.5]), T.transforms.ToTensor(), T.transforms.Normalize((0.1307,), (0.3081,)), ]) ```

Ecosystem compatibility

Kornia has been designed to be very flexible in order to be integrated in other existing frameworks. See the example below about how easy you can define a custom data augmentation pipeline to later be integrated into any training framework such as Pytorch-Lighting. We provide examples in [here] and [here].

```python class DataAugmentatonPipeline(nn.Module): """Module to perform data augmentation using Kornia on torch tensors.""" def init(self, applycolorjitter: bool = False) -> None: super().init() self.applycolorjitter = applycolor_jitter

    self._max_val: float = 1024.

    self.transforms = nn.Sequential(
        K.augmentation.Normalize(0., self._max_val),
        K.augmentation.RandomHorizontalFlip(p=0.5)
    )

    self.jitter = K.augmentation.ColorJitter(0.5, 0.5, 0.5, 0.5)

@torch.no_grad()  # disable gradients for effiency
def forward(self, x: torch.Tensor) -> torch.Tensor:
    x_out = self.transforms(x)
    if self._apply_color_jitter:
        x_out = self.jitter(x_out)
    return x_out

```

GPU tests

Now easy to run GPU tests with pytest --typetest cuda

- Python
Published by edgarriba almost 6 years ago

kornia - Data augmentation and GPU tests checkpoint before PyTorch v1.5.0

Kornia 0.2.2 Release Notes

This release is a checkpoint with minimum data augmentation API stability plus fixing some GPU tests before kornia upgrades to PyTorch v.1.5.0.

  • API changes
  • Improvements
  • Bug Fixes
  • Documentation

API changes

  • Decoupled returntransform from apply* function (#534)

Improvements

  • improve setup packaging and build manywheel script (#543)

Bug Fixes

  • fix broken gpu tests (#538)
  • update sosnet urls (#541)

Documentation

  • reorganises color docs and adds ycbcr (#540)
  • reorganise documenation in subsections (#542)

- Python
Published by edgarriba almost 6 years ago

kornia - Data augmentation framework, deep descriptors and more.

Kornia 0.2.1 Release Notes

  • Highlights
  • API changes
  • New Features
  • Improvements
  • Bug Fixes
  • Performance

Highlights

In this release we support compatibility between kornia.augmentation and torchvision.transforms.

We now support all the same existing operations with torch.Tensor in the GPU with extra features such as returning for each operator the transformation matrix generated to produce such transformation.

```python import kornia as K import torchvision as T

kornia

transformfcn = torch.nn.Sequential( K.augmentation.RandomAffine( [-45., 45.], [0., 0.5], [0.5, 1.5], [0., 0.5], returntransform=True), K.color.Normalize(0.1307, 0.3081), )

torchvision

transform_fcn = T.transforms.Compose([ T.transforms.RandomAffine( [-45., 45.], [0., 0.5], [0.5, 1.5], [0., 0.5]), T.transforms.ToTensor(), T.transforms.Normalize((0.1307,), (0.3081,)), ]) ``` Check the online documentations with the updated API [DOCS]

Check this Google Colab to see how to reproduce same results [Colab]

kornia.augmentation as a framework

In addition, we have re-designed kornia.augmentation such in a way that users can easily contribute with more operators, or just use it as a framework to create their custom operators.

Each of the kornia.augmentation modules inherit from AugmentationBase and one can easily define a new operator by creating a subclass and overriding a couple of methods.

Let's take a look at a custom MyRandomRotation . The class inherits from AugmentationBase making it a nn.Module so that can be stacked in a nn.Sequential to compute chained transformations.

To implement a new functionality two things needed: override get_params and apply

The get_params receives the shape of the input tensor and returns a dictionary with the parameters to use in the apply function.

The applyfunction receives as input a tensor and the dictionary defined in get_params; and returns a tuple with the transformed input and the transformation applied to it.

```python class MyRandomRotation(AugmentationBase): def init(self, angle: float, returntransform: bool = True) -> None: super(MyRandomRotation, self).init(self.apply, returntransform) self.angle = angle

def get_params(self, batch_shape: torch.Size) -> Dict[str, torch.Tensor]:
  angles_rad torch.Tensor = torch.rand(batch_shape) * K.pi
  angles_deg = kornia.rad2deg(angles_rad) * self.angle
  return dict(angles=angles_deg)

def apply(self, input: torch.Tensor, params: Dict[str, torch.Tensor]):
  # compute transformation
  angles: torch.Tensor = params['angles'].type_as(input)
  center = torch.tensor([[W / 2, H / 2]]).type_as(input)
  transform = K.get_rotation_matrix2d(
    center, angles, torch.ones_like(angles))

  # apply transformation
  output = K.warp_affine(input, transform, (H, W))

  return (output, transform)

how to use it

load an image and cast to tensor

img1: torch.Tensor = imread(...) # BxDxHxW

instantiate and apply the transform

aug = MyRandomRotation(45., return_transformation=True)

img2, transform = aug(img1) # BxDxHxW - Bx3x3 ```

New Features

kornia.color

  • Implement RGB to XYZ (#436)
  • Implement RGB to LUV (#442)
  • Implement histogramd2 (#530)

kornia.feature

  • Implement hardnet descriptor (#498)
  • Implement deep descriptor sosnet (#521)

kornia.jit

  • Create kornia.jit module and exposes rgbtograyscale (#261)

API Changes

  • Remove PIL dependency (#512)
  • Remove float casting in imagetotensor (#497)

Improvements

  • Adds gradcheck for RandomCrop and RandomResizedCrop (#439)
  • Update spatialsoftargmax.py (#496)
  • Add epsilon value to make hessian matrix robust (#504)
  • Add normalize_points flag in depth to 3d (#511)
  • Functional augmentation performance test against Torchvision (#482)
  • AffineTransformation alignment and other fixes (#514)

Performance

  • Filter speed up conditional (#433)
    • Improves by far the time performance for filtering.
  • Speed-up warp_affine and fix bugs in RandomAffine (#474)
  • Improve homography warper (#528)

Docs

  • Make link work for PSNRLoss (#449)
  • Change psnr to psnr_loss in docs (#450)
  • Fix import problem and fix docs for LuvToRgb and PSNR (#447)
  • Fix outdated example (#465)
  • Update color_adjust.py (#479)
  • Missing commas in bibtex (#500)

Bug fixes

  • Fix device problem in test (#456)
  • Bug fixed in device tests (#475)
  • Add epsilon value to sobel to improve backprop stability (#513)

- Python
Published by edgarriba almost 6 years ago

kornia - Data augmentation API, color conversion improvements, GPU tests and more

Kornia 0.2.0 Release Notes

  • Highlights
  • New Features
    • kornia.color
    • kornia.feature
    • kornia.geometry
    • kornia.losses
  • Improvements
  • Bug Fixes

Kornia v0.2.0 release is now available.

The release contains over 50 commits and updates support to PyTorch 1.4. This is the result of a huge effort in the desing of the new data augmentation module, improvements in the set of the color space conversion algorithms and a refactor of the testing framework that allows to test the library using the cuda backend.

Highlights

Data Augmentation API

From this point forward, we will give support to the new data augmentation API. The kornia.augmentation module mimics the best of the existing data augmentation frameworks such torchvision or albumentations all re-implemented assuming as input torch.Tensor data structures that will allowing to run the standard transformations (geometric and color) in batch mode in the GPU and backprop through it.

In addition, a very interesting feature we are very proud to include, is the ability to return the transformation matrix for each of the transform which will make easier to concatenate and optimize the transforms process.

A quick overview of its usage: ```python

import torch import kornia

input: torch.Tensor = loadtensordata(....) # BxCxHxW

transforms = torch.nn.Sequential( kornia.augmentation.RandomGrayscale(), kornia.augmentation.RandomAffine(degrees=(-15, 15)), )

out: torch.Tensor = transforms(input) # CPU out: torch.Tensor = transforms(input.cuda()) # GPU

same returning the transformation matrix

transforms = torch.nn.Sequential( kornia.augmentation.RandomGrayscale(returntransformation=True), kornia.augmentation.RandomAffine(degrees=(-15, 15), returntransformation=True), )

out, transform = transforms(input) # BxCxHxW , Bx3x3 ```

This are the following features found we introduce in the module:

  • BaseAugmentation (#407)
  • ColorJitter (#329)
  • RandomHorizontalFlip (#309)
  • MotionBlur (#328)
  • RandomVerticalFlip (#375)
  • RandomErasing (#344)
  • RandomGrayscale (#384)
  • Resize (#394)
  • CenterCrop (#409)
  • RandomAffine (#403)
  • RandomPerspective (#403)
  • RandomRotation (#397, #418)
  • RandomCrop (#408)
  • RandomResizedCrop (#408)
  • Grayscale

GPU Test

We have refactored our testing framework and we can now easily integrate GPU tests within our library. At this moment, this features is only available to run locally but very soon we will integrate with CircleCI and AWS infrastructure so that we can automate the process.

From root one just have to run: make test-gpu

Tests look like this: ```python import torch from test.common import device

def testrgbtograyscale(self, device): channels, height, width = 3, 4, 5 img = torch.ones(channels, height, width).to(device) assert kornia.rgbto_grayscale(img).shape == (1, height, width) ``` Ref PR: * parametrize test functions to accept torch.device cpu/cuda @edgarriba @ducha-aiki da793cd 0fcb85e

New Features

kornia.color

We have added few more algorithms for color space conversion:

  • rgbtohsv (#299)
  • rgbtohls (#342)
  • rgbtoycbcr (#345)
  • ycbcrtorgb (#345)
  • rgbtoyuv (#337)
  • yuvtorgb (#337)
  • rgbtorgba (#401)
  • rgbatorgb (#401)
  • bgrtobgra (#401)
  • bgratobgr (#401)
  • bgrtogray (#266)
  • add_weighted (#295)

kornia.geometry

  • Implement kornia.hflip, kornia.vflip and kornia.rot180 (#268)
  • Implement kornia.transform_boxes (#368)

kornia.losses

  • Implements to total_variation loss (#250)
  • Implement PSNR loss (#272)

kornia.feature

  • Added convenience functions for work with LAF: get keypoint, orientation (#340)

Improvements

  • Fixed conv_argmax2d/3d behaviour for even-size kernel and added test (#227)
  • Normalize accepts floats and allows broadcast over channel dimension (#236)
  • Single value support for normalize function (#301)
  • Added boundary check function to local features detector (#254)
  • Correct cropandresize on aspect ratio changes. (#305)
  • Correct adjust brightness and contrast (#304)
  • Add tensor support to Hue, Saturation and Gamma (#324)
  • Double image option for scale pyramid (#351)
  • Filter2d speedup for older GPUs (#356)
  • Fix meshgrid3d function (#357)
  • Added support for even-sized filters in filter2d (#374)
  • Use latest version of CircleCI (#373)
  • Infer border and padding mode to homography warper (#379)
  • Apply normalization trick to conv_softmax (#383)
  • Better nms (#371)
    • added spatial gradient 3d
    • added hardnms3d and tests for hardnms 2d
    • quadratic nms interp
    • update the tests because of changed gaussian blur kernel size in scale pyramid calculation
    • no grad for spatial grad
  • Focal loss flat (#393)
  • Add optional mask parameter in scale space (#389)
  • Update to PyTorch 1.4 (#402)

Bug fixes

  • Add from homogeneous zero grad test and fix it (#369)
  • Filter2d failed with noncontiguous input (view --> reshape) (#377)
  • Add ceil_mode to maxblur pool to be able to be used in resnets (#395)

Breaking Changes

  • cropandresize before: "The tensor must have the shape of Bx4x2, where each box is defined in the following order: top-left, top-right, bottom-left and bottom-right. The coordinates order must be in y, x respectively" after: "The tensor must have the shape of Bx4x2, where each box is defined in the following (clockwise) order: top-left, top-right, bottom-right and bottom-left. The coordinates must be in the x, y order."

As usual, thanks to the community to keep this project growing. Happy coding ! :sunriseovermountains:

- Python
Published by edgarriba about 6 years ago

kornia - Kornia: Open Source Differentiable Computer Vision Library for PyTorch

Table of Contents

We have just released Kornia: a differentiable computer vision library for PyTorch.

It consists of a set of routines and differentiable modules to solve generic computer vision problems. At its core, the package uses PyTorch as its main backend both for efficiency and to take advantage of the reverse-mode auto-differentiation to define and compute the gradient of complex functions.

Inspired by OpenCV, this library is composed by a subset of packages containing operators that can be inserted within neural networks to train models to perform image transformations, epipolar geometry, depth estimation, and low level image processing such as filtering and edge detection that operate directly on tensors.

It has over 300 commits and majorly refactors the whole library including over than 100 functions to solve generic Computer Vision problems.

Highlights

Version 0.1.4 includes a reorganization of the internal API grouping functionalities that consists of the following components:

  • kornia | a Differentiable Computer Vision library like OpenCV, with strong GPU support.
  • kornia.color | a set of routines to perform color space conversions.
  • kornia.contrib | a compilation of user contrib and experimental operators.
  • kornia.feature | a module to perform local feature detection.
  • kornia.filters | a module to perform image filtering and edge detection.
  • kornia.geometry | a geometric computer vision library to perform image transformations, 3D linear algebra and conversions using differen camera models.
  • kornia.losses | a stack of loss functions to solve different vision tasks.
  • kornia.utils | image to tensor utilities and metrics for vision problems.

Big contribution in kornia.features:

  • Implemented anti-aliased local patch extraction.
  • Implemented classical local features cornerness functions: Harris, Hessian, Good Features To Track.
  • Implemented basic functions for work with local affine features and their patches.
  • Implemented convolutional soft argmax 2d and 3d operators for differentable non-maxima suppression.
  • implemented second moment matrix affine shape estimation, dominant gradient orientation and SIFT patch descriptor.

Infrastructure

  • Migration to CircleCI towards GPU testing 30099b4b0481f4151b893f77d7bf297ee47d268b
  • Added Code of Conduct file 5e0848a2d41780d632632afb81e0371e9dca6a33
  • Redefined the CONTRIBUTING notes
  • Enforce python minimal Python 3.6 usage 34e21e5f81a0376fc8bb45da52003f20a101d591
  • Creation of an external repo to host the website www.kornia.org.

Breaking Changes

  • Removed nms and normalization from Harris response function 2209807ce8db8fe82eabbe6ca51e6370beea2934
  • Renames GaussianBlur -> GaussianBlur2d and added an input to specify pad b0c522e60ef4c82a3d1881dd5901a25d7a4a02c5
  • Chaneged batch support for tensor2img and img2tensor 705a82f1ca308087b7d62d8ce452cde1aeeaabae
  • Fixed torch.clamp for homogeneous division 506b0c98ed245373544732dd49fc4612d7075501

New Features

  • Several functionalities for Local Affine Frame (LAF): extract_patches_from_pyramid, extract_patches_simple, normalize_laf, ellipse_to_laf, make_upright, scale_laf, get_laf_scale 0a3cbb02850ac78059e0615da93144b5a64d3330
  • Differentiable SIFT descriptor 7f0eb809f1509c452d85000fd002b12c22e358ca
  • Added implementation of the differentiable spatial to numerical (DSNT) layer and related operations. abb4afabe1a37082e8938cfe7f227e57042d9803
  • Spatial gradient 1d 362adfc1af06e0abd945e84bf00c5b8a437f3aa3
  • Scale pyramid for local features detection 413051eb4c1b36fe3548a65cee9ab2d8ba45086f
  • Added geometry.depth submodule including: depth_to_3d, depth_to_normals, warp_frame_depth d1dedb8d37f99b752467ed4acaf4f767afbbad49
  • Implement Gaussian Pyramid bc586cb4bf8454d33fed721bc6f045767191374e
  • Implement Filter2D to apply arbitrary depthwise 2d kernels 94b56f2d43ed87a259aca3e6313d0f7a1222baf5
  • Implement to save/load pointclouds 4f32351c0dfd2d0d1779e9eb1d0028e3d3b904ab
  • implement project_points 636f4f5338e4fc1b6d32140c6f1febae3b64eb96
  • Implement unproject_points b02f403feaf1fdeb574fb87e1d70157ec0b4dbff
  • Implement denormalize_coordinates b07ec45410f45469bad2067ce03b83dddcabb7c0
  • Implement harris_corner detector 977a1f6a8c7beef9c339fdd695032dec2705c7d3
  • Implement non_maxima_suppression_2d 84cc1287fcd9df2a437a2d25a61f171097047a76
  • Implement median_filter 6b6cf0543028dcf3bfb25a0ae9104e6ade26037e
  • Implement blur_filter d4c8df933570fa95546e84517a6d676e302e6e7d
  • Implement sobel_filter operator 9abe4c5afdbe486baadf07b427ad5468d57da603
  • Implement max_blur_pool_2d 621be3b59055f000896c45fe33a28fa3ca680841
  • Implement pyrup and pyrdown a4e110cd47dd6c7792751fb7294d068b7655486a
  • Implemen crop_and_resize 41b4fed573c37c7310e4d7e03b73a54bce1eb2ab
  • Implement center_crop b1188d50f7ecae001832e05e606ca55d0d630ae6
  • Implement inverse_affine_matrix 6e10fb9a0859ef35f82b6e2dfd58af828bda7a8c
  • Implement opencv like remap function b0401deac4b54e201095705ec8c18eabe943cd2b
  • Implement affine ceb3faf3b89596ba23bdc7e0f616b218edf997df
  • Implement shear 81c5a2798f00663ee64ff74db87340daa6edb08d
  • Implement scale 75a84a373e9ce142fb4a1ac0d7fde8f3790b861c
  • Implement translate 11af4dde591258e057d1973bb00529f49fa6d63f
  • Implement rotate 89c6d964c5a18254adf73a5f8da00d8a5068e7bc
  • Implement Laplacian filter 5e3a89a2e630ae9d0199ff388217e2d5a11c4f86
  • Implement rgb_to_gray 9a2bea6057f4cf99eb6c16c96d5a1c952d95b4b2
  • Implement vectorised confusion_matrix f30606209f20f9f2d879b2eaec80215cc274a80a
  • Implement normalization on tensors 4c3f8fa52d3b9d86843716a99d5c833e80929212
  • Implement rgb_to_bgr e25f6a4900ede8786a0eee38f58f4ffd0908535a
  • Implement hsv_to_rgb 9726872019d71c3b9a3e7cabaf51e77a96220a45
  • Implement adjust_brightness b8fd8b6bce1707ea8a0b2fd5ba9498fe10d586b8

Bug Fixes

  • Normalize filtering functions kernels a301e3cf6192aff4cbbadda979cc48b17504684f
  • Fix the bug in spatial gradient with padding 5635e45830461d9f40da68a3318755d50a425b17
  • Disable JIT tests 464931720d7b2609ca25f95f29b7a47ba5af2e2f
  • Fix pyrdown with avg_pool2d b83514302232cf8bc31c30f3981a168dd7b55e39
  • Fix formulation issue in rotation_matrix_to_quaternion 58c6e8e7038ad1ca4d9051e04b54b6a42fd72a74
  • Switch torch.gesv -> torch.solve in get_perspective_transform c347a41e85eae78d73ea821b06623383d7a142a4
  • Fix and refactor test_warp_perspective d19121effb69d4c17d53f6bea010941cb7730f32
  • Fixed and updated the quaternion related docs to reflect quaternions 0161f65831ab9f975575586c4c1b1aec6e8a6b11
  • Remove some unused test functions a64a8fb80e5e666caefc806325a2c338ee50f81f

Contributors

  • @anibali
  • @carlosb1
  • @ducha-aiki
  • @dvd42
  • @edgarriba
  • @jiangwei221
  • @priba
  • @varunagrawal

- Python
Published by edgarriba over 6 years ago

kornia - support for PyTorch v1.0.1, PinholeCamera API, losses collections: FocalLoss, DiceLoss, SpatialSoftArgmax2d, MyPy static analysis and Homogeneous transforms module.

Package

  • Migrated the project to Arraiy Open Source Organization: https://github.com/arraiyopensource/torchgeometry. 48ad11f39f69be95fe35c164414ad58e0034f5d4
  • Update with support of PyTorch v1.0.1. In fact, we test each time against nightly builds. 5c9d9ae1ccf13fc2381d62be6f5b4c81c265608b
  • Fix issue with pip package PyTorch minimal version. Now we require at least v1.0.0. 6e16734d68074f22fb67a8b1c4418e4917e5b1f1
  • Package version file is auto-generate and too keep tracked sha. f337b3c131b2482a961f5aa895a9b344814bff5a
  • Added codecov support to keep tracked tested code. e609b2112f25806d02364681d57a29b977950f59

Breaking Changes

  • Refactor DepthWarper API - now accepts PinholeCamera objects as parameters: python >>> # pinholes camera models >>> pinhole_dst = tgm.PinholeCamera(...) >>> pinhole_src = tgm.PinholeCamera(...) >>> # create the depth warper, compute the projection matrix >>> warper = tgm.DepthWarper(pinhole_dst, height, width) >>> warper.compute_projection_matrix(pinhole_src) >>> # warp the destionation frame to reference by depth >>> depth_src = torch.ones(1, 1, 32, 32) # Nx1xHxW >>> image_dst = torch.rand(1, 3, 32, 32) # NxCxHxW >>> image_src = warper(depth_src, image_dst) # NxCxHxW

New Features

  • Added new PinholeCamera API to represent pinhole camera models. b6ec592bc4d00ba942d0f3d2085534acdefd783f pinhole_model
    • Refactor and moved code from conversions.py and created a dedicated module for linear transforms transformations.py. a1c25b1c5e3a5ac4e5109ea0e1b7256ba8e4ee56
    • boxplus_transformation, boxminus_transformation, inverse_transformation, transform_points.
    • Added a collection of losses:
    • Image: SSIM f08812168984174d6054c5b21298963cdf421cd8
    • Depth: InverseDepthSmoothnessLoss 42a1d22df0691444664c182eae7fc10acaa428cc
    • Semantic segmentation:
    • Diceloss 9b0fddf9055cb9a948856d087b52073551c44129
    • TerskyLoss 89246d269739f89ed0731f52ff543863882efa48
    • FocalLoss ffe4cb1b74ecb81baef05f97fe6c62f176336fd7
    • Added SpatialSoftArgmax2d operator to extract 2D coordinates from probability maps. cf7bb292dbe19242e0b207a8747da601a27e4cf3
    • Added extract_tensor_patches routine similar to tf.extract_image_patches but for multidimensional tensors instead of images. f60fa57b4dcf9462e443ee71bf571cc6e31a7939
    • Added boxplus_transform and boxminus_transform to compose or compute relative pose functions. e0882ea32bb13e62275b678ddb60915058397d35

Bug Fixes

  • Fixed DepthWarper in order to accept mini-batch computation. 7175b4f93f5cb855eb8ab4011c33e79cb32bf3fa
  • Added missing tests for warp_affine. 57cbd29aa291dc0cf60e6cff6b0665c91db39330
  • Fixed and refactored quaternion_to_axis_angle and axis_angle_to_quaternion to avoid nans. 4aa0bca9cd2ab95b3edb7d043ff16d473b2e04b7

Test

  • Updated code with python typing: https://docs.python.org/3/library/typing.html to perform static analysis tests using MyPy: http://mypy-lang.org 3c02b58e1d4de3e7583020c332a7b982c9e97d74
  • Added pytest fixtures to split between CPU/CUDA tests. Additionally, we added Makefile commands to launch the tests. 1aff7f65d6535e88abc0d5383846be75d37e4af9
  • Improved InversePose tests. d6a508c7600e5e464d6910028f7771f8d18fe722
  • Improved HomographyWarper tests. 43bd8c2ea669d89d57a063998b491be18d2ab39a

contributors: - @edgarriba - @carlosb1 - @Wizaron - @prlz77 - @kajal-puri

- Python
Published by edgarriba almost 7 years ago

kornia - warp_perspective, get_perspective_transform, get_rotation_matrix2d, update to PyTorch v1.0.0, update test with pytest and pip package release

Table of Contents

  • Breaking Changes
  • New Features
  • Bug Fixes
  • Documentation improvements

Breaking Changes

  • tgm.inverse has been removed since now Pytorch supports batched version for torch.inverse f6c210d87ef63e6a07917cdf88b44091c52ede69

New Features

  • Added tgm.warp_perspective matching OpenCV interface d53cbce5d779fbc92b3449ed3c3c88f55f8b88ec
  • Added tgm.get_perspective_transform matching OpenCV interface a7db348c5978efc7870c649757947123bfbf78fb
  • Added tgm.get_rotation_matrix2d matching OpenCV interface 876b2c601d4d5028ab84cc2735fa3fbb018b4c1b

Bug Fixes

  • Fixed bug for inplace operation in tgm.inverse_pose 0aba15d0b3ea79cfc3ed6a31ba088f86db643658

Documentation improvements

  • Added notebook tutorial for tgm.warp_affine and tgm.warp_pesrpective 894bf52b6c1be9780e190051e8d7b9b679733e2e

Other improvements

  • Update to Pytorch v1.0.0 3ee14c83285f05ce8d29725a0489d0c9f8b058ed
  • Refactor in testing framework. Removed unittest and now using pytest since it's easy to parametrize unit tests.
    • parametrized tests for different batch sizes
    • parametrized tests for device types: cpu and cuda. Note: need to test on cuda yet.
  • Now we have official pip package to install the library: pip install torchgeometry
    • URL: https://pypi.org/project/torchgeometry/0.1.1

- Python
Published by edgarriba about 7 years ago

kornia - v0.1.0 Package initial release

This is the initial release of the torchvision package.

It contains a set of routines and modules for geometric computer vision implementing multi-view reprojection primitives that work on images and feature maps warping. In addition, we provide routines for conversions and utilities for the pinhole model cameras.

Table of Contents

API

  • Pinhole
    • inverse_pose 001097c
    • pinhole_matrix 063b0c6
    • inversepinholematrix 063b0c6
    • scale_pinhole 063b0c6
    • homographyiH_ref 063b0c6
  • Conversions
    • pi fb56c9c
    • rad2deg fb56c9c
    • deg2rad fb56c9c
    • convertpointsfrom_homogeneous f13c462
    • convertpointsto_homogeneous f13c462
    • transform_points 1a1511c
    • angleaxistorotationmatrix 4c929d5
    • rtvectopose 4c929d5
    • rotationmatrixtoangleaxis f999165
    • rotationmatrixto_quaternion f999165
    • quaterniontoangle_axis f999165
  • Warping
    • HomographyWarper 2e54229
    • DepthWarper cd03569
  • Utils
    • tensortoimage 3ad7d05
    • imagetotensor 3ad7d05
    • inverse 1a1511c

Test

  • docker kit ae8d9e1
  • automated test with TravisCI c213e3e
  • lint tests c213e3e

Documentation

  • sphinx documentation b9251ab
  • development e800c36

Examples:

  • homography regression ce1524d
  • image warped by depth f999165
  • jupiter notebooks 3c96835

- Python
Published by edgarriba over 7 years ago