🐍 Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
docs: match the homepage look and add Try in browser buttons
Jian Shi8676fc6a1a3d
diff --git a/docs/source/_static/css/blueprint.css b/docs/source/_static/css/blueprint.cssindex 3c2cf82c3..e0594ae7c 100644--- a/docs/source/_static/css/blueprint.css+++ b/docs/source/_static/css/blueprint.css@@ -75,10 +75,211 @@ kbd {border-radius: 3px;}-/* keep the amber accent legible as a button colour (dark ink on amber) */+/* buttons: match the homepage .btn-primary / .btn-secondary -- both solid, 3px, medium weight.+ Primary is solid amber with dark ink; secondary is a solid panel with a hairline border (not an+ outline/ghost button, which is what the theme ships). */+.bd-content .sd-btn,+.bd-content a.sd-btn {+ border-radius: 3px;+ font-weight: 500;+ padding: 0.5rem 1.15rem;+}++.bd-content .sd-btn-primary,.bd-content a.sd-btn-primary,-.bd-content .sd-btn-primary {+.bd-content .sd-btn-outline-primary,+.bd-content a.sd-btn-outline-primary {+ background-color: var(--pst-color-accent) !important;+ border-color: var(--pst-color-accent) !important;+ color: #0b1a2b !important;+}++.bd-content .sd-btn-primary:hover,+.bd-content a.sd-btn-primary:hover,+.bd-content .sd-btn-outline-primary:hover,+.bd-content a.sd-btn-outline-primary:hover {+ filter: brightness(1.06);+ background-color: var(--pst-color-accent) !important;+ border-color: var(--pst-color-accent) !important;+ color: #0b1a2b !important;+}++.bd-content .sd-btn-secondary,+.bd-content a.sd-btn-secondary,+.bd-content .sd-btn-outline-secondary,+.bd-content a.sd-btn-outline-secondary {+ background-color: var(--pst-color-on-background) !important;+ border: 1px solid var(--pst-color-border) !important;+ color: var(--pst-color-text-muted) !important;+}++.bd-content .sd-btn-secondary:hover,+.bd-content a.sd-btn-secondary:hover,+.bd-content .sd-btn-outline-secondary:hover,+.bd-content a.sd-btn-outline-secondary:hover {+ background-color: var(--pst-color-surface) !important;+ border-color: var(--pst-color-border) !important;+ color: var(--pst-color-text-base) !important;+}+++/* sponsorship band: a solid panel with the amber Open Collective button, matching the homepage's+ intro-band (solid --card-bg surface, centred copy, primary button + a text link). */+/* band colours, matching the homepage's card-bg / surface (alternating solid fills) */+html,+html[data-theme="light"] {+ --kornia-band-a: #ffffff;+ --kornia-band-b: #e6edf4;+}+html[data-theme="dark"] {+ --kornia-band-a: #0e1f33;+ --kornia-band-b: #10233a;+}++/* full-bleed bands: break out of the centred article column to span the viewport, then re-pad the+ content back to a ~1200px column -- the homepage's full-width solid sections. */+.kornia-sponsor-band,+#features {+ box-sizing: border-box;+ width: 100vw;+ margin-left: calc(50% - 50vw);+ margin-right: calc(50% - 50vw);+ padding-left: max(1.5rem, calc(50vw - 600px));+ padding-right: max(1.5rem, calc(50vw - 600px));+}++.kornia-sponsor-band {+ margin-top: 3rem;+ padding-top: 3rem;+ padding-bottom: 3rem;+ background-color: var(--kornia-band-a);+ text-align: center;+}++/* the Features section becomes the next solid band; override the inline hairline-separator rule */+#features {+ margin-top: 0 !important;+ padding-top: 3rem !important;+ padding-bottom: 3.5rem !important;+ background-color: var(--kornia-band-b);+ border-top: 0 !important;+}++.kornia-sponsor-band__lead {+ max-width: 760px;+ margin: 0 auto 1.5rem;+ font-size: clamp(1.1rem, 1.6vw, 1.35rem);+ line-height: 1.5;+ font-weight: 500;+ color: var(--pst-color-text-base);+}++.kornia-sponsor-band__actions {+ display: flex;+ flex-wrap: wrap;+ gap: 0.9rem;+ align-items: center;+ justify-content: center;+}++.kornia-btn {+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ padding: 0.6rem 1.3rem;+ border-radius: 3px;+ font-weight: 500;+ text-decoration: none;+ border: 1px solid transparent;+}++.kornia-btn--primary {background-color: var(--pst-color-accent);- border-color: var(--pst-color-accent);color: #0b1a2b;}++.kornia-btn--primary:hover {+ filter: brightness(1.06);+ color: #0b1a2b;+ text-decoration: none;+}++.kornia-sponsor-band__link {+ color: var(--pst-color-link);+ font-weight: 500;+ text-decoration: none;+}++.kornia-sponsor-band__link:hover {+ text-decoration: underline;+}+++/* navbar: use the page background like the homepage header (paper light / navy dark), not the+ theme's raised white bar. A hairline bottom border keeps it separated from the content. */+.bd-header,+.bd-header.navbar {+ background-color: var(--pst-color-background) !important;+ box-shadow: none !important;+ border-bottom: 1px solid var(--pst-color-border-muted);+}++.bd-header .bd-header__inner {+ background-color: transparent !important;+ border-bottom: 0 !important;+ box-shadow: none !important;+}++/* nav typography like the homepage: mono, uppercase (no leading numbers) */+.bd-header .bd-navbar-elements.navbar-nav > .nav-item > a,+.bd-header .bd-navbar-elements.navbar-nav > .nav-item > button {+ font-family: var(--pst-font-family-monospace);+ font-size: 0.76rem;+ font-weight: 500;+ letter-spacing: 0.07em;+ text-transform: uppercase;+}++/* a little breathing room between the logo and the search box */+.bd-header .navbar-header-items__start .search-button-field {+ margin-left: 1.25rem;+}++/* sharper corners, matching the homepage's 3px Blueprint radii (the theme over-rounds these) */+.search-button-field,+.search-button__default-text,+.bd-search input,+input.form-control,+.form-control,+kbd,+.bd-content code.literal,+.bd-content .docutils.literal,+.sd-tab-set > label.sd-tab-label,+.sd-tab-set > input:checked + label.sd-tab-label,+.bd-content div.highlight,+.bd-content pre,+.bd-content .admonition,+.bd-content .sd-card {+ border-radius: 3px !important;+}++/* the landing "Why Kornia?" tabs ship as 999px pills; the homepage uses sharp ~2px, so square them */+.bd-content .kornia-hero-demo .sd-tab-set > label,+.bd-content .kornia-hero-demo .sd-tab-set > input:checked + label,+.bd-content .kornia-hero-demo .sd-tab-set > input:focus-visible + label,+.bd-content .kornia-hero-demo .sd-tab-set > input:not(:checked, :focus-visible) + label:hover {+ border-radius: 3px !important;+}++/* dropdown menus use the navbar's mono font, size and the Blueprint 3px corners */+.kornia-navbar-dropdown__menu a,+.kornia-navbar-dropdown__menu .nav-link,+.kornia-navbar-dropdown__group {+ font-family: var(--pst-font-family-monospace);+ font-size: 0.76rem;+ letter-spacing: 0.04em;+}++.kornia-navbar-dropdown__menu {+ border-radius: 3px !important;+}diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.htmlnew file mode 100644index 000000000..e1f13df87--- /dev/null+++ b/docs/source/_templates/layout.html@@ -0,0 +1,18 @@+{% extends "!layout.html" %}++{# Default to the dark Blueprint theme like the kornia.org homepage (light stays one click away).+ Runs in <head> before the body paints, so there is no flash; the theme toggle still wins because+ it writes localStorage, which this only seeds when the visitor has made no choice yet. #}+{% block extrahead %}+{{ super() }}+<script>+ (function () {+ try {+ if (!localStorage.getItem("mode")) {+ document.documentElement.dataset.mode = "dark";+ document.documentElement.dataset.theme = "dark";+ }+ } catch (e) { /* private mode: fall back to the theme default */ }+ })();+</script>+{% endblock %}diff --git a/docs/source/index.rst b/docs/source/index.rstindex 58cfc802a..766c56dbe 100644--- a/docs/source/index.rst+++ b/docs/source/index.rst@@ -17,6 +17,13 @@ Kornia: Differentiable Computer Vision for PyTorchbutton.sidebar-toggle.secondary-toggle { display: none !important; }/* Room for the two-column hero; the theme caps articles at 960px. */.bd-main .bd-content .bd-article-container { max-width: 1240px; }+ /* Let the full-width bands (sponsor, features) escape the centred column: the article container+ clips overflow by default, which would confine the bleed to 1240px. The container is already+ viewport-centred, so visible overflow lets the negative-margin bands reach the viewport edges;+ clip the outermost (full-width) wrapper so 100vw cannot add a horizontal scrollbar. */+ .bd-main .bd-content .bd-article-container,+ .bd-main .bd-content .bd-article-container .bd-article { overflow: visible; }+ .bd-container { overflow-x: clip; }/* The document title provides the semantic H1 and browser title; the hero is its visible presentation. */span#kornia-docs-home + h1 {border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden;@@ -63,6 +70,12 @@ Kornia: Differentiable Computer Vision for PyTorchAPI reference+ .. button-link:: https://kornia.org/playground/+ :color: secondary+ :outline:++ Try in browser+.. raw:: html<p class="kornia-hero__links">@@ -162,8 +175,16 @@ Kornia: Differentiable Computer Vision for PyTorch.. raw:: html- <p class="kornia-sponsor-notice">Considering sponsoring? —- <a href="community/sponsor.html">Inquire now</a></p>+ <div class="kornia-sponsor-band">+ <p class="kornia-sponsor-band__lead">Kornia is a non-profit building the stack for spatial AI — from+ differentiable vision for research to real-time perception on robots — maintained by a small team and+ funded by the people who use it.</p>+ <div class="kornia-sponsor-band__actions">+ <a class="kornia-btn kornia-btn--primary" href="https://opencollective.com/kornia" target="_blank"+ rel="noopener"><i class="fa-solid fa-heart" aria-hidden="true"></i> Sponsor on Open Collective</a>+ <a class="kornia-sponsor-band__link" href="community/sponsor.html">Why sponsor, and the tiers →</a>+ </div>+ </div>Features--------diff --git a/docs/source/models/index.rst b/docs/source/models/index.rstindex 486894455..c7d8f07fb 100644--- a/docs/source/models/index.rst+++ b/docs/source/models/index.rst@@ -18,11 +18,11 @@ returns on a real input, and ends with the paper. The builders that construct th- Task- Venue- Licence- * - :doc:`RT-DETR <rt_detr>`+ * - :doc:`RT-DETR <rt_detr>` · `Try in browser <https://kornia.org/playground/models/object-detection-rtdetr/>`__- Object detection- arXiv 2023- Apache-2.0- * - :doc:`YuNet <yunet>`+ * - :doc:`YuNet <yunet>` · `Try in browser <https://kornia.org/playground/models/face-detection-yunet/>`__- Face detection- IEEE TIP 2021- Apache-2.0@@ -46,15 +46,15 @@ returns on a real input, and ends with the paper. The builders that construct th- Image classification backbone (mobile)- ICLR 2022- --- * - :doc:`TinyViT <tiny_vit>`+ * - :doc:`TinyViT <tiny_vit>` · `Try in browser <https://kornia.org/playground/models/classification-tinyvit/>`__- Image classification backbone (small)- ECCV 2022- --- * - :doc:`LoFTR <loftr>`+ * - :doc:`LoFTR <loftr>` · `Try in browser <https://kornia.org/playground/models/local-features-loftr/>`__- Image matching (detector-free)- CVPR 2021- Apache-2.0- * - :doc:`HardNet <hardnet>`+ * - :doc:`HardNet <hardnet>` · `Try in browser <https://kornia.org/playground/models/local-features-keynet-hardnet/>`__- Local feature descriptor- NeurIPS 2017- MIT@@ -66,7 +66,7 @@ returns on a real input, and ends with the paper. The builders that construct th- Line detection and matching- CVPR 2021- MIT- * - :doc:`DexiNed <dexined>`+ * - :doc:`DexiNed <dexined>` · `Try in browser <https://kornia.org/playground/models/edges-dexined/>`__- Edge detection- WACV 2020- MIT