import{s as $t,n as Qt,o as At}from"../chunks/scheduler.35aab934.js";import{S as Et,i as qt,e as p,s as e,c as x,q as o,H as d,h as Yt,a as i,d as t,b as l,f as T,g as J,j as c,r as h,u,k as xt,v as Ya,l as r,m as n,n as _,t as U,o as j,p as z}from"../chunks/index.de17b971.js";import{C as Pt}from"../chunks/CopyLLMTxtMenu.48bc5cc2.js";import{C as Dt}from"../chunks/CodeBlock.c1f62de5.js";import{H as gs,E as Kt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8fdece89.js";function Ot(Pa){let f,ds,os,us,k,ys,C,vs,I,Da=`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.`,ws,R,bs,Z,Ka=`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>.`,fs,W,Oa=`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>.`,Ms,F,st="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.",xs,N,at="But now enough with the history, let’s dive into the intrinsics of NeRFs! 🚀🚀",Ts,B,Js,y,Ha,_s,Tt='<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>',Us,js,Jt='<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>',zs,ks,_t='<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>',Cs,Is,Ut='<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>',Rs,Zs,jt='<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>',Ws,Fs,V,tt="A simple NeRF pipeline can be summarized with the following picture:",Ns,w,nt='<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>',Bs,G,et="<strong>(a)</strong> Sample points and viewing directions along camera rays and pass them through the network.",Vs,H,lt="<strong>(b)</strong> Network output is a colour vector and density value for each sample.",Gs,L,pt="<strong>(c)</strong> Combine the outputs of the network via volumetric rendering to go from discrete samples in 3D space to a 2D image.",Hs,X,it="<strong>(d)</strong> Compute the loss and update network gradients via backpropagation to represent scene.",Ls,S,mt="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.",Xs,$,rt="<strong>Volume Rendering</strong>",Ss,M,La,ms,ot="differentiable",Xa,$s,zt='<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>',Qs,m,Sa,As,kt='<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>',Es,qs,Ct='<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>',Ys,Ps,It='<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>',Ds,Ks,Rt='<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>',Os,sa,Zt='<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>',aa,ta,Wt='<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>',na,ea,Ft='<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>',la,pa,Nt='<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>',ia,ma,Bt='<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>',ra,oa,Vt='<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>',ca,ha,Gt='<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>',ga,da,Q,$a,ua,Ht='<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>',ya,A,ct="Below, you can see a schematic visualisation of a discretized camera ray in order to get a better sense of the variables from above:",va,E,ht='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/nerf_ray_visualisation.png" alt="ray_image"/>',wa,q,gt="<strong>Loss formulation</strong>",ba,Y,Qa,fa,Lt=`<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>`,Ma,b,Aa,xa,Xt='<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>',Ta,Ja,St='<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>',_a,Ua,P,dt="<strong>Additional remarks</strong>",ja,D,ut=`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.`,za,K,yt=`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:`,ka,O,Ca,ss,vt="The output should look something like the image below:",Ia,as,wt='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/nerf_encodings.png" alt="encoding"/>',Ra,ts,bt=`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.`,Za,ns,Wa,es,ft=`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. 🎉🎉`,Fa,ls,Na,ps,Mt=`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>.`,Ba,is,Va,cs,Ga;return k=new Pt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new gs({props:{title:"Neural Radiance Fields (NeRFs)",local:"neural-radiance-fields-nerfs",headingTag:"h1"}}),R=new gs({props:{title:"Short History 📖",local:"short-history-",headingTag:"h2"}}),B=new gs({props:{title:"Underlying approach (Vanilla NeRF) 📘🔍",local:"underlying-approach-vanilla-nerf-",headingTag:"h2"}}),O=new Dt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBtZWRpYXB5JTIwYXMlMjBtZWRpYSUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQSUwQWRlZiUyMHBvc2l0aW9uYWxfZW5jb2RpbmcoaW5fdGVuc29yJTJDJTIwbnVtX2ZyZXF1ZW5jaWVzJTJDJTIwbWluX2ZyZXFfZXhwJTJDJTIwbWF4X2ZyZXFfZXhwKSUzQSUwQSUyMCUyMCUyMCUyMCUyMiUyMiUyMkZ1bmN0aW9uJTIwZm9yJTIwcG9zaXRpb25hbCUyMGVuY29kaW5nLiUyMiUyMiUyMiUwQSUyMCUyMCUyMCUyMCUyMyUyMFNjYWxlJTIwaW5wdXQlMjB0ZW5zb3IlMjB0byUyMCU1QjAlMkMlMjAyJTIwKiUyMHBpJTVEJTBBJTIwJTIwJTIwJTIwc2NhbGVkX2luX3RlbnNvciUyMCUzRCUyMDIlMjAqJTIwbnAucGklMjAqJTIwaW5fdGVuc29yJTBBJTIwJTIwJTIwJTIwJTIzJTIwR2VuZXJhdGUlMjBmcmVxdWVuY3klMjBzcGVjdHJ1bSUwQSUyMCUyMCUyMCUyMGZyZXFzJTIwJTNEJTIwMiUyMCoqJTIwdG9yY2gubGluc3BhY2UoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWluX2ZyZXFfZXhwJTJDJTIwbWF4X2ZyZXFfZXhwJTJDJTIwbnVtX2ZyZXF1ZW5jaWVzJTJDJTIwZGV2aWNlJTNEaW5fdGVuc29yLmRldmljZSUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjAlMjMlMjBHZW5lcmF0ZSUyMGVuY29kaW5ncyUwQSUyMCUyMCUyMCUyMHNjYWxlZF9pbnB1dHMlMjAlM0QlMjBzY2FsZWRfaW5fdGVuc29yLnVuc3F1ZWV6ZSgtMSklMjAqJTIwZnJlcXMlMEElMjAlMjAlMjAlMjBlbmNvZGVkX2lucHV0cyUyMCUzRCUyMHRvcmNoLmNhdCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUJ0b3JjaC5zaW4oc2NhbGVkX2lucHV0cyklMkMlMjB0b3JjaC5jb3Moc2NhbGVkX2lucHV0cyklNUQlMkMlMjBkaW0lM0QtMSUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBlbmNvZGVkX2lucHV0cy52aWV3KCppbl90ZW5zb3Iuc2hhcGUlNUIlM0EtMSU1RCUyQyUyMC0xKSUwQSUwQSUwQWRlZiUyMHZpc3VhbGl6ZV9ncmlkKGdyaWQlMkMlMjBlbmNvZGVkX2ltYWdlcyUyQyUyMHJlc29sdXRpb24pJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIySGVscGVyJTIwRnVuY3Rpb24lMjB0byUyMHZpc3VhbGl6ZSUyMGdyaWQuJTIyJTIyJTIyJTBBJTIwJTIwJTIwJTIwJTIzJTIwU3BsaXQlMjB0aGUlMjBncmlkJTIwaW50byUyMHNlcGFyYXRlJTIwY2hhbm5lbHMlMjBmb3IlMjB4JTIwYW5kJTIweSUwQSUyMCUyMCUyMCUyMHhfY2hhbm5lbCUyQyUyMHlfY2hhbm5lbCUyMCUzRCUyMGdyaWQlNUIuLi4lMkMlMjAwJTVEJTJDJTIwZ3JpZCU1Qi4uLiUyQyUyMDElNUQlMEElMjAlMjAlMjAlMjAlMjMlMjBTaG93JTIwdGhlJTIwb3JpZ2luYWwlMjBncmlkJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIySW5wdXQlMjBWYWx1ZXMlM0ElMjIpJTBBJTIwJTIwJTIwJTIwbWVkaWEuc2hvd19pbWFnZXMoJTVCeF9jaGFubmVsJTJDJTIweV9jaGFubmVsJTVEJTJDJTIwY21hcCUzRCUyMnBsYXNtYSUyMiUyQyUyMGJvcmRlciUzRFRydWUpJTBBJTIwJTIwJTIwJTIwJTIzJTIwU2hvdyUyMHRoZSUyMGVuY29kZWQlMjBncmlkJTBBJTIwJTIwJTIwJTIwcHJpbnQoJTIyRW5jb2RlZCUyMFZhbHVlcyUzQSUyMiklMEElMjAlMjAlMjAlMjBudW1fY2hhbm5lbHNfdG9fdmlzdWFsaXplJTIwJTNEJTIwbWluKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMDglMkMlMjBlbmNvZGVkX2ltYWdlcy5zaGFwZSU1Qi0xJTVEJTBBJTIwJTIwJTIwJTIwKSUyMCUyMCUyMyUyMFZpc3VhbGl6ZSUyMHVwJTIwdG8lMjA4JTIwY2hhbm5lbHMlMEElMjAlMjAlMjAlMjBlbmNvZGVkX2ltYWdlc190b19zaG93JTIwJTNEJTIwZW5jb2RlZF9pbWFnZXMudmlldyhyZXNvbHV0aW9uJTJDJTIwcmVzb2x1dGlvbiUyQyUyMC0xKS5wZXJtdXRlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMDIlMkMlMjAwJTJDJTIwMSUwQSUyMCUyMCUyMCUyMCklNUIlM0FudW1fY2hhbm5lbHNfdG9fdmlzdWFsaXplJTVEJTBBJTIwJTIwJTIwJTIwbWVkaWEuc2hvd19pbWFnZXMoZW5jb2RlZF9pbWFnZXNfdG9fc2hvdyUyQyUyMHZtaW4lM0QtMSUyQyUyMHZtYXglM0QxJTJDJTIwY21hcCUzRCUyMnBsYXNtYSUyMiUyQyUyMGJvcmRlciUzRFRydWUpJTBBJTBBJTBBJTIzJTIwUGFyYW1ldGVycyUyMHNpbWlsYXIlMjB0byUyMHlvdXIlMjBOZVJGRW5jb2RpbmclMjBleGFtcGxlJTBBbnVtX2ZyZXF1ZW5jaWVzJTIwJTNEJTIwNCUwQW1pbl9mcmVxX2V4cCUyMCUzRCUyMDAlMEFtYXhfZnJlcV9leHAlMjAlM0QlMjA2JTBBcmVzb2x1dGlvbiUyMCUzRCUyMDEyOCUwQSUwQSUyMyUyMEdlbmVyYXRlJTIwYSUyMDJEJTIwZ3JpZCUyMG9mJTIwcG9pbnRzJTIwaW4lMjB0aGUlMjByYW5nZSUyMCU1QjAlMkMlMjAxJTVEJTBBeF9zYW1wbGVzJTIwJTNEJTIwdG9yY2gubGluc3BhY2UoMCUyQyUyMDElMkMlMjByZXNvbHV0aW9uKSUwQXlfc2FtcGxlcyUyMCUzRCUyMHRvcmNoLmxpbnNwYWNlKDAlMkMlMjAxJTJDJTIwcmVzb2x1dGlvbiklMEFncmlkJTIwJTNEJTIwdG9yY2guc3RhY2soJTBBJTIwJTIwJTIwJTIwdG9yY2gubWVzaGdyaWQoeF9zYW1wbGVzJTJDJTIweV9zYW1wbGVzKSUyQyUyMGRpbSUzRC0xJTBBKSUyMCUyMCUyMyUyMCU1QnJlc29sdXRpb24lMkMlMjByZXNvbHV0aW9uJTJDJTIwMiU1RCUwQSUwQSUyMyUyMEFwcGx5JTIwcG9zaXRpb25hbCUyMGVuY29kaW5nJTBBZW5jb2RlZF9ncmlkJTIwJTNEJTIwcG9zaXRpb25hbF9lbmNvZGluZyhncmlkJTJDJTIwbnVtX2ZyZXF1ZW5jaWVzJTJDJTIwbWluX2ZyZXFfZXhwJTJDJTIwbWF4X2ZyZXFfZXhwKSUwQSUwQSUyMyUyMFZpc3VhbGl6ZSUyMHJlc3VsdCUwQXZpc3VhbGl6ZV9ncmlkKGdyaWQlMkMlMjBlbmNvZGVkX2dyaWQlMkMlMjByZXNvbHV0aW9uKQ==",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}}),ns=new gs({props:{title:"Train your own NeRF",local:"train-your-own-nerf",headingTag:"h2"}}),ls=new gs({props:{title:"Current advancements in the field",local:"current-advancements-in-the-field",headingTag:"h2"}}),is=new Kt({props:{source:"https://github.com/huggingface/computer-vision-course/blob/main/chapters/en/unit8/nerf.mdx"}}),{c(){f=p("meta"),ds=e(),os=p("p"),us=e(),x(k.$$.fragment),ys=e(),x(C.$$.fragment),vs=e(),I=p("p"),I.innerHTML=Da,ws=e(),x(R.$$.fragment),bs=e(),Z=p("p"),Z.innerHTML=Ka,fs=e(),W=p("p"),W.innerHTML=Oa,Ms=e(),F=p("p"),F.textContent=st,xs=e(),N=p("p"),N.textContent=at,Ts=e(),x(B.$$.fragment),Js=e(),y=p("p"),Ha=o("The fundamental idea behind NeRFs is to represent a scene as a continuous function that maps a position,"),_s=new d(!1),Us=o(", and a viewing direction, "),js=new d(!1),zs=o(", to a colour"),ks=new d(!1),Cs=o(" and volume density"),Is=new d(!1),Rs=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)`),Zs=new d(!1),Ws=o("."),Fs=e(),V=p("p"),V.textContent=tt,Ns=e(),w=p("div"),w.innerHTML=nt,Bs=e(),G=p("p"),G.innerHTML=et,Vs=e(),H=p("p"),H.innerHTML=lt,Gs=e(),L=p("p"),L.innerHTML=pt,Hs=e(),X=p("p"),X.innerHTML=it,Ls=e(),S=p("p"),S.textContent=mt,Xs=e(),$=p("p"),$.innerHTML=rt,Ss=e(),M=p("p"),La=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 `),ms=p("strong"),ms.textContent=ot,Xa=o(` in order to allow for backpropagation. The simplest form of volumetric rendering in NeRFs can be formulated as follows:
`),$s=new d(!1),Qs=e(),m=p("p"),Sa=o("In the equation above,"),As=new d(!1),Es=o(" is the expected colour of a camera ray"),qs=new d(!1),Ys=o(", where"),Ps=new d(!1),Ds=o(" is the origin of the camera,"),Ks=new d(!1),Os=o(" is the viewing direction as a 3D unit vector and"),sa=new d(!1),aa=o(" is the distance along the ray. "),ta=new d(!1),na=o(" and"),ea=new d(!1),la=o(" stand for the near and far bounds of the ray, respectively. "),pa=new d(!1),ia=o(" denotes the accumulated transmittance along ray"),ma=new d(!1),ra=o(" from"),oa=new d(!1),ca=o(" to"),ha=new d(!1),ga=o("."),da=e(),Q=p("p"),$a=o(`After discretization, the equation above can be computed as the following sum:
`),ua=new d(!1),ya=e(),A=p("p"),A.textContent=ct,va=e(),E=p("p"),E.innerHTML=ht,wa=e(),q=p("p"),q.innerHTML=gt,ba=e(),Y=p("p"),Qa=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:
`),fa=new d(!1),Ma=e(),b=p("p"),Aa=o(",where"),xa=new d(!1),Ta=o(" is the rendered pixel colour and"),Ja=new d(!1),_a=o(" is the ground truth pixel colour."),Ua=e(),P=p("p"),P.innerHTML=dt,ja=e(),D=p("p"),D.textContent=ut,za=e(),K=p("p"),K.textContent=yt,ka=e(),x(O.$$.fragment),Ca=e(),ss=p("p"),ss.textContent=vt,Ia=e(),as=p("p"),as.innerHTML=wt,Ra=e(),ts=p("p"),ts.innerHTML=bt,Za=e(),x(ns.$$.fragment),Wa=e(),es=p("p"),es.innerHTML=ft,Fa=e(),x(ls.$$.fragment),Na=e(),ps=p("p"),ps.innerHTML=Mt,Ba=e(),x(is.$$.fragment),Va=e(),cs=p("p"),this.h()},l(s){const a=Yt("svelte-u9bgzb",document.head);f=i(a,"META",{name:!0,content:!0}),a.forEach(t),ds=l(s),os=i(s,"P",{}),T(os).forEach(t),us=l(s),J(k.$$.fragment,s),ys=l(s),J(C.$$.fragment,s),vs=l(s),I=i(s,"P",{"data-svelte-h":!0}),c(I)!=="svelte-jul4ou"&&(I.innerHTML=Da),ws=l(s),J(R.$$.fragment,s),bs=l(s),Z=i(s,"P",{"data-svelte-h":!0}),c(Z)!=="svelte-17n4p8p"&&(Z.innerHTML=Ka),fs=l(s),W=i(s,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1jpj7za"&&(W.innerHTML=Oa),Ms=l(s),F=i(s,"P",{"data-svelte-h":!0}),c(F)!=="svelte-1tm1mze"&&(F.textContent=st),xs=l(s),N=i(s,"P",{"data-svelte-h":!0}),c(N)!=="svelte-pma9sc"&&(N.textContent=at),Ts=l(s),J(B.$$.fragment,s),Js=l(s),y=i(s,"P",{});var v=T(y);Ha=h(v,"The fundamental idea behind NeRFs is to represent a scene as a continuous function that maps a position,"),_s=u(v,!1),Us=h(v,", and a viewing direction, "),js=u(v,!1),zs=h(v,", to a colour"),ks=u(v,!1),Cs=h(v," and volume density"),Is=u(v,!1),Rs=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)`),Zs=u(v,!1),Ws=h(v,"."),v.forEach(t),Fs=l(s),V=i(s,"P",{"data-svelte-h":!0}),c(V)!=="svelte-y9lvf0"&&(V.textContent=tt),Ns=l(s),w=i(s,"DIV",{style:!0,"data-svelte-h":!0}),c(w)!=="svelte-15sfwup"&&(w.innerHTML=nt),Bs=l(s),G=i(s,"P",{"data-svelte-h":!0}),c(G)!=="svelte-1tobfln"&&(G.innerHTML=et),Vs=l(s),H=i(s,"P",{"data-svelte-h":!0}),c(H)!=="svelte-1c917er"&&(H.innerHTML=lt),Gs=l(s),L=i(s,"P",{"data-svelte-h":!0}),c(L)!=="svelte-1oxe61n"&&(L.innerHTML=pt),Hs=l(s),X=i(s,"P",{"data-svelte-h":!0}),c(X)!=="svelte-9jqkju"&&(X.innerHTML=it),Ls=l(s),S=i(s,"P",{"data-svelte-h":!0}),c(S)!=="svelte-105mi7d"&&(S.textContent=mt),Xs=l(s),$=i(s,"P",{"data-svelte-h":!0}),c($)!=="svelte-8gnilz"&&($.innerHTML=rt),Ss=l(s),M=i(s,"P",{});var hs=T(M);La=h(hs,`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 `),ms=i(hs,"STRONG",{"data-svelte-h":!0}),c(ms)!=="svelte-tu9yc4"&&(ms.textContent=ot),Xa=h(hs,` in order to allow for backpropagation. The simplest form of volumetric rendering in NeRFs can be formulated as follows:
`),$s=u(hs,!1),hs.forEach(t),Qs=l(s),m=i(s,"P",{});var g=T(m);Sa=h(g,"In the equation above,"),As=u(g,!1),Es=h(g," is the expected colour of a camera ray"),qs=u(g,!1),Ys=h(g,", where"),Ps=u(g,!1),Ds=h(g," is the origin of the camera,"),Ks=u(g,!1),Os=h(g," is the viewing direction as a 3D unit vector and"),sa=u(g,!1),aa=h(g," is the distance along the ray. "),ta=u(g,!1),na=h(g," and"),ea=u(g,!1),la=h(g," stand for the near and far bounds of the ray, respectively. "),pa=u(g,!1),ia=h(g," denotes the accumulated transmittance along ray"),ma=u(g,!1),ra=h(g," from"),oa=u(g,!1),ca=h(g," to"),ha=u(g,!1),ga=h(g,"."),g.forEach(t),da=l(s),Q=i(s,"P",{});var Ea=T(Q);$a=h(Ea,`After discretization, the equation above can be computed as the following sum:
`),ua=u(Ea,!1),Ea.forEach(t),ya=l(s),A=i(s,"P",{"data-svelte-h":!0}),c(A)!=="svelte-1lchi64"&&(A.textContent=ct),va=l(s),E=i(s,"P",{"data-svelte-h":!0}),c(E)!=="svelte-130vc1o"&&(E.innerHTML=ht),wa=l(s),q=i(s,"P",{"data-svelte-h":!0}),c(q)!=="svelte-1ylz9no"&&(q.innerHTML=gt),ba=l(s),Y=i(s,"P",{});var qa=T(Y);Qa=h(qa,`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:
`),fa=u(qa,!1),qa.forEach(t),Ma=l(s),b=i(s,"P",{});var rs=T(b);Aa=h(rs,",where"),xa=u(rs,!1),Ta=h(rs," is the rendered pixel colour and"),Ja=u(rs,!1),_a=h(rs," is the ground truth pixel colour."),rs.forEach(t),Ua=l(s),P=i(s,"P",{"data-svelte-h":!0}),c(P)!=="svelte-1fogha9"&&(P.innerHTML=dt),ja=l(s),D=i(s,"P",{"data-svelte-h":!0}),c(D)!=="svelte-900j4b"&&(D.textContent=ut),za=l(s),K=i(s,"P",{"data-svelte-h":!0}),c(K)!=="svelte-wakkft"&&(K.textContent=yt),ka=l(s),J(O.$$.fragment,s),Ca=l(s),ss=i(s,"P",{"data-svelte-h":!0}),c(ss)!=="svelte-v8crjg"&&(ss.textContent=vt),Ia=l(s),as=i(s,"P",{"data-svelte-h":!0}),c(as)!=="svelte-q7lmzd"&&(as.innerHTML=wt),Ra=l(s),ts=i(s,"P",{"data-svelte-h":!0}),c(ts)!=="svelte-92cgsm"&&(ts.innerHTML=bt),Za=l(s),J(ns.$$.fragment,s),Wa=l(s),es=i(s,"P",{"data-svelte-h":!0}),c(es)!=="svelte-zhe5l7"&&(es.innerHTML=ft),Fa=l(s),J(ls.$$.fragment,s),Na=l(s),ps=i(s,"P",{"data-svelte-h":!0}),c(ps)!=="svelte-z2v2y8"&&(ps.innerHTML=Mt),Ba=l(s),J(is.$$.fragment,s),Va=l(s),cs=i(s,"P",{}),T(cs).forEach(t),this.h()},h(){xt(f,"name","hf:doc:metadata"),xt(f,"content",sn),_s.a=Us,js.a=zs,ks.a=Cs,Is.a=Rs,Zs.a=Ws,Ya(w,"display","flex"),Ya(w,"flex-direction","column"),Ya(w,"align-items","center"),$s.a=null,As.a=Es,qs.a=Ys,Ps.a=Ds,Ks.a=Os,sa.a=aa,ta.a=na,ea.a=la,pa.a=ia,ma.a=ra,oa.a=ca,ha.a=ga,ua.a=null,fa.a=null,xa.a=Ta,Ja.a=_a},m(s,a){r(document.head,f),n(s,ds,a),n(s,os,a),n(s,us,a),_(k,s,a),n(s,ys,a),_(C,s,a),n(s,vs,a),n(s,I,a),n(s,ws,a),_(R,s,a),n(s,bs,a),n(s,Z,a),n(s,fs,a),n(s,W,a),n(s,Ms,a),n(s,F,a),n(s,xs,a),n(s,N,a),n(s,Ts,a),_(B,s,a),n(s,Js,a),n(s,y,a),r(y,Ha),_s.m(Tt,y),r(y,Us),js.m(Jt,y),r(y,zs),ks.m(_t,y),r(y,Cs),Is.m(Ut,y),r(y,Rs),Zs.m(jt,y),r(y,Ws),n(s,Fs,a),n(s,V,a),n(s,Ns,a),n(s,w,a),n(s,Bs,a),n(s,G,a),n(s,Vs,a),n(s,H,a),n(s,Gs,a),n(s,L,a),n(s,Hs,a),n(s,X,a),n(s,Ls,a),n(s,S,a),n(s,Xs,a),n(s,$,a),n(s,Ss,a),n(s,M,a),r(M,La),r(M,ms),r(M,Xa),$s.m(zt,M),n(s,Qs,a),n(s,m,a),r(m,Sa),As.m(kt,m),r(m,Es),qs.m(Ct,m),r(m,Ys),Ps.m(It,m),r(m,Ds),Ks.m(Rt,m),r(m,Os),sa.m(Zt,m),r(m,aa),ta.m(Wt,m),r(m,na),ea.m(Ft,m),r(m,la),pa.m(Nt,m),r(m,ia),ma.m(Bt,m),r(m,ra),oa.m(Vt,m),r(m,ca),ha.m(Gt,m),r(m,ga),n(s,da,a),n(s,Q,a),r(Q,$a),ua.m(Ht,Q),n(s,ya,a),n(s,A,a),n(s,va,a),n(s,E,a),n(s,wa,a),n(s,q,a),n(s,ba,a),n(s,Y,a),r(Y,Qa),fa.m(Lt,Y),n(s,Ma,a),n(s,b,a),r(b,Aa),xa.m(Xt,b),r(b,Ta),Ja.m(St,b),r(b,_a),n(s,Ua,a),n(s,P,a),n(s,ja,a),n(s,D,a),n(s,za,a),n(s,K,a),n(s,ka,a),_(O,s,a),n(s,Ca,a),n(s,ss,a),n(s,Ia,a),n(s,as,a),n(s,Ra,a),n(s,ts,a),n(s,Za,a),_(ns,s,a),n(s,Wa,a),n(s,es,a),n(s,Fa,a),_(ls,s,a),n(s,Na,a),n(s,ps,a),n(s,Ba,a),_(is,s,a),n(s,Va,a),n(s,cs,a),Ga=!0},p:Qt,i(s){Ga||(U(k.$$.fragment,s),U(C.$$.fragment,s),U(R.$$.fragment,s),U(B.$$.fragment,s),U(O.$$.fragment,s),U(ns.$$.fragment,s),U(ls.$$.fragment,s),U(is.$$.fragment,s),Ga=!0)},o(s){j(k.$$.fragment,s),j(C.$$.fragment,s),j(R.$$.fragment,s),j(B.$$.fragment,s),j(O.$$.fragment,s),j(ns.$$.fragment,s),j(ls.$$.fragment,s),j(is.$$.fragment,s),Ga=!1},d(s){s&&(t(ds),t(os),t(us),t(ys),t(vs),t(I),t(ws),t(bs),t(Z),t(fs),t(W),t(Ms),t(F),t(xs),t(N),t(Ts),t(Js),t(y),t(Fs),t(V),t(Ns),t(w),t(Bs),t(G),t(Vs),t(H),t(Gs),t(L),t(Hs),t(X),t(Ls),t(S),t(Xs),t($),t(Ss),t(M),t(Qs),t(m),t(da),t(Q),t(ya),t(A),t(va),t(E),t(wa),t(q),t(ba),t(Y),t(Ma),t(b),t(Ua),t(P),t(ja),t(D),t(za),t(K),t(ka),t(Ca),t(ss),t(Ia),t(as),t(Ra),t(ts),t(Za),t(Wa),t(es),t(Fa),t(Na),t(ps),t(Ba),t(Va),t(cs)),t(f),z(k,s),z(C,s),z(R,s),z(B,s),z(O,s),z(ns,s),z(ls,s),z(is,s)}}}const sn='{"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 an(Pa){return At(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mn extends Et{constructor(f){super(),qt(this,f,an,Ot,$t,{})}}export{mn as component};
