Releases: kornia/kornia
Release list
v0.9.0rc1 — compile-first, deployable augmentations
kornia 0.9.0rc1 — headline: compile-first, deployable augmentations.
Release candidate. Install with
pip install --pre kornia(won't be picked up by a plainpip install kornia). Please trytorch.export/torch.compileon your pipelines and report regressions before the final 0.9.0.
🚀 Highlights
torch.exportsupport — deterministic transforms (Normalize/Denormalize/Resize/CenterCrop/PadTo) andAugmentationSequentialpipelines now capture cleanly and match eager, on torch 2.9.1 and 2.10 (#3856, #3858, #3861).torch.compilefullgraph sweep — ~20 ops across augmentation / enhance / color / filters / losses / geometry made graph-break-free, with a PR-timedynamoCI job on the CI torch version.- Performance — equalize 18×,
elastic_transform2d40×,RandomChannelShuffle12×, posterize 16× (GPU); lazy transform-matrix (up to 2.9×); RNG-device propagation through container.to()/.cuda(); the compiled pipeline beats torchvision v2.
✨ New Features
- Multispectral (N-channel)
RandomGrayscale(#3853) PatchMixaugmentation (#3664)- Deterministic
ColorJitterorder, fullgraph-safe (#3799) correlate2d/convolve2d/correlate3d/convolve3daliases (#3604)- Optional image shape-mismatch support (#3600)
🐛 Fixes
- cusolver-free warps + closed-form 3×3 inverse — geometric ops run on the Jetson wheel (#3834, #3840)
transform_pointsreturns empty unchanged for 0-point input (#3855)- Container
torch.export: resample-mode crop after a resize no longer uses a stale shape (#3861) - ONNX-exportability regressions (#3779); sharpness device/dtype (#3830);
median_blurB=0; LightGlue empty keypoints (#3584);BgrToRgba(#3673)
🧹 Internal
_commit_statestate-write chokepoint (#3857);_blend_by_probdispatch DRY (#3844); dead-override + dead-code removal (#3843, #3862)
📖 Docs
- Honest benchmark framing +
[0,1]input footgun note (#3850); custom-augmentation guide fix (#3852); base-class hierarchy diagram (#3860); torch.export/compile/ONNX deployment section (#3859)
🤖 Generated with Claude Code
v0.8.3
Summary
Kornia v0.8.3 is a patch release rolling up ~175 commits since v0.8.2. Highlights:
new feature detectors and descriptors (XFeat, ALIKED), VisualPrompter batched
inference, half-precision (float16/bfloat16) support and test infrastructure,
performance improvements to core geometry ops (depth_to_normals ~3x, transform
points, denormalize_points_with_intrinsics ~2x), MPS device fixes, ONNX export
fixes, and broad documentation/docstring coverage. Several deprecated utilities
in kornia.utils begin emitting DeprecationWarning targeting future removal.
Features
- add missing docstrings to color module (#3712) (9ffbca8)
- feat: enable batched inference and add tests for VisualPrompter (#3671) (bbb581f)
- Add XFeat, add new weights to (#3654) (67e6c12)
- Add missing docstrings to kornia/color/sepia.py (#3628) (45c0b8e)
- Add small sr test suite (#3557) (5af8116)
- Add unit tests and improve RGB↔YUV conversion accuracy (#3539) (dd1568e)
- feat: add AdaptiveQuadInterp3d and scale-space detector speedups (#3623) (398665c)
- feat: add ALIKED local feature detector and descriptor (#3617) (42e4f78)
- feat: add iterative_quad_interp3d with Cramer's rule (#3616) (1940cf5)
- feat(image): add KORNIA_CHECK_IMAGE_LAYOUT for layout validation (#3549) (af4419f)
- feat(geometry): implement closed-form solve_quartic (#3536) (4b3f216)
- Enable grouping for GitHub Actions in Dependabot (#3506) (0a6d910)
- Add GitHub Actions updates to Dependabot config (#3497) (4c5a843)
- Add SmolVLM2 model scaffold (#3475) (74d3354)
- feat: add rectangular and gaussian kernels for mutual information loss (#3478) (8856d82)
- feat(contrib): add 3D volume support to distance_transform (#3470) (e816450)
- feat: add initial skeleton for paligemma mode (#3477) (a38cf3d)
- feat(sam3): Implement Phase 2 architecture (PromptEncoder + MaskDecoder) (#3433) (e912db6)
- Add gradcheck for RandomVerticalFlip (#3476) (b0900e4)
- feat: Add KimiVL Vision-Language Model implementation (#3448) (ee23688)
- New features: Mutual information losses and normalized mutual information losses. (#3398) (feb79cf)
- add more instructions and development protocol (#3438) (3982489)
- Implement Siglip2 in kornia.models (#3412) (5c04bfc)
- implement ai policy for contributors (#3435) (240c078)
- implement custom errors (#3430) (e68ac75)
- Add GitHub Copilot repository instructions (#3425) (d416945)
- Add tests for augmentation parameter validation utilities (#3417) (8522699)
- Add parametrized_test decorator and framework files (3a98a57)
- feat: automate simple test cases with parametrized_tester decorator (#3367) (4002382)
- feat: support padding_mode="fill" and fill_value in RandomAffine (#3391) (c809fbd)
Bug Fixes
- fix(tests): verify gradients through distCoeff and K in distort_point… (#3685) (430ecc4)
- fix(geometry): harmonise dtypes in transform_points bmm (#3707) (1a3af2a)
- fix: propagate device and dtype in get_shear_matrix2d and get_shear_matrix3d (#3652) (631a082)
- Fix BgrToRgba calling wrong conversion function (#3677) (d5bb50c)
- fix xfeat dynamo (#3659) (6f03716)
- fix(onnx): fix io_name_conversion bug and update variadic type hints (#3644) (35f7816)
- fix: skip MPS-unsupported tests and fix MPS-specific runtime errors (#3649) (8501790)
- fix: correct logic bugs in augmentation and crop validation (#3605) (5fa1208)
- Fix typo in index.rst (out → our) (#3633) (f9535c9)
- fix: resolve two CI failures in coverage workflow (#3639) (bf56558)
- fix doctest warnings (#3632) (37ac967)
- fix: fix doctest failures for ALIKED and fft_conv (#3630) (4c9c0b6)
- Fix/rgba png loading (#3608) (9019330)
- fix: use StrEnum instead of string and enum (#3573) (d66489b)
- fix(siglip2): clamp logit_scale to avoid overflow (#3480) (f4ee06c)
- fix: correct Thin Plate Spline warp normalization for grid_sample (#3468) (3330795)
- Fix RandomThinPlateSpline same_on_batch behaviour and add unit tests (#3465) (f99683d)
- fix(augmentation): resolve device mismatch in RandomGaussianIllumination (#3457) (db0447b)
- Fix AugmentationSequential crash with mix-only augmentations (#3424) (745c6f1)
- Fix doctest failures and build-docs task (#3456) (bc7b3e3)
- fix: preserve align_corners from extra_args in inverse_masks (fixes #3400) (#3450) (e71e50c)
- fix doctests in ci (#3402) (dff89bd)
- fix(filters): validate positive sigma values in gaussian_blur2d (#3397) (d5e46fc)
- Fix smoke_inputs in morphology tests to include both tensor and kernel arguments (0441264)
- fix: resolve broadcasting error in affine transform for multi-channel masks (#3388) (8f4561c)
- fix(docs): replace deprecated torch.range with torch.arange (#3381) (de52fdf)
- fix(core): enable weights_only=False for TensorWrapper serialization (04b0723)
- Fix Bug #2876: normalize_min_max now supports 3D tensors (C, H, W) (#3352) (eae117b)
- Fix homography between unit square and scaled version (#3335) (8ca3e6b)
Performance
- perf(geometry): speed up depth_to_normals (~3×) and denormalize_points_with_intrinsics (~2×) (#3656) (78496b7)
- perf: vectorize xyz conversions (5.6x speedup) with safety checks (#3482) (f6339e0)
- optimize(color): use addcmul for rgb_to_grayscale speedup (#3474) (bf0f8a1)
- Perf: optimized unsharp by using lerp (#3418) (d4347d3)
- Optimize render_gaussian2d (~18x speedup) and fix PDF variance bug (#3366) (2b6d466)
Documentation
- Docs/contrib docstrings (#3715) (860747e)
- Docs/core docstrings (#3716) (f0c6553)
- docs: add missing docstrings to planar_tracker (D101, D102, D103) (#3709) (97ac706)
- docs: add missing docstrings to augmentation module (#3666) (c6c108f)
- docs: refine shapes and clarify logits in DiceLoss docstrings (39b4d79)
- docs: add structural docstrings to kornia.losses.dice (9f370b0)
- docs: fix canonical URL by setting html_baseurl to /en/latest/ (#3587) (#3589) (245f578)
- docs: add CLAUDE.md with dev environment and architecture guide (bcd6a38)
- docs: fix output shape comment in RawToRgb example (#3563) (e4bea59)
- docs: add interactive image equalization demo reference (#3509) (efc676a)
- docs: add missing docstrings for public classes (D101) (#3447) (32aec76)
- Docs: add module docstrings(D100) for sample and draw utilities (#3390) (15c8327)
- docs: add missing package docstrings (D104) (d76c2a5)
- Docs: fix remaining D401 docstring violations (#3385) (c78f19c)
- Docs: fix D401 imperative mood in adalam utils (#3384) (466040a)
- Docs: fix docstring imperative mood (D401) (2acccd1)
- docs: Fix RST formatting errors in augmentation.container (#3373) (e68c3f0)
- docs: remove deprecated slack link (188ff49)
- docs: update community invite link (78eddb1)
- Docs: clarified difference between ImageSequential and AugmentationSequential (#3369) (bd37294)
Tests
- tests: improve branch coverage and remove dead test stubs (#3651) (7bbae17)
- test : add missing exception and dynamo tests for FaceDetector (#3520) (af0be4f)
- test(image): migrate image to BaseTester (#3504) (6770ba5)
- tests(tracking): migrate tracking to BaseTester (#3505) (56bfd3d)
- tests(geometry): migrate geometry module to use BaseTester. (#3469) (a0d32de)
- tests(integration): migrate integration to BaseTester (#3431) (55d9665)
- tests(image): migrate test_image to BaseTester (#3407) (29f8261)
CI
- ci: allow tutorials to fail to unblock merges (#3591) (16401e1)
- ci: add path filters to skip CI on docs/non-code changes (#3445) (c90e3d7)
Refactor
- remove too-many-positional-arguments ignore from ty config (#3543) (c161d43)
- refactor(color): vectorize yuv with device-aware dispatch and safety … (#3514) (d27a9b7)
- Remove deprecated
reviewersfrom Dependabot config (#3493) (7049f29) - remove unused testing code (#3429) (b2705ae)
- Refactor kornia.models across repo (#3426) (0b78c77)
- remove old testing code (#3423) (ece6360)
- refactor(tests): Add parametrization to smoke, shape, and gradcheck tests (#3419) (c627572)
- refactor(tests/losses): Add @pytest.mark.grad() decorator and dtype parameter to test_gradcheck methods (#3414) (791c978)
- remove grad_estimator, nerf and x modules (#3401) (4d6ca7b)
- Refactor morphology tests using @parametrized_test decorator (c2cd3b4)
- Refactor: Move NeRF helper utilities to kornia.geometry.camera.utils (#3365) (30eec36)
Dependencies
- build(deps): bump urllib3 from 2.6.3 to 2.7.0 (#3719) (33cf66d)
- ⬆️ bump actions/github-script in the github-actions group (#3711) (d398fcf)
- build(deps): bump pytest from 9.0.2 to 9.0.3 (#3701) (3e49eff)
- build(deps): bump pillow from 12.1.1 to 12.2.0 (#3700) (d726543)
- build(deps-dev): update transformers requirement from <5.2 to <5.6 (#3695) (f3f6272)
- build(deps): bump cryptography from 46.0.5 to 46.0.7 (#3699) (7d699f1)
- ⬆️ bump the github-actions group with 4 updates (#3691) (7352ca3)
- build(deps): bump transformers from 4.56.2 to 5.0.0rc3 (#3697) (9c4c4d4)
- build(deps): bump onnx from 1.20.0 to 1.21.0 (#3692) (07d4816)
- build(deps): bump pillow from 12.0.0 to 12.1.1 (#3569) (0f8d197)
- build(deps): bump filelock from 3.20.1 to 3.20.3 (#3570) (1d0fd0a)
- build(deps): bump cryptography from 46.0.3 to 46.0.5 (#3571) (b63296a)
- build(deps-dev): update transformers requirement from <4.58 to <5.2 (#3561) (5179c95)
- build(deps): bump protobuf from 6.33.2 to 6.33.5 (#3546) (d64263c)
- build(deps): bump urllib3 from 2.6.2 to 2.6.3 (#3545) (6b36b77)
- build(deps): bump virtualenv from 20.35.4 to 20.36.1 (#3544) (bb2d17e)
- ⬆️ Bump prefix-dev/setup-pixi in the github-actions group (#3542) (fdeb503)
- ⬆️ Bump the github-actions group with 4 updates (#3507) (8fa47b2)
- ⬆️ bump actions/github-script from 7 to 8 (#3499) (c27ca0d)
- ⬆️ bump actions/cache from 4 to 5 (#3500) (258638e)
- ⬆️ bump actions/download-artifact from 4 to 7 (#3501) (d849854)
- ⬆️ bump codecov/codecov-action from 3.1.6 to 5.5.2 (#3502) (775ca1...
v0.8.2
What's Changed
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3109
- Migrate to discord by @cjpurackal in #3110
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3112
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3114
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3118
- remove: wrong logging debug setup by @johnnv1 in #3120
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3121
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3124
- docs: added docstring to the detach tensor to gpu by @VARUN3WARE in #3131
- docs: Updated documentation with SEO meta descriptions for modules by @VARUN3WARE in #3129
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3133
- chore(deps-dev): bump pytest from 8.3.4 to 8.3.5 by @dependabot[bot] in #3136
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3138
- Fix Sold2Detector link by @ducha-aiki in #3141
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3144
- Remove deprecation decorator from depth_to_3d function by @Incharajayaram in #3142
- Utils: support resize on MPS by @adamjstewart in #3145
- Fix dedode when calling detect() with padding correctly handled by @hit2sjtu in #3147
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3146
- Splitting the tests in test_augmentation_3d.py and test_container.py into individual test files. by @abdulrahman-riyad in #3143
- Avoid 2N x 2N weight matrix allocation in find_homography_dlt by @SimonLarsen in #3134
- fix: fixes IndexError in draw_line method by @cjpurackal in #3116
- ⚡️ Speed up function
point_line_distanceby 28% by @dasarchan in #3152 - ⚡️ Speed up function
val2listby 229% by @dasarchan in #3151 - fix kernel_size in dog_response by @Force1ess in #3137
- ⚡️ Speed up function
KORNIA_CHECK_IS_IMAGEby 92% by @misrasaurabh1 in #3156 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3158
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3163
- chore: skip dissolving tests by @johnnv1 in #3164
- Updated the Batch functionality for depth_to_3d_v2 function by @Shubham-Sahoo in #3162
- upgrade kornia-rs to 0.1.9 by @edgarriba in #3166
- bump version 0.8.1 by @edgarriba in #3167
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3165
- potential fix to #3104 issue by @soumya997 in #3149
- fix: Missed single pixel instance in upper left corner by
connected_components()by @Halyjo in #3168 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3170
- Fix/issue3161 fix parenthesis in transform by @stephen-mtz in #3171
- Fix dedode forward with description padding removed. by @hit2sjtu in #3153
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3172
- Adding Otsu thresholding for automatic image segmentation by @Neilstid in #3181
- fix onnx-sequential ir version by @johnnv1 in #3187
- drop support
torch<2.0.0by @johnnv1 in #3186 - fix ARKitQTVects_to_COLMAPQTVecs docstring by @mjfang in #3188
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3183
- Feat/ codeflash/optimize-torch_version-utils by @Meggison in #3196
- [Fix] fixed typing by @shijianjian in #3198
- fixing awkward phrasing in CONTRIBUTING.md by @Dhia-naouali in #3199
- Feat/codeflash-get_default_detector_config_new_batch by @Meggison in #3201
- Updating CONTRIBUTING.md with correct dev env setup by @Dhia-naouali in #3204
- Feat/codeflash-get-pooling-kernel-buffer by @Meggison in #3205
- Feat/codeflash-eye-numel-reconstruction-small-cases by @Meggison in #3206
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3192
- Feat/codeflash_grayscale_to_rgb by @Meggison in #3209
- Install Codeflash github action by @misrasaurabh1 in #3212
- Fix blocking operation in hsv_to_rgb by @astrobdr in #3221
- compeleted todo: optimized _distort_points_kannala_brandt by @sidd-27 in #3220
- Adaptive Discriminator Augmentation preset by @Dhia-naouali in #3197
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci[bot] in #3222
- Fix/jit/validate box by @shijianjian in #3202
- Feat/codeflash-subpixel_step-compute by @Meggison in #3215
- optimized bbox_to_mask3d by vectorizing loop by 5526.89% by @sidd-27 in #3223
- Implement color space conversion in Image and add tests by @sidd-27 in #3217
- optimized squared and Euclidian dist calculation by 130% by @sidd-27 in #3218
- optimized mod function by using inbuilt torch.remainder by 336% by @sidd-27 in #3224
- optimized line fit for 2d case by upto 2665.96% by using closed form solution by @sidd-27 in #3219
- optimized otsu threshold forward by 308.5x (30850% speedup) by @sidd-27 in #3237
- Line sampling opt 200% - 2000% depending on input size by @sidd-27 in #3230
- Speed up function
normalize_min_maxby 64% by @Meggison in #3246 - Speed up function
compose_transformationsby 24% by @Meggison in #3247 - Speed up function relative_transformation by 33% by @Meggison in #3236
- optimized normalize() with inbuilt function to get 55.3% speedup by @sidd-27 in #3228
- optimized needleman_wunsch by 1772.46% by @sidd-27 in #3231
- optimized img_to_str by about 3.5x (350%) by @sidd-27 in #3241
- optimized strip_hash with 1.96x (196%) speedup by @sidd-27 in #3242
- Speed up function
val2tupleby 148% by @Meggison in #3233 - fixed docstring issue by @sidd-27 in #3238
- optimized save_pointcloud_ply by 16.84x (1684%) by @sidd-27 in #3244
- optimized find_next_powerof_two by 3.71x (371% speedup) by @sidd-27 in #3250
- optimized random_intrinsics by 36.74% by @sidd-27 in #3252
- optimized image_list_to_tensor by 2.92x (292% speedup) by @sidd-27 in #3245
- speedup euclidean_distance() by 150% with more efficient tensor ops by @sidd-27 in #3234
- optimized so3 exp by 28.41% (1.39x) by @sidd-27 in #3254
- optimized to_pil by 2.71x (63.17% improvement) by @sidd-27 in #3255
- optimized get_grid by 23% by @sidd-27 in #3256
- optimized make_grid by 2.82x by @sidd-27 in #3257
- Opti kb undistort by 2.69x by @sidd-27 in #3253
- optimized nms_bbox 4.83x (483.5% speedup) by @sidd-27 in #3251
- optimized create_dedode_default by 28.30x (2830% speedup) by @sidd-27 in #3260
- optimized batch_2x2_ellipse by about 3-6x by @sidd-27 in #3261
- optimized to_box by 6.33x (630%) by adding a gpu friendly path by @sidd-27 in #3262
- Add missing docstrings to geometry module (quaternion, ransac) by @Ruddellj in #3240
- optimized build_attention_bias by 6.37x (637%) ...
v0.8.1
What's Changed
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3109
- Migrate to discord by @cjpurackal in #3110
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3112
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3114
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3118
- remove: wrong logging debug setup by @johnnv1 in #3120
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3121
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3124
- docs: added docstring to the detach tensor to gpu by @VARUN3WARE in #3131
- docs: Updated documentation with SEO meta descriptions for modules by @VARUN3WARE in #3129
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3133
- chore(deps-dev): bump pytest from 8.3.4 to 8.3.5 by @dependabot in #3136
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3138
- Fix Sold2Detector link by @ducha-aiki in #3141
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3144
- Remove deprecation decorator from depth_to_3d function by @Incharajayaram in #3142
- Utils: support resize on MPS by @adamjstewart in #3145
- Fix dedode when calling detect() with padding correctly handled by @hit2sjtu in #3147
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3146
- Splitting the tests in test_augmentation_3d.py and test_container.py into individual test files. by @abdulrahman-riyad in #3143
- Avoid 2N x 2N weight matrix allocation in find_homography_dlt by @SimonLarsen in #3134
- fix: fixes IndexError in draw_line method by @cjpurackal in #3116
- ⚡️ Speed up function
point_line_distanceby 28% by @dasarchan in #3152 - ⚡️ Speed up function
val2listby 229% by @dasarchan in #3151 - fix kernel_size in dog_response by @Force1ess in #3137
- ⚡️ Speed up function
KORNIA_CHECK_IS_IMAGEby 92% by @misrasaurabh1 in #3156 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3158
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3163
- chore: skip dissolving tests by @johnnv1 in #3164
- Updated the Batch functionality for depth_to_3d_v2 function by @Shubham-Sahoo in #3162
- upgrade kornia-rs to 0.1.9 by @edgarriba in #3166
New Contributors
- @VARUN3WARE made their first contribution in #3131
- @Incharajayaram made their first contribution in #3142
- @abdulrahman-riyad made their first contribution in #3143
- @SimonLarsen made their first contribution in #3134
- @dasarchan made their first contribution in #3152
- @Force1ess made their first contribution in #3137
- @misrasaurabh1 made their first contribution in #3156
- @Shubham-Sahoo made their first contribution in #3162
Full Changelog: v0.8.0...v0.8.1
v0.8.0
What's Changed
- Nick/ruff bugbear by @ntjohnson1 in #3076
- chore (pre-commit): update hooks by @johnnv1 in #3080
- chore (docstrings): addopt ruff over docformatter by @johnnv1 in #3082
- Don't detach tensors to cpu by @ashnair1 in #3084
- chore(deps-dev): bump pytest from 8.3.3 to 8.3.4 by @dependabot in #3087
- chore (coverage): adjust to the new threshold by @johnnv1 in #3086
- Add padding_mode to the thin_plate_spline by @okdalto in #3079
- chore (ci): tests on torch
2.5.1by @johnnv1 in #3070 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3089
- chore (docs): enable some Ruff rules for Docstring by @ntjohnson1 in #3088
- Fix LightGlue normalize_keypoints with torch.Size input by @Dawars in #3075
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3093
- chore(deps-dev): update numpy requirement from <2 to <3 by @dependabot in #3092
- Ruff Docstring Rule D417: Fix missing arguments by @ntjohnson1 in #3091
- Nick/ruff d103 by @ntjohnson1 in #3096
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3100
- Fix RandomRain crash when no images in the batch are augmented (#3097) by @plamen-alcatraz in #3103
- chore (pre-commit): hook to add license header by @johnnv1 in #3094
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3106
New Contributors
- @ntjohnson1 made their first contribution in #3076
- @okdalto made their first contribution in #3079
- @Dawars made their first contribution in #3075
- @plamen-alcatraz made their first contribution in #3103
Full Changelog: v0.7.4...v0.8.0
v0.7.4
What's Changed
- fix (CI): ensure support test suite w/ numpy by @johnnv1 in #2932
- release 0.7.3 by @edgarriba in #2938
- bump version 0.7.4-dev by @edgarriba in #2939
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2943
- Fix Shape Typo by @ChristophReich1996 in #2951
- Use named args in update_attribute by @ashnair1 in #2946
- chore: ensure onnx kornia check, check shape and check same shape by @johnnv1 in #2953
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2949
- Add a "Contributing to Documentation" section to contribution g… by @lappemic in #2959
- Updating docs to include interactive demos by @lappemic in #2958
- fix: E721 by @johnnv1 in #2966
- Include Steerers by @georg-bn in #2940
- chore: ensure onnx for face detector model by @johnnv1 in #2952
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2965
- Ignore invalid keys instead of raising an error by @ashnair1 in #2971
- Replace deprecated torch.cuda.amp decorators for torch 2.4 by @loichuder in #2967
- Update hf spaces in docs by @lappemic in #2964
- Update numpy requirement from <2 to <3 by @dependabot in #2976
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2977
- [Feat] init kornia module by @shijianjian in #2963
- Bump pytest from 8.2.2 to 8.3.2 by @dependabot in #2968
- Index fix for aug dicts by @ashnair1 in #2979
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2980
- fix (CI): docs build and test by @johnnv1 in #2982
- fix: dedode w steerer matching doc test by @johnnv1 in #2983
- chore (CI): ensure support to torch 2.4 by @johnnv1 in #2972
- feat (CI): cache model weights by @johnnv1 in #2984
- Add feature benchmark numbers to doc by @ducha-aiki in #2991
- is_autocast_enabled: fix deprecation warning by @adamjstewart in #2981
- [Feat] Added dissolving transformation & updated docs by @shijianjian in #2961
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2990
- fix: Wrong Type Hints in
augmentation.Normalize(#3003) by @fang-d in #3004 - Inplace draw convex polygon by @Isalia20 in #3000
- compute area for all types of boxes by @Isalia20 in #2996
- onnx export device mismatch fix by @Isalia20 in #2999
- Quaternion conversions by @tjelinek in #2993
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3010
- RTDETR update by @shijianjian in #3012
- chore (dep-dev): pin numpy to <2 by @johnnv1 in #3017
- docs: precise yuv flavor in docstrings by @egidioln in #3016
- Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows by @dependabot in #3011
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3018
- chore(deps-dev): bump pytest from 8.3.2 to 8.3.3 by @dependabot in #3021
- Fix early stop in lightglue by @zerolover in #3024
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3023
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3029
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #3031
- Add explicit dev dependency on setuptools by @falckt in #3036
- Fix weighted dice loss by @falckt in #3033
- Add ignore_index to dice, focal and tversky loss by @falckt in #3034
- Fix type mis-match between out and patches during mixed-precision training by @hit2sjtu in #3007
- Update pyproject.toml by @mdvthu in #3039
- Adds depth from plane equation by @ducha-aiki in #3040
- Chore shape checks by @ducha-aiki in #3041
- fix mypy complaints by @ducha-aiki in #3042
- add weighted PnP by @ducha-aiki in #3027
- Adds function to convert surface normals to RGB image by @ducha-aiki in #3043
- Fix off-by-one pixel denormalization bug in DeDoDe by @georg-bn in #2941
- Fix registrator code typo in index.rst by @mhmdjouni in #3044
- Init Kornia.onnx module by @shijianjian in #3013
- fix: import the module within LazyLoader when an accessed dependency is installed by @Sam-Armstrong in #3046
- Add Multi-Framework Support to Kornia using Ivy by @Sam-Armstrong in #3045
- fix github ci by @edgarriba in #3048
- add ivy to docs requirements by @edgarriba in #3049
- Fix precommit by disabling pyproject-fmt by @edgarriba in #3050
- Fix typing from #3051 by @edgarriba in #3052
- Fix grammatical errors in documentation by @rahuldave2005 in #3057
- chore (pyproject): format the pyproject toml by @johnnv1 in #3059
- Drop support to python 3.8 by @johnnv1 in #3058
- Added RandomRot90 by @shijianjian in #2994
- chore (docs): replace transpiler example to code blocks by @johnnv1 in #3061
- Fix jit related tests by @johnnv1 in #3063
- bump version 0.7.4 by @edgarriba in #3065
New Contributors
- @loichuder made their first contribution in #2967
- @fang-d made their first contribution in #3004
- @tjelinek made their first contribution in #2993
- @egidioln made their first contribution in #3016
- @zerolover made their first contribution in #3024
- @falckt made their first contribution in #3036
- @hit2sjtu made their first contribution in #3007
- @mdvthu made their first contribution in #3039
- @mhmdjouni made their first contribution in #3044
- @Sam-Armstrong made their first contribution in #3046
- @rahuldave2005 made their first contribution in #3057
Full Changelog: v0.7.3...v0.7.4
v0.7.3
What's Changed
- Pre commit update hooks by @johnnv1 in #2844
- fix: typing ignore for
dedode.tranformerby @johnnv1 in #2849 - Fix datakey retreival for BBOX_XYWH and BBOX_XYXY by @ashnair1 in #2846
- Fix: DeDoDe tests coverage by @johnnv1 in #2850
- fix: dedode pretained type ignore dedode init by @johnnv1 in #2858
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2857
- added kornia's euclidian_distance function in kmeans algorithm by @smruthi-sumanth in #2861
- gaussian illumination device improvements by @edgarriba in #2860
- feat: 2d augmentation benchmarks by @johnnv1 in #2853
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2864
- Support instance masks (N,H,W) by @ashnair1 in #2856
- color jitter compile and set right device / dtype by @edgarriba in #2863
- [Fix] Transformation Matrix Mis-calculation for autoaugmentations by @shijianjian in #2852
- [Fix] Add Support for Images not Div by 16 (Diff. JPEG) by @ChristophReich1996 in #2865
- support compile for random gaussian blur by @edgarriba in #2866
- Feat: random channel dropout by @vgilabert94 in #2859
- fix [aug]: gaussian blur compile and compile tests skips by @johnnv1 in #2872
- Fixes the use of the gtag extension by @johnnv1 in #2871
- remove unused dependencies by @johnnv1 in #2870
- Delete manual
robots.txtfrom docs by @johnnv1 in #2869 - fix: skip dynamo test for visual prompter by @johnnv1 in #2874
- DataKey: add 'label' as alias of 'class' by @ashnair1 in #2873
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2878
- Add torch.compile to RandomGaussianIllumination by @vgilabert94 in #2868
- adds weight parameter to dice and lovasz_softmax losses by @ducha-aiki in #2879
- Vectorize lovasz_softmax loss by @ducha-aiki in #2884
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2885
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2889
- bump: workflows to 1.8.1 and torch to 2.2.2 by @johnnv1 in #2888
- dedode v2 weights by @Parskatt in #2887
- Automatic updates of copyright year in lib by @chirizxc in #2890
- Fix: rasanc max_samples_by_conf to not return negative by @vicsyl in #2897
- Change sold2 detector config to dataclass by @lappemic in #2880
- chore: remove repetitive words by @peicuiping in #2902
- CI: Drop macos-latest runner for torch 1.9.1 by @johnnv1 in #2905
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2894
- feat: in_range filtering by @vgilabert94 in #2895
- Unify sold2 config dataclasses by @lappemic in #2899
- Refactor SOLD2 and WunschLineMatcher Dict Config to Dataclasses by @lappemic in #2901
- compute_area fix for ndim=3 tensors by @Isalia20 in #2915
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2916
- chore (CI): ensure support to pytorch 2.3.0 by @johnnv1 in #2912
- Bump pytest from 8.1.1 to 8.2.1 by @dependabot in #2917
- Speed up differentiable 5PC and fix the batch size issue by @weitong8591 in #2914
- feat: support batched and float data in apply colormap by @vgilabert94 in #2886
- Bump pytest from 8.2.1 to 8.2.2 by @dependabot in #2925
- Bugfix: LoFTR was ignoring mask input by @Yosshi999 in #2923
- new E decomposition without svd by @weitong8591 in #2920
- chore (CI): bump pytorch to 2.3.1 by @johnnv1 in #2922
- Fix empty descriptor by @ducha-aiki in #2927
- chore (test suite): skip or xfail random failures by @johnnv1 in #2930
- chore (CI): ensure support to py312 by @johnnv1 in #2929
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2919
- Add pre and post processing steps to allow non float dtypes by @ashnair1 in #2882
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2933
- chore (dev deps): pin numpy to lower than 2.0 by @johnnv1 in #2937
- chore: typos fixes for codespell by @johnnv1 in #2936
New Contributors
- @smruthi-sumanth made their first contribution in #2861
- @chirizxc made their first contribution in #2890
- @peicuiping made their first contribution in #2902
- @Isalia20 made their first contribution in #2915
- @Yosshi999 made their first contribution in #2923
Full Changelog: v0.7.2...v0.7.3
v0.7.2
What's Changed
- rename missing main by @edgarriba in #2723
- Bump pytest from 7.4.3 to 7.4.4 by @dependabot in #2712
- Replace docs source link from
viewcodeto github by @johnnv1 in #2727 - Bump readthedocs python version by @johnnv1 in #2729
- Bump accelerate from 0.25.0 to 0.26.1 by @dependabot in #2730
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2734
- Fixes
extract_tensor_patchesto work with partial patches cases by @johnnv1 in #2735 - [SAM] document the image (tensor) should be scaled between [0,1] by @scott-vsi in #2738
- add ProjectionZ1, Orthographic, Affine, KannalaBrandt by @edgarriba in #2728
- bump torch
2.1.2by @johnnv1 in #2742 - remove retrigger CI on PR's when labeled by @johnnv1 in #2744
- rename directory:
test->testsby @johnnv1 in #2743 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2747
- Depreciates
kornia.testingby @johnnv1 in #2745 - Add salt and pepper noise with docs and tests by @vgilabert94 in #2746
- alphabetical order augmentations docs and add salt pepper by @edgarriba in #2757
- Added DogHardNet LightGlue by @ducha-aiki in #2758
- fix F841 by @johnnv1 in #2759
- feat: differentiable jpeg by @johnnv1 in #2760
- [CI] split coverage into multiple jobs by @johnnv1 in #2756
- Ci: fix old torch install by @johnnv1 in #2763
- RandomSaltAndPepperNoise: Update algorithm to use indexing by @vgilabert94 in #2762
- add dedode descriptor B weights for lightglue by @ducha-aiki in #2769
- skip unsupported tests cases for torch==1.9.1 by @johnnv1 in #2770
- remove typing report by @johnnv1 in #2765
- Bump pytest from 7.4.4 to 8.0.0 by @dependabot in #2766
- Ensure support to
torch==2.2.0by @johnnv1 in #2772 - Resize compile by @edgarriba in #2774
- [FIX] ColorJiggle works on non-3-channel images by @shijianjian in #2767
- Introduces
benchmarks/by @johnnv1 in #2777 - Add [*, 3, H, W] support to Diff. JPEG by @ChristophReich1996 in #2776
- [test suite] add slow marker vit by @johnnv1 in #2779
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2783
- Fix
ruff 0.2.1config by @johnnv1 in #2784 - force solve with torch.float64 by @edgarriba in #2785
- Fix robots for web crawlers by @edgarriba in #2790
- Remove device from get_planckian_coeffs and register self.pl as a buffer by @Modexus in #2792
- ViT: Load Jax augreg weights by @gau-nernst in #2786
- docs: add not-found option by @johnnv1 in #2796
- Feat: Support list of masks in
AugmentationSequentialby @johnnv1 in #2740 - test suite: skip fp64 canny dynamo test by @johnnv1 in #2797
- Test suite: separate losses tests into individual files by @fleventy-5 in #2801
- Test suite: separate contrib tests into individual files by @fleventy-5 in #2802
- Test suite: separate metrics tests into individual files by @fleventy-5 in #2805
- Feat: add Gradient Illumination augmentations (gaussian) by @vgilabert94 in #2780
- add missing docs for RandomGaussianIllumination by @edgarriba in #2806
- feat: Add RandomJPEG Augmentation by @ChristophReich1996 in #2803
- Update augmentation.module.rst by @edgarriba in #2808
- Add: differentiable clipping, floor and rounding functions by @jeffin07 in #2795
- [feat] KMeans implementation by @avinashselvam in #2804
- Bump pytest from 8.0.0 to 8.0.1 by @dependabot in #2810
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2811
- Aug: Add simple support to dict for AugSequential by @johnnv1 in #2799
- Bump pytest from 8.0.1 to 8.0.2 by @dependabot in #2815
- Fix: Typo auto rand augment by @harsh1504660 in #2817
- Fix Typo: Corrected SUBPLOLICY_CONFIG to SUBPOLICY_CONFIG by @harsh1504660 in #2819
- remove image prompter in favor of visual prompter by @johnnv1 in #2814
- Upgrade model checkpointing by @machineko in #2820
- Update torch.inverse to torch.linalg.inv by @wangshuai09 in #2824
- Refactor and add more palettes of colormaps by @vgilabert94 in #2794
- feat: RandomLinearIllumination and RandomLinearCornerIllumination by @vgilabert94 in #2823
- fix (docs): add
RandomLinearIlluminationand `RandomLinearCornerIll… by @johnnv1 in #2827 - ColorMap tests coverage by @johnnv1 in #2825
- Bump pytest from 8.0.2 to 8.1.1 by @dependabot in #2829
- feat: augmentation sequential supports mask (B, H, W) with images (B, C, H, W) by @johnnv1 in #2800
- fix(docs): remove Jina AI QAbot from Kornia documentation by @nan-wang in #2831
- update kornia_rs and make sure contiguous data by @edgarriba in #2828
- CI: ensure pytorch 2.2.1 support by @johnnv1 in #2833
- fix visual prompter test in dynamo by @edgarriba in #2834
- Fix of possible CPU and GPU device error by @Fleyderer in #2838
- Add DeDoDe (clean version) by @ducha-aiki in #2835
- bump version 0.7.2 by @edgarriba in #2832
New Contributors
- @scott-vsi made their first contribution in #2738
- @vgilabert94 made their first contribution in #2746
- @Modexus made their first contribution in #2792
- @fleventy-5 made their first contribution in #2801
- @avinashselvam made their first contribution in #2804
- @harsh1504660 made their first contribution in #2817
- @machineko made their first contribution in #2820
- @wangshuai09 made their first contribution in #2824
- @nan-wang made their first contribution in #2831
- @Fleyderer made their first contribution in #2838
Full Changelog: https://github.com/kornia/kornia/commits/v0.7.2
v0.7.1
What's Changed
- Lie groups docs update by @cjpurackal in #2495
- Fixed RandomJigsaw #2494 by @shijianjian in #2504
- Fixed video batching bug #2410 #2497 by @shijianjian in #2502
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2508
- LG-test by @ducha-aiki in #2510
- Fix docs build -
sphinx==7.0.1by @johnnv1 in #2518 - [feat] add right and left jacobian for So3 by @cjpurackal in #2509
- Fix: update random_rain.py by @f-amerehi in #2514
- Fix docs: Unpin sphinx by @johnnv1 in #2527
- Fix tutorials links to use the github page by @johnnv1 in #2529
- Bump accelerate from 0.21.0 to 0.22.0 by @dependabot in #2530
- Update precommit hooks by @johnnv1 in #2521
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2528
- Added kornia resize in object detection by @jeffin07 in #2526
- [feat] Add transplantation augmentation by @JanSellner in #2523
- Use
grid_samplefrom F without importing it. by @antoinebrl in #2532 - Clarify documentation to get shear matrices by @priba in #2533
- Bump pytest from 7.4.0 to 7.4.1 by @dependabot in #2537
- Add support for class data keys in AugmentationSequential by @miquelmarti in #2536
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2538
- fix readme badges by @johnnv1 in #2539
- Bump pytest from 7.4.1 to 7.4.2 by @dependabot in #2542
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2543
- Bump accelerate from 0.22.0 to 0.23.0 by @dependabot in #2547
- [feature] rt-detr onnx by @edgarriba in #2548
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2550
- Make transforms Spawn Multiprocessing Context Friendly by @NielsPichon in #2499
- Fix TestEqualization by @johnnv1 in #2553
- add coverage CI by @johnnv1 in #2551
- fixes zero division in depth_from_disparity by @edgarriba in #2556
- Fix improper
importlib.utilimport by @Avasam in #2558 - Depth to 3d improvements by @edgarriba in #2557
- fix object detection onnx by @edgarriba in #2555
- reduce repository size (history rewriting) by @johnnv1 in #2561
- fix typing by @edgarriba in #2563
- Add missing tests (losses, io, connected components) by @johnnv1 in #2565
- allow warp_affine fill num_channels other than three by @edgarriba in #2568
- Fix depth to 3d docs by @edgarriba in #2569
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2570
- Update augmentation.rst by @Otteri in #2584
- fix bucket off-by-one-error by @Seanny123 in #2582
- update version to dev by @johnnv1 in #2586
- drop
torchvisionfrom docs deps by @johnnv1 in #2591 - Adds 7pt solver to RANSAC by @ducha-aiki in #2595
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2596
- [feat] Add Average Endpoint Error to Metrics by @ChristophReich1996 in #2500
- Add
torch.jit.scriptsupport forwarp_affineby @balbok0 in #2588 - Update readthedocs.yml by @edgarriba in #2598
- [speed up CI tests suite] Skip slow tests as default by @johnnv1 in #2587
- Fix of multi head attention implementation by @yarkoslav in #2589
- fix doctest by @edgarriba in #2604
- drop
cv2as dev dependency by @johnnv1 in #2593 - Optimize the connected components labeling algorithm by @SonyPony in #2609
- xpass rasanc randomness tests by @johnnv1 in #2613
- #2348 Fix bug in ycbcr_to_rgb function by @juliaaz in #2610
- bump pytorch version to 2.1.0 by @johnnv1 in #2605
- add deps info to tests header by @johnnv1 in #2585
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2616
- xfail TestRandAugment::test_transform_mat based in torch version by @johnnv1 in #2617
- Ensure python 3.11 support by @johnnv1 in #2606
- Fix incorrect computation of affine shear matrix around center point by @Vihtoriaaa in #2608
- Add alias 'average_endpoint_error' for aepe method by @be-unkind in #2615
- skip dynamo test for py311 torch 2.0.x by @johnnv1 in #2621
- expose
average_endpoint_errormetric by @johnnv1 in #2620 - replace deprecated prompter test and fix skiping dynamo test by @johnnv1 in #2623
- Update docs CI by @johnnv1 in #2624
- Add differentiable 5PC (five point algorithm) for essential matrix estimation by @weitong8591 in #2580
- add RandomClahe by @michael-2956 in #2614
- [feat] Add NamedPose by @cjpurackal in #2482
- Fix visual prompter bug (#2627) by @kaftanski in #2630
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2632
- [feat] Raw to rgb conversion with downscaling by @bogdanmagometa in #2629
- feat: LightGlue-ONNX by @fabio-sim in #2631
- Drop
scipyfrom dev dependencies by @johnnv1 in #2634 - fix: docs: OnnxLightGlue by @fabio-sim in #2635
- Bump pytest from 7.4.2 to 7.4.3 by @dependabot in #2641
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2644
- Bump accelerate from 0.23.0 to 0.24.1 by @dependabot in #2645
- Make use of composition for augmentation multiprocessing friendliness by @johnnv1 in #2637
- Rename variables shadowing build-in input function by @alorthius in #2628
- addopt ruff formatter by @johnnv1 in #2638
- add deprecated decorator
depth_to_3dby @johnnv1 in #2636 - Add EfficientViT model by @edgarriba in #2607
- feat: CPU support for OnnxLightGlue by @fabio-sim in #2643
- Typo fix in
focal.pyby @omerferhatt in #2654 - [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2653
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2660
- Doc Fix: lafs2 shape in matchers by @maxc303 in #2663
- skip TestEfficientViT::test_smoke_large for torch lower than 2.0.0 by @edgarriba in #2664
- fix unused type ignore by @johnnv1 in #2666
- Bump pytorch to 2.1.1 by @johnnv1 in #2667
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2669
- Allow CombineTensorPatches to work with overlapping patches by @ashnair1 in #2650
kornia.nerfimprovements by @edgarriba in #2661- improve nerf docs by @edgarriba in #2673
- refactor kornia geometry to use kornia core rather than torch. Part 1… by @Tchaikovic in #2676
- move onnxruntime to
xrequirements by @johnnv1 in #2670 - Multiplication with
torch.onesnot needed for kernel_values by @kunaltyagi in #2678 - Bump accelerate from 0.24.1 to 0.25.0 by @dependabot in #2677
- [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in #2679
- fi...
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.
>>> # from a torch.tensor
>>> data = torch.randint(0, 255, (3, 4, 5), dtype=torch.uint8) # CxHxW
>>> pixel_format = PixelFormat(
... color_space=ColorSpace.RGB,
... bit_depth=8,
... )
>>> layout = ImageLayout(
... image_size=ImageSize(4, 5),
... channels=3,
... channels_order=ChannelsOrder.CHANNELS_FIRST,
... )
>>> img = Image(data, pixel_format, layout)
>>> assert img.channels == 3Object 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.
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.rt_detr import RTDETR, DETRPostProcessor, RTDETRConfig
from kornia.contrib.object_detection import ObjectDetector, ResizePreProcessor
model_type = "hgnetv2_x" # also available: resnet18d, resnet34d, resnet50d, resnet101d, hgnetv2_l
checkpoint = f"https://github.com/kornia/kornia/releases/download/v0.7.0/rtdetr_{model_type}.ckpt"
config = RTDETRConfig(model_type, 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
img_pt = torch.from_numpy(img).permute(2, 0, 1)
detection = detector.predict([img_pt])
for cls_score_xywh in detection[0].numpy():
class_id = int(cls_score_xywh[0])
score = cls_score_xywh[1]
x, y, w, h = cls_score_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()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:
# 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:
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: #2469

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
>>> # 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.KANNALA_BRANDT_K3, 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:
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.
>>> kornia.utils.print_image("panda.jpg")What's Changed
- fix skipped tests for cuda
TestColorJiggleGenby @johnnv1 in #2341 - remove inplace operation by @Parskatt in #2346
- Replace bandit, flake8, isort, pyupgrade, and yesqa with ruff by @cclauss in #2292
- fix unused import on
geometry.conversionsby @johnnv1 in #2357 - [pre-commit.ci] pre-commit suggestions by @pre...

