Kornia 0.9.0 ships a conventions page targeting LLM coding pitfalls
kornia_foss · x · 2026-10-24
Kornia 0.9.0 adds a "Conventions & Pitfalls" doc page, stating that nearly every subtle Kornia bug is a convention mismatch rather than a math error — and that both humans and LLM agents should read it before generating code.
Key conventions covered:
- Image tensors: 4D float (B, C, H, W), RGB order, values in [0, 1]; no implicit .cuda()/.float() or rescaling; NumPy HWC conversion via kornia.image.imagetotensor() (utils version deprecated).
- File I/O: loadimage() fixes channels, dtype, and range per ImageLoadType (uint8 [0,255] or float32 [0,1]), with defined behavior for palette PNGs, alpha compositing, and EXIF orientation.
- Coordinates vs. sizes: points are (x, y) with top-left origin, while dsize-style size args are (h, w) — the opposite order, a classic trap; normalized coords are [-1, 1].
- Angles: degrees in 2D image APIs, radians in 3D rotation APIs; positive 2D angles rotate counter-clockwise as displayed.
The conventions are also embedded in docstrings so agents can pick them up directly.
More from coding & agent
- Andrew Ng: Prompting dies in 6 months as loop-and-graph agent harnesses take over — msharmas · 2026-10-24
- Ramjet beats nginx by up to 61% more agent turns for open-source domyn swarm — DoggoProfessor959 · 2026-10-24
- Lightweight Formal Methods Could Save Vibe Coding: A 2016 OSDI Paper Gets a Second Life — tianyin_xu · 2026-10-24
- Packaging a local MCP server as a one-click Claude Desktop extension: lessons learned — sarghayk · 2026-10-24
- Cloning Your Boss: Distilling a Year of Slack Into an AI Persona File — every · 2026-10-24
- Replit Agent clones iOS Stocks app that runs natively-smooth on the web — amasad · 2026-10-24