import{s as Lt,n as St,o as Qt}from"../chunks/scheduler.7bc62968.js";import{S as At,i as Et,g as p,s as e,r as as,m as o,H as d,A as $t,h as i,f as t,c as l,j as x,u as ts,x as c,n as h,B as u,k as ft,l as $a,y as r,a as n,v as ns,d as es,t as ls,w as ps}from"../chunks/index.2f8492b0.js";import{C as qt}from"../chunks/CodeBlock.4e96d6f7.js";import{H as hs,E as Yt}from"../chunks/EditOnGithub.2a9ce03a.js";function Pt(qa){let f,gs,rs,ds,T,us,J,Ya=`Neural Radiance Fields are a way of storing a 3D scene within a neural network. This way of storing and representing a scene is often called an implicit representation, since the scene parameters are fully represented by the underlying Multi-Layer Perceptron (MLP).
(As compared to an explicit representation that stores scene parameters like colour or density explicitly in voxel grids.)
This novel way of representing a scene showed very impressive results in the task of <a href="https://en.wikipedia.org/wiki/View_synthesis" rel="nofollow">novel view synthesis</a>, the task of interpolating novel views from camera perspectives that are not in the training set.
Furthermore, it allows us to store large scenes with a smaller memory footprint than explicit representation, since we merely need to store the weights of our neural network compared to voxel grids, which increase in memory size by a cubic term.`,ys,_,vs,U,Pa=`The field of NeRFs is relatively young with the first publication by <a href="https://www.matthewtancik.com/nerf" rel="nofollow">Mildenhall et al.</a> appearing in 2020.
Since then, a vast number of papers have been published and fast advancements have been made.
Since 2020, more than 620 preprints and publications have been released, with more than 250 repositories on GitHub. <em>(as of Dec 2023, statistics from <a href="https://paperswithcode.com/method/nerf" rel="nofollow">paperswithcode.com</a>)</em>.`,ws,j,Da=`Since the first formulation of NeRFs requires long training times (up to days on beefy GPUs), there have been a lot of advancements towards faster training and inference.
An important leap was NVIDIA’s <a href="https://nvlabs.github.io/instant-ngp/" rel="nofollow">Instant-ngp</a>, which was released in 2022.
While the model architecture used in this approach is similar to existing ones, the authors introduced a novel encoding method that uses trainable hash-tables.
Thanks to this type of encoding, we can shrink the MLP down significantly without loosing reconstruction quality.
This novel approach was faster to train and query while performing on par quality wise with then state-of-the-art methods.
<a href="https://jonbarron.info/mipnerf360/" rel="nofollow">Mipnerf-360</a>, which was also released in 2022, is also worth mentioning.
Again, the model architecture is the same as for most NeRFs, but the authors introduced a novel scene contraction that allows us to represent scenes that are unbounded in all directions, which is important for real-world applications.
<a href="https://jonbarron.info/zipnerf/" rel="nofollow">Zip-NeRF</a>, released in 2023, combines recent advancements like the encoding from <a href="https://nvlabs.github.io/instant-ngp/" rel="nofollow">Instant-ngp</a> and the scene contraction from <a href="https://jonbarron.info/mipnerf360/" rel="nofollow">Mipnerf-360</a> to handle real-world situation whilst decreasing training times to under an hour.
<em>(this is still measured on beefy GPUs to be fair)</em>.`,bs,k,Ka="Since the field of NeRFs is rapidly evolving, we added a section at the end where we will tease the latest research and the possible future direction of NeRFs.",fs,z,Oa="But now enough with the history, let’s dive into the intrinsics of NeRFs! 🚀🚀",Ms,C,xs,y,Va,Ts,Mt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">x</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex"> \\mathbf{x} \\in \\mathbb{R}^{3} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathbf">x</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span>',Js,_s,xt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold-italic">θ</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex"> \\boldsymbol{\\theta} \\in \\mathbb{R}^{2} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.0391em;"></span><span class="mord"><span class="mord"><span class="mord boldsymbol" style="margin-right:0.03194em;">θ</span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span>',Us,js,Tt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">c</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex"> \\mathbf{c} \\in \\mathbb{R}^{3} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathbf">c</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span>',ks,zs,Jt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>σ</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>1</mn></msup></mrow><annotation encoding="application/x-tex"> \\sigma \\in \\mathbb{R}^{1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span></span></span></span></span></span></span></span>',Cs,Is,_t='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>F</mi><mi mathvariant="normal">Θ</mi></msub><mo>:</mo><mo stretchy="false">(</mo><mi mathvariant="bold">x</mi><mo separator="true">,</mo><mi mathvariant="bold-italic">θ</mi><mo stretchy="false">)</mo><mo>→</mo><mo stretchy="false">(</mo><mi mathvariant="bold">c</mi><mo separator="true">,</mo><mi>σ</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex"> F_{\\mathrm{\\Theta}} : (\\mathbf{x}, \\boldsymbol{\\theta}) \\to (\\mathbf{c},\\sigma) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">F</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathrm mtight">Θ</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathbf">x</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord"><span class="mord boldsymbol" style="margin-right:0.03194em;">θ</span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">→</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathbf">c</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="mclose">)</span></span></span></span>',Rs,Zs,I,st="A simple NeRF pipeline can be summarized with the following picture:",Ws,w,at='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/nerf_pipeline.png" alt="nerf_pipeline"/> <p>Image from: <a href="https://www.matthewtancik.com/nerf">Mildenhall et al. (2020)</a></p>',Fs,R,tt="<strong>(a)</strong> Sample points and viewing directions along camera rays and pass them through the network.",Ns,Z,nt="<strong>(b)</strong> Network output is a colour vector and density value for each sample.",Bs,W,et="<strong>(c)</strong> Combine the outputs of the network via volumetric rendering to go from discrete samples in 3D space to a 2D image.",Vs,F,lt="<strong>(d)</strong> Compute the loss and update network gradients via backpropagation to represent scene.",Gs,N,pt="This is overview is very high level, so for a better understanding, let’s go into the details of the volume rendering and the used loss function.",Hs,B,it="<strong>Volume Rendering</strong>",Xs,M,Ga,is,mt="differentiable",Ha,Ls,Ut='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="bold">C</mi><mo stretchy="false">(</mo><mi mathvariant="bold">r</mi><mo stretchy="false">)</mo><mo>=</mo><msubsup><mo>∫</mo><msub><mi>t</mi><mi>n</mi></msub><msub><mi>t</mi><mi>f</mi></msub></msubsup><mi>T</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mi>σ</mi><mo stretchy="false">(</mo><mi mathvariant="bold">r</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo><mi mathvariant="bold">c</mi><mo stretchy="false">(</mo><mi mathvariant="bold">r</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo separator="true">,</mo><mi mathvariant="bold">d</mi><mo stretchy="false">)</mo><mi>d</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\\mathbf{C}(\\mathbf{r}) = \\int_{t_n}^{t_f}T(t)\\sigma(\\mathbf{r}(t))\\mathbf{c}(\\mathbf{r}(t),\\mathbf{d})dt</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathbf">C</span><span class="mopen">(</span><span class="mord mathbf">r</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.5555em;vertical-align:-1.012em;"></span><span class="mop"><span class="mop op-symbol large-op" style="margin-right:0.44445em;position:relative;top:-0.0011em;">∫</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.5435em;"><span style="top:-1.7881em;margin-left:-0.4445em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1645em;"><span style="top:-2.357em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.143em;"><span></span></span></span></span></span></span></span></span></span><span style="top:-3.8129em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathnormal mtight">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3448em;"><span style="top:-2.3488em;margin-left:0em;margin-right:0.0714em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathnormal mtight" style="margin-right:0.10764em;">f</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2901em;"><span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.012em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="mopen">(</span><span class="mord mathbf">r</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">))</span><span class="mord mathbf">c</span><span class="mopen">(</span><span class="mord mathbf">r</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathbf">d</span><span class="mclose">)</span><span class="mord mathnormal">d</span><span class="mord mathnormal">t</span></span></span></span></span>',Ss,m,Xa,Qs,jt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">C</mi><mo stretchy="false">(</mo><mi mathvariant="bold">r</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex"> \\mathbf{C}(\\mathbf{r}) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathbf">C</span><span class="mopen">(</span><span class="mord mathbf">r</span><span class="mclose">)</span></span></span></span>',As,Es,kt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">r</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo><mo>=</mo><mi mathvariant="bold">o</mi><mo>+</mo><mi>t</mi><mi mathvariant="bold">d</mi></mrow><annotation encoding="application/x-tex"> \\mathbf{r}(t)=\\mathbf{o}+t\\mathbf{d} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathbf">r</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.6667em;vertical-align:-0.0833em;"></span><span class="mord mathbf">o</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">t</span><span class="mord mathbf">d</span></span></span></span>',$s,qs,zt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">o</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex"> \\mathbf{o} \\in \\mathbb{R}^{3} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathbf">o</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span>',Ys,Ps,Ct='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold-italic">d</mi><mo>∈</mo><msup><mi mathvariant="double-struck">R</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex"> \\boldsymbol{d} \\in \\mathbb{R}^{3} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335em;vertical-align:-0.0391em;"></span><span class="mord"><span class="mord"><span class="mord boldsymbol">d</span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8141em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">3</span></span></span></span></span></span></span></span></span></span></span></span>',Ds,Ks,It='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mo>∈</mo><msub><mi mathvariant="double-struck">R</mi><mo>+</mo></msub></mrow><annotation encoding="application/x-tex"> t \\in \\mathbb{R}_+ </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6542em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">t</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.8972em;vertical-align:-0.2083em;"></span><span class="mord"><span class="mord mathbb">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.2583em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">+</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2083em;"><span></span></span></span></span></span></span></span></span></span>',Os,sa,Rt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex"> t_n </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7651em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',aa,ta,Zt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mi>f</mi></msub></mrow><annotation encoding="application/x-tex"> t_f </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9012em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.10764em;">f</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span>',na,ea,Wt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex"> T(t) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span></span></span></span>',la,pa,Ft='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">r</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex"> \\mathbf{r}(t) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathbf">r</span><span class="mopen">(</span><span class="mord mathnormal">t</span><span class="mclose">)</span></span></span></span>',ia,ma,Nt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex"> t_n </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7651em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>',ra,oa,Bt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex"> t </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6151em;"></span><span class="mord mathnormal">t</span></span></span></span>',ca,ha,V,La,ga,Vt='<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi><mover accent="true"><mi mathvariant="bold-italic">C</mi><mo>^</mo></mover></mi><mo stretchy="false">(</mo><mi mathvariant="bold">r</mi><mo stretchy="false">)</mo><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><msub><mi>T</mi><mi>i</mi></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>exp</mi><mo>⁡</mo><mo stretchy="false">(</mo><mo>−</mo><msub><mi>σ</mi><mi>i</mi></msub><msub><mi>δ</mi><mi>i</mi></msub><mo stretchy="false">)</mo><mo stretchy="false">)</mo><msub><mi mathvariant="bold">c</mi><mi>i</mi></msub><mtext> </mtext><mo separator="true">,</mo><mtext> where </mtext><msub><mi>T</mi><mi>i</mi></msub><mo>=</mo><mi>exp</mi><mo>⁡</mo><mo fence="false" stretchy="true" minsize="2.4em" maxsize="2.4em">(</mo><mo>−</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></munderover><msub><mi>σ</mi><mi>j</mi></msub><msub><mi>δ</mi><mi>j</mi></msub><mo fence="false" stretchy="true" minsize="2.4em" maxsize="2.4em">)</mo></mrow><annotation encoding="application/x-tex">\\boldsymbol{\\hat{C}}(\\mathbf{r})=\\sum_{i=1}^{N}T_i (1-\\exp(-\\sigma_i \\delta_i)) \\mathbf{c}_i\\,, \\textrm{ where }T_i=\\exp \\bigg(-\\sum_{j=1}^{i-1} \\sigma_j \\delta_j \\bigg)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1995em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9495em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span></span><span style="top:-3.2551em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.2875em;"><span class="mord mathbf">^</span></span></span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathbf">r</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:3.106em;vertical-align:-1.2777em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8283em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.10903em;">N</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2777em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mop">exp</span><span class="mopen">(</span><span class="mord">−</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03785em;">δ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0379em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">))</span><span class="mord"><span class="mord mathbf">c</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord text"><span class="mord textrm"> where </span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="mop">exp</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="delimsizing size3">(</span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:3.2254em;vertical-align:-1.4138em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.8117em;"><span style="top:-1.8723em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top:-3.05em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.3em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">i</span><span class="mbin mtight">−</span><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.4138em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03785em;">δ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0379em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mord"><span class="delimsizing size3">)</span></span></span></span></span></span>',da,G,rt="Below, you can see a schematic visualisation of a discretized camera ray in order to get a better sense of the variables from above:",ua,H,ot='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/nerf_ray_visualisation.png" alt="ray_image"/>',ya,X,ct="<strong>Loss formulation</strong>",va,L,Sa,wa,Gt=`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="script">L</mi><mrow><mi mathvariant="normal">r</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">c</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi></mrow></msub><mo stretchy="false">(</mo><mi><mover accent="true"><mi mathvariant="bold-italic">C</mi><mo>^</mo></mover></mi><mo separator="true">,</mo><mi><msup><mi mathvariant="bold-italic">C</mi><mo mathvariant="bold-italic">∗</mo></msup></mi><mo stretchy="false">)</mo><mo>=</mo><msup><mrow><mo fence="true">∥</mo><mi><mover accent="true"><mi mathvariant="bold-italic">C</mi><mo>^</mo></mover></mi><mo>−</mo><mi><msup><mi mathvariant="bold-italic">C</mi><mo mathvariant="bold-italic">∗</mo></msup></mi><mo fence="true">∥</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\\mathcal{L}_{\\rm recon}(\\boldsymbol{\\hat{C}},\\boldsymbol{C^*}) = \\left\\|\\boldsymbol{\\hat{C}}-\\boldsymbol{C^*}\\right\\|^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.1995em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathcal">L</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">recon</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord"><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9495em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span></span><span style="top:-3.2551em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.2875em;"><span class="mord mathbf">^</span></span></span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7436em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mathbf mtight">∗</span></span></span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:2.004em;vertical-align:-0.65em;"></span><span class="minner"><span class="minner"><span class="mopen"><span class="delimsizing mult"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.15em;"><span style="top:-3.15em;"><span class="pstrut" style="height:3.8em;"></span><span style="width:0.556em;height:1.800em;"><svg xmlns="http://www.w3.org/2000/svg" width='0.556em' height='1.800em' viewBox='0 0 556 1800'><path d='M145 15 v585 v600 v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v-600 v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v600 v585 h43z
M367 15 v585 v600 v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v-600 v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v600 v585 h43z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.65em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9495em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span></span><span style="top:-3.2551em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.2875em;"><span class="mord mathbf">^</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7436em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mathbf mtight">∗</span></span></span></span></span></span></span></span></span></span><span class="mclose"><span class="delimsizing mult"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.15em;"><span style="top:-3.15em;"><span class="pstrut" style="height:3.8em;"></span><span style="width:0.556em;height:1.800em;"><svg xmlns="http://www.w3.org/2000/svg" width='0.556em' height='1.800em' viewBox='0 0 556 1800'><path d='M145 15 v585 v600 v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v-600 v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v600 v585 h43z
M367 15 v585 v600 v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v-600 v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v600 v585 h43z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.65em;"><span></span></span></span></span></span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.354em;"><span style="top:-3.6029em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span>`,ba,b,Qa,fa,Ht='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi><mover accent="true"><mi mathvariant="bold-italic">C</mi><mo>^</mo></mover></mi></mrow><annotation encoding="application/x-tex"> \\boldsymbol{\\hat{C}} </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9495em;"></span><span class="mord"><span class="mord"><span class="mord accent"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.9495em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span></span><span style="top:-3.2551em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.2875em;"><span class="mord mathbf">^</span></span></span></span></span></span></span></span></span></span></span></span>',Ma,xa,Xt='<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="bold-italic">C</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex"> \\boldsymbol{C}^* </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7647em;"></span><span class="mord"><span class="mord"><span class="mord"><span class="mord boldsymbol" style="margin-right:0.06979em;">C</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7647em;"><span style="top:-3.139em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">∗</span></span></span></span></span></span></span></span></span></span></span>',Ta,Ja,S,ht="<strong>Additional remarks</strong>",_a,Q,gt=`It is very hard to describe the whole NeRF pipeline in detail within a single chapter.
The explanations above are important to understand the basic concepts and similar if not identical in every NeRF model.
However, some additional tricks are needed to obtain a well performing model.`,Ua,A,dt=`First of all, it is necesarry to encode input signals in order to capture high-frequency variations in colour and geometry.
The practice of encoding inputs before passing them through a neural network is not unique to the NeRF domain but also widely adopted in other ML domains like for example Natural Language Processing (NLP).
A very simple encoding where we map the inputs to a higher dimensional space, enabling us to capture high frequency variations in scene parameters could look as follows:`,ja,E,ka,$,ut="The output should look something like the image below:",za,q,yt='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/nerf_encodings.png" alt="encoding"/>',Ca,Y,vt=`The second trick worth mentioning is that most methods use smart approaches to sample points in space.
Essentially, we want to avoid sampling in regions where the scene is empty.
There are various approaches to concentrate samples in regions that contribute most to the final image, but the most prominent one is to use a second network, often called <em>proposal network</em> so that no compute is wasted.
If you are interested in the inner workings and optimisation of such a <em>proposal network</em>, feel free to dig into the publication of <a href="https://jonbarron.info/mipnerf360/" rel="nofollow">Mipnerf-360</a>, where it was first proposed.`,Ia,P,Ra,D,wt=`To get the full experience when training your first NeRF, I recommend taking a look at the awesome <a href="https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/main/colab/demo.ipynb" rel="nofollow">Google Colab notebook from the nerfstudio team</a>.
There, you can upload images of a scene of your choice and train a NeRF. You could for example fit a model to represent your living room. 🎉🎉`,Za,K,Wa,O,bt=`The field is rapidly evolving and the number of new publications is almost exploding.
Concerning training and rendering speed, <a href="https://vr-nerf.github.io" rel="nofollow">VR-NeRF</a> and <a href="https://smerf-3d.github.io" rel="nofollow">SMERF</a> show very promising results.
We believe that we will soon be able to stream a real-world scene in real-time on an edge device, and this is a huge leap towards a realistic <em>Metaverse</em>.
However, the research in the field of NeRFs is not only focusing on training and inference speed, but encompasses various directions like, Generative NeRFs, Pose Estimation, Deformable NeRFs, Compositionality and many more.
If you are interested in a curated list of NeRF publications, checkout <a href="https://github.com/awesome-NeRF/awesome-NeRF" rel="nofollow">Awesome-NeRF</a>.`,Fa,ss,Na,os,Ba;return T=new hs({props:{title:"Neural Radiance Fields (NeRFs)",local:"neural-radiance-fields-nerfs",headingTag:"h1"}}),_=new hs({props:{title:"Short History 📖",local:"short-history-",headingTag:"h2"}}),C=new hs({props:{title:"Underlying approach (Vanilla NeRF) 📘🔍",local:"underlying-approach-vanilla-nerf-",headingTag:"h2"}}),E=new qt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBtZWRpYXB5JTIwYXMlMjBtZWRpYSUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUwQWRlZiUyMHBvc2l0aW9uYWxfZW5jb2RpbmcoaW5fdGVuc29yJTJDJTIwbnVtX2ZyZXF1ZW5jaWVzJTJDJTIwbWluX2ZyZXFfZXhwJTJDJTIwbWF4X2Z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wdG9yY2guc3RhY2soJTBBJTIwJTIwJTIwJTIwdG9yY2gubWVzaGdyaWQoeF9zYW1wbGVzJTJDJTIweV9zYW1wbGVzKSUyQyUyMGRpbSUzRC0xJTBBKSUyMCUyMCUyMyUyMCU1QnJlc29sdXRpb24lMkMlMjByZXNvbHV0aW9uJTJDJTIwMiU1RCUwQSUwQSUyMyUyMEFwcGx5JTIwcG9zaXRpb25hbCUyMGVuY29kaW5nJTBBZW5jb2RlZF9ncmlkJTIwJTNEJTIwcG9zaXRpb25hbF9lbmNvZGluZyhncmlkJTJDJTIwbnVtX2ZyZXF1ZW5jaWVzJTJDJTIwbWluX2ZyZXFfZXhwJTJDJTIwbWF4X2ZyZXFfZXhwKSUwQSUwQSUyMyUyMFZpc3VhbGl6ZSUyMHJlc3VsdCUwQXZpc3VhbGl6ZV9ncmlkKGdyaWQlMkMlMjBlbmNvZGVkX2dyaWQlMkMlMjByZXNvbHV0aW9uKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> mediapy <span class="hljs-keyword">as</span> media
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-keyword">def</span> <span class="hljs-title function_">positional_encoding</span>(<span class="hljs-params">in_tensor, num_frequencies, min_freq_exp, max_freq_exp</span>):
    <span class="hljs-string">&quot;&quot;&quot;Function for positional encoding.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Scale input tensor to [0, 2 * pi]</span>
    scaled_in_tensor = <span class="hljs-number">2</span> * np.pi * in_tensor
    <span class="hljs-comment"># Generate frequency spectrum</span>
    freqs = <span class="hljs-number">2</span> ** torch.linspace(
        min_freq_exp, max_freq_exp, num_frequencies, device=in_tensor.device
    )
    <span class="hljs-comment"># Generate encodings</span>
    scaled_inputs = scaled_in_tensor.unsqueeze(-<span class="hljs-number">1</span>) * freqs
    encoded_inputs = torch.cat(
        [torch.sin(scaled_inputs), torch.cos(scaled_inputs)], dim=-<span class="hljs-number">1</span>
    )
    <span class="hljs-keyword">return</span> encoded_inputs.view(*in_tensor.shape[:-<span class="hljs-number">1</span>], -<span class="hljs-number">1</span>)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">visualize_grid</span>(<span class="hljs-params">grid, encoded_images, resolution</span>):
    <span class="hljs-string">&quot;&quot;&quot;Helper Function to visualize grid.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Split the grid into separate channels for x and y</span>
    x_channel, y_channel = grid[..., <span class="hljs-number">0</span>], grid[..., <span class="hljs-number">1</span>]
    <span class="hljs-comment"># Show the original grid</span>
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Input Values:&quot;</span>)
    media.show_images([x_channel, y_channel], cmap=<span class="hljs-string">&quot;plasma&quot;</span>, border=<span class="hljs-literal">True</span>)
    <span class="hljs-comment"># Show the encoded grid</span>
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Encoded Values:&quot;</span>)
    num_channels_to_visualize = <span class="hljs-built_in">min</span>(
        <span class="hljs-number">8</span>, encoded_images.shape[-<span class="hljs-number">1</span>]
    )  <span class="hljs-comment"># Visualize up to 8 channels</span>
    encoded_images_to_show = encoded_images.view(resolution, resolution, -<span class="hljs-number">1</span>).permute(
        <span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>
    )[:num_channels_to_visualize]
    media.show_images(encoded_images_to_show, vmin=-<span class="hljs-number">1</span>, vmax=<span class="hljs-number">1</span>, cmap=<span class="hljs-string">&quot;plasma&quot;</span>, border=<span class="hljs-literal">True</span>)


<span class="hljs-comment"># Parameters similar to your NeRFEncoding example</span>
num_frequencies = <span class="hljs-number">4</span>
min_freq_exp = <span class="hljs-number">0</span>
max_freq_exp = <span class="hljs-number">6</span>
resolution = <span class="hljs-number">128</span>

<span class="hljs-comment"># Generate a 2D grid of points in the range [0, 1]</span>
x_samples = torch.linspace(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, resolution)
y_samples = torch.linspace(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>, resolution)
grid = torch.stack(
    torch.meshgrid(x_samples, y_samples), dim=-<span class="hljs-number">1</span>
)  <span class="hljs-comment"># [resolution, resolution, 2]</span>

<span class="hljs-comment"># Apply positional encoding</span>
encoded_grid = positional_encoding(grid, num_frequencies, min_freq_exp, max_freq_exp)

<span class="hljs-comment"># Visualize result</span>
visualize_grid(grid, encoded_grid, resolution)`,wrap:!1}}),P=new hs({props:{title:"Train your own NeRF",local:"train-your-own-nerf",headingTag:"h2"}}),K=new hs({props:{title:"Current advancements in the field",local:"current-advancements-in-the-field",headingTag:"h2"}}),ss=new Yt({props:{source:"https://github.com/huggingface/computer-vision-course/blob/main/chapters/en/unit8/nerf.mdx"}}),{c(){f=p("meta"),gs=e(),rs=p("p"),ds=e(),as(T.$$.fragment),us=e(),J=p("p"),J.innerHTML=Ya,ys=e(),as(_.$$.fragment),vs=e(),U=p("p"),U.innerHTML=Pa,ws=e(),j=p("p"),j.innerHTML=Da,bs=e(),k=p("p"),k.textContent=Ka,fs=e(),z=p("p"),z.textContent=Oa,Ms=e(),as(C.$$.fragment),xs=e(),y=p("p"),Va=o("The fundamental idea behind NeRFs is to represent a scene as a continuous function that maps a position,"),Ts=new d(!1),Js=o(", and a viewing direction, "),_s=new d(!1),Us=o(", to a colour"),js=new d(!1),ks=o(" and volume density"),zs=new d(!1),Cs=o(`.
As neural networks can serve as universal function approximators, we can approximate this continuous function that represents the scene with a simple Multi-Layer Perceptron (MLP)`),Is=new d(!1),Rs=o("."),Zs=e(),I=p("p"),I.textContent=st,Ws=e(),w=p("div"),w.innerHTML=at,Fs=e(),R=p("p"),R.innerHTML=tt,Ns=e(),Z=p("p"),Z.innerHTML=nt,Bs=e(),W=p("p"),W.innerHTML=et,Vs=e(),F=p("p"),F.innerHTML=lt,Gs=e(),N=p("p"),N.textContent=pt,Hs=e(),B=p("p"),B.innerHTML=it,Xs=e(),M=p("p"),Ga=o(`The principles behind the process of volumetric rendering are well established in classical computer graphics pipelines and do not stem from NeRFs.
What is important for the use case of NeRFs is that this step is `),is=p("strong"),is.textContent=mt,Ha=o(` in order to allow for backpropagation. The simplest form of volumetric rendering in NeRFs can be formulated as follows:
`),Ls=new d(!1),Ss=e(),m=p("p"),Xa=o("In the equation above,"),Qs=new d(!1),As=o(" is the expected colour of a camera ray"),Es=new d(!1),$s=o(", where"),qs=new d(!1),Ys=o(" is the origin of the camera,"),Ps=new d(!1),Ds=o(" is the viewing direction as a 3D unit vector and"),Ks=new d(!1),Os=o(" is the distance along the ray. "),sa=new d(!1),aa=o(" and"),ta=new d(!1),na=o(" stand for the near and far bounds of the ray, respectively. "),ea=new d(!1),la=o(" denotes the accumulated transmittance along ray"),pa=new d(!1),ia=o(" from"),ma=new d(!1),ra=o(" to"),oa=new d(!1),ca=o("."),ha=e(),V=p("p"),La=o(`After discretization, the equation above can be computed as the following sum:
`),ga=new d(!1),da=e(),G=p("p"),G.textContent=rt,ua=e(),H=p("p"),H.innerHTML=ot,ya=e(),X=p("p"),X.innerHTML=ct,va=e(),L=p("p"),Sa=o(`As the discretized volumetric rendeing equation is fully differentiable, the weights of the underlying neural network can then be trained using a reconstruction loss on the rendered pixels.
Many NeRF approaches use a pixel-wise error term that can be written as follows:
`),wa=new d(!1),ba=e(),b=p("p"),Qa=o(",where"),fa=new d(!1),Ma=o(" is the rendered pixel colour and"),xa=new d(!1),Ta=o(" is the ground truth pixel colour."),Ja=e(),S=p("p"),S.innerHTML=ht,_a=e(),Q=p("p"),Q.textContent=gt,Ua=e(),A=p("p"),A.textContent=dt,ja=e(),as(E.$$.fragment),ka=e(),$=p("p"),$.textContent=ut,za=e(),q=p("p"),q.innerHTML=yt,Ca=e(),Y=p("p"),Y.innerHTML=vt,Ia=e(),as(P.$$.fragment),Ra=e(),D=p("p"),D.innerHTML=wt,Za=e(),as(K.$$.fragment),Wa=e(),O=p("p"),O.innerHTML=bt,Fa=e(),as(ss.$$.fragment),Na=e(),os=p("p"),this.h()},l(s){const a=$t("svelte-u9bgzb",document.head);f=i(a,"META",{name:!0,content:!0}),a.forEach(t),gs=l(s),rs=i(s,"P",{}),x(rs).forEach(t),ds=l(s),ts(T.$$.fragment,s),us=l(s),J=i(s,"P",{"data-svelte-h":!0}),c(J)!=="svelte-jul4ou"&&(J.innerHTML=Ya),ys=l(s),ts(_.$$.fragment,s),vs=l(s),U=i(s,"P",{"data-svelte-h":!0}),c(U)!=="svelte-17n4p8p"&&(U.innerHTML=Pa),ws=l(s),j=i(s,"P",{"data-svelte-h":!0}),c(j)!=="svelte-1jpj7za"&&(j.innerHTML=Da),bs=l(s),k=i(s,"P",{"data-svelte-h":!0}),c(k)!=="svelte-1tm1mze"&&(k.textContent=Ka),fs=l(s),z=i(s,"P",{"data-svelte-h":!0}),c(z)!=="svelte-pma9sc"&&(z.textContent=Oa),Ms=l(s),ts(C.$$.fragment,s),xs=l(s),y=i(s,"P",{});var v=x(y);Va=h(v,"The fundamental idea behind NeRFs is to represent a scene as a continuous function that maps a position,"),Ts=u(v,!1),Js=h(v,", and a viewing direction, "),_s=u(v,!1),Us=h(v,", to a colour"),js=u(v,!1),ks=h(v," and volume density"),zs=u(v,!1),Cs=h(v,`.
As neural networks can serve as universal function approximators, we can approximate this continuous function that represents the scene with a simple Multi-Layer Perceptron (MLP)`),Is=u(v,!1),Rs=h(v,"."),v.forEach(t),Zs=l(s),I=i(s,"P",{"data-svelte-h":!0}),c(I)!=="svelte-y9lvf0"&&(I.textContent=st),Ws=l(s),w=i(s,"DIV",{style:!0,"data-svelte-h":!0}),c(w)!=="svelte-15sfwup"&&(w.innerHTML=at),Fs=l(s),R=i(s,"P",{"data-svelte-h":!0}),c(R)!=="svelte-1tobfln"&&(R.innerHTML=tt),Ns=l(s),Z=i(s,"P",{"data-svelte-h":!0}),c(Z)!=="svelte-1c917er"&&(Z.innerHTML=nt),Bs=l(s),W=i(s,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1oxe61n"&&(W.innerHTML=et),Vs=l(s),F=i(s,"P",{"data-svelte-h":!0}),c(F)!=="svelte-9jqkju"&&(F.innerHTML=lt),Gs=l(s),N=i(s,"P",{"data-svelte-h":!0}),c(N)!=="svelte-105mi7d"&&(N.textContent=pt),Hs=l(s),B=i(s,"P",{"data-svelte-h":!0}),c(B)!=="svelte-8gnilz"&&(B.innerHTML=it),Xs=l(s),M=i(s,"P",{});var cs=x(M);Ga=h(cs,`The principles behind the process of volumetric rendering are well established in classical computer graphics pipelines and do not stem from NeRFs.
What is important for the use case of NeRFs is that this step is `),is=i(cs,"STRONG",{"data-svelte-h":!0}),c(is)!=="svelte-tu9yc4"&&(is.textContent=mt),Ha=h(cs,` in order to allow for backpropagation. The simplest form of volumetric rendering in NeRFs can be formulated as follows:
`),Ls=u(cs,!1),cs.forEach(t),Ss=l(s),m=i(s,"P",{});var g=x(m);Xa=h(g,"In the equation above,"),Qs=u(g,!1),As=h(g," is the expected colour of a camera ray"),Es=u(g,!1),$s=h(g,", where"),qs=u(g,!1),Ys=h(g," is the origin of the camera,"),Ps=u(g,!1),Ds=h(g," is the viewing direction as a 3D unit vector and"),Ks=u(g,!1),Os=h(g," is the distance along the ray. "),sa=u(g,!1),aa=h(g," and"),ta=u(g,!1),na=h(g," stand for the near and far bounds of the ray, respectively. "),ea=u(g,!1),la=h(g," denotes the accumulated transmittance along ray"),pa=u(g,!1),ia=h(g," from"),ma=u(g,!1),ra=h(g," to"),oa=u(g,!1),ca=h(g,"."),g.forEach(t),ha=l(s),V=i(s,"P",{});var Aa=x(V);La=h(Aa,`After discretization, the equation above can be computed as the following sum:
`),ga=u(Aa,!1),Aa.forEach(t),da=l(s),G=i(s,"P",{"data-svelte-h":!0}),c(G)!=="svelte-1lchi64"&&(G.textContent=rt),ua=l(s),H=i(s,"P",{"data-svelte-h":!0}),c(H)!=="svelte-130vc1o"&&(H.innerHTML=ot),ya=l(s),X=i(s,"P",{"data-svelte-h":!0}),c(X)!=="svelte-1ylz9no"&&(X.innerHTML=ct),va=l(s),L=i(s,"P",{});var Ea=x(L);Sa=h(Ea,`As the discretized volumetric rendeing equation is fully differentiable, the weights of the underlying neural network can then be trained using a reconstruction loss on the rendered pixels.
Many NeRF approaches use a pixel-wise error term that can be written as follows:
`),wa=u(Ea,!1),Ea.forEach(t),ba=l(s),b=i(s,"P",{});var ms=x(b);Qa=h(ms,",where"),fa=u(ms,!1),Ma=h(ms," is the rendered pixel colour and"),xa=u(ms,!1),Ta=h(ms," is the ground truth pixel colour."),ms.forEach(t),Ja=l(s),S=i(s,"P",{"data-svelte-h":!0}),c(S)!=="svelte-1fogha9"&&(S.innerHTML=ht),_a=l(s),Q=i(s,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-900j4b"&&(Q.textContent=gt),Ua=l(s),A=i(s,"P",{"data-svelte-h":!0}),c(A)!=="svelte-wakkft"&&(A.textContent=dt),ja=l(s),ts(E.$$.fragment,s),ka=l(s),$=i(s,"P",{"data-svelte-h":!0}),c($)!=="svelte-v8crjg"&&($.textContent=ut),za=l(s),q=i(s,"P",{"data-svelte-h":!0}),c(q)!=="svelte-q7lmzd"&&(q.innerHTML=yt),Ca=l(s),Y=i(s,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-92cgsm"&&(Y.innerHTML=vt),Ia=l(s),ts(P.$$.fragment,s),Ra=l(s),D=i(s,"P",{"data-svelte-h":!0}),c(D)!=="svelte-zhe5l7"&&(D.innerHTML=wt),Za=l(s),ts(K.$$.fragment,s),Wa=l(s),O=i(s,"P",{"data-svelte-h":!0}),c(O)!=="svelte-z2v2y8"&&(O.innerHTML=bt),Fa=l(s),ts(ss.$$.fragment,s),Na=l(s),os=i(s,"P",{}),x(os).forEach(t),this.h()},h(){ft(f,"name","hf:doc:metadata"),ft(f,"content",Dt),Ts.a=Js,_s.a=Us,js.a=ks,zs.a=Cs,Is.a=Rs,$a(w,"display","flex"),$a(w,"flex-direction","column"),$a(w,"align-items","center"),Ls.a=null,Qs.a=As,Es.a=$s,qs.a=Ys,Ps.a=Ds,Ks.a=Os,sa.a=aa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s,a),n(s,ka,a),n(s,$,a),n(s,za,a),n(s,q,a),n(s,Ca,a),n(s,Y,a),n(s,Ia,a),ns(P,s,a),n(s,Ra,a),n(s,D,a),n(s,Za,a),ns(K,s,a),n(s,Wa,a),n(s,O,a),n(s,Fa,a),ns(ss,s,a),n(s,Na,a),n(s,os,a),Ba=!0},p:St,i(s){Ba||(es(T.$$.fragment,s),es(_.$$.fragment,s),es(C.$$.fragment,s),es(E.$$.fragment,s),es(P.$$.fragment,s),es(K.$$.fragment,s),es(ss.$$.fragment,s),Ba=!0)},o(s){ls(T.$$.fragment,s),ls(_.$$.fragment,s),ls(C.$$.fragment,s),ls(E.$$.fragment,s),ls(P.$$.fragment,s),ls(K.$$.fragment,s),ls(ss.$$.fragment,s),Ba=!1},d(s){s&&(t(gs),t(rs),t(ds),t(us),t(J),t(ys),t(vs),t(U),t(ws),t(j),t(bs),t(k),t(fs),t(z),t(Ms),t(xs),t(y),t(Zs),t(I),t(Ws),t(w),t(Fs),t(R),t(Ns),t(Z),t(Bs),t(W),t(Vs),t(F),t(Gs),t(N),t(Hs),t(B),t(Xs),t(M),t(Ss),t(m),t(ha),t(V),t(da),t(G),t(ua),t(H),t(ya),t(X),t(va),t(L),t(ba),t(b),t(Ja),t(S),t(_a),t(Q),t(Ua),t(A),t(ja),t(ka),t($),t(za),t(q),t(Ca),t(Y),t(Ia),t(Ra),t(D),t(Za),t(Wa),t(O),t(Fa),t(Na),t(os)),t(f),ps(T,s),ps(_,s),ps(C,s),ps(E,s),ps(P,s),ps(K,s),ps(ss,s)}}}const Dt='{"title":"Neural Radiance Fields (NeRFs)","local":"neural-radiance-fields-nerfs","sections":[{"title":"Short History 📖","local":"short-history-","sections":[],"depth":2},{"title":"Underlying approach (Vanilla NeRF) 📘🔍","local":"underlying-approach-vanilla-nerf-","sections":[],"depth":2},{"title":"Train your own NeRF","local":"train-your-own-nerf","sections":[],"depth":2},{"title":"Current advancements in the field","local":"current-advancements-in-the-field","sections":[],"depth":2}],"depth":1}';function Kt(qa){return Qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nn extends At{constructor(f){super(),Et(this,f,Kt,Pt,Lt,{})}}export{nn as component};
