import{s as Ve,n as Ee,o as Ge}from"../chunks/scheduler.7bc62968.js";import{S as We,i as Xe,g as l,s as a,r as z,A as Oe,h as r,f as i,c as s,j as Ae,u as Z,x as o,k as Ue,y as Be,a as n,v as q,d as D,t as I,w as A}from"../chunks/index.2f8492b0.js";import{H as U}from"../chunks/Heading.14fb2476.js";function Qe(be){let h,G,V,W,f,X,p,ye=`We’ve seen in the NeRF chapter how, given a large set of images, we can generate a three-dimensional representation of an object.
But sometimes we have only a handful of images or even just one.
Novel View Synthesis (NVS) is a collection of methods to generate views from new camera angles that are plausibly consistent with a set of images.
Once we have a large, consistent set of images we can use NeRF or a similar algorithm to construct a 3D representation.`,O,d,$e=`Many methods have recently been developed for this task.
However, they can be divided into two general classes - those that generate an intermediate three-dimensional representation, which is rendered from a new viewing direction, and those that directly produce a new image.`,B,m,Te=`One key difficulty is that this task is almost always underdetermined.
For example, for an image of the back of a sign, there are many possible different things that could be on the front.
Similarly, there could be parts of the object that are occluded, with one part of an object in front of another.
If a model is trained to directly predict (regress) the unseen parts, with a loss penalizing errors in reconstructing held-out views, then by necessity the model will, when it is not clear what should be there, predict a blurry, grey colored region, as noted in <a href="https://jiataogu.me/nerfdiff/" rel="nofollow">NerfDiff</a>.
This has spurred interest in the use of generative, diffusion-based models, which are able to sample from multiple plausible possibilities for the unseen regions.`,Q,u,Pe=`Here we will briefly discuss two approaches, which are representative of the two classes.
<a href="https://alexyu.net/pixelnerf" rel="nofollow">PixelNeRF</a> directly predicts a NeRF for the scene from an input image.
<a href="https://zero123.cs.columbia.edu/" rel="nofollow">Zero123</a> adapts the Stable Diffusion latent diffusion model to directly generate new views without an intermediate 3D representation.`,J,c,K,g,Le=`PixelNeRF is a method that directly generates the parameters of a NeRF from one or more images.
In other words, it conditions the NeRF on the input images.
Unlike the original NeRF, which trains a MLP which takes spatial points to a density and color, PixelNeRF uses spatial features generated from the input images.`,Y,w,He=`<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/PixelNeRF_pipeline.png" alt="PixelNeRF diagram"/>
image from <a href="https://alexyu.net/pixelnerf" rel="nofollow">https://alexyu.net/pixelnerf</a>`,ee,v,Ne=`The method first passes the input images through a convolutional neural network (ResNet34), bilinearly upsampling features from multiple layers to the same resolution as the input images.<br/>
As in a standard NeRF, the new view is generated by volume rendering.
However, the NeRF itself has a slightly unusual structure.
At each query point $x$ in the rendered volume, the corresponding point in the input image(s) is found (by projecting it using the input image camera transformation $\\pi$).
The input image features at this point, $W(\\pi x)$ are then found by bilinear interpolation.
Like in the original NeRF, the query point $x$ is positionally encoded and concatentated with the viewing direction $d$.
The NeRF network consists of a set of ResNet blocks; the input image features $W(\\pi(x))$ pass through a linear layer, and are added to the features at the start of each of the first three residual blocks.
There are then two more residual blocks to further process these features, before an output layer reduces the number of channels to four (RGB+density).
When multiple input views are supplied, these are processed independently for the first three residual blocks, and then the features are averaged before the last two blocks.`,te,x,_e=`The original PixelNeRF model was trained on a relatively small set of renderings from the <a href="https://huggingface.co/datasets/ShapeNet/ShapeNetCore" rel="nofollow">ShapeNet</a> dataset.
The model is trained with either one or two input images, and attempts to predict a single novel view from a new camera angle.
The loss is the mean-squared error between the rendered and expected novel views.
A model was trained separately on each class of object (e.g. planes, benches, cars).`,ie,b,ne,y,Re='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/PixelNeRF_input.png" alt="Input image of a chair"/> <img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/PixelNeRF_output.gif" alt="Rotating gif animation of rendered novel views"/>',ae,$,Me='image from <a href="https://alexyu.net/pixelnerf" rel="nofollow">https://alexyu.net/pixelnerf</a>',se,T,Ce='The PixelNeRF code can be found on <a href="https://github.com/sxyu/pixel-nerf" rel="nofollow">GitHub</a>',le,P,re,L,Fe='In the <a href="https://arxiv.org/pdf/2307.05663.pdf" rel="nofollow">ObjaverseXL</a> paper, PixelNeRF was trained on a <em>much</em> larger dataset <a href="https://huggingface.co/datasets/allenai/objaverse-xl" rel="nofollow">allenai/objaverse-xl</a>.',oe,H,ke=`See also - <a href="https://deepmind.google/discover/blog/neural-scene-representation-and-rendering/" rel="nofollow">Generative Query Networks</a>,
<a href="https://www.vincentsitzmann.com/srns/" rel="nofollow">Scene Representation Networks</a>,
<a href="https://arxiv.org/pdf/2311.04400.pdf" rel="nofollow">LRM</a>`,he,N,fe,_,Se=`Zero123 takes a different approach, being a diffusion model.
Rather than trying to generate a three-dimensional representation, it instead directly predicts the image from the new views.
The model takes a single input image, and the relative viewpoint transformation between the input and novel view direction.
It attempts to generate a plausible, 3D-consistent image from the novel view direction.`,pe,R,je=`Zero123 is built upon the <a href="https://arxiv.org/abs/2112.10752" rel="nofollow">Stable Diffusion</a> architecture, and it was trained by fine-tuning existing weights.<br/>
However, it adds a few new twists.
The model actually starts with the weights from <a href="https://huggingface.co/spaces/lambdalabs/stable-diffusion-image-variations" rel="nofollow">Stable Diffusion Image Variations</a>, which uses the CLIP image embeddings (the final hidden state) of the input image to condition the diffusion U-Net, instead of a text prompt.
However, here these CLIP image embeddings are concatenated with the relative viewpoint transformation between the input and novel views.
(This viewpoint change is represented in terms of spherical polar coordinates.)`,de,M,ze=`<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/Zero123.png" alt="Zero123"/>
image from <a href="https://zero123.cs.columbia.edu" rel="nofollow">https://zero123.cs.columbia.edu</a>`,me,C,Ze=`The rest of the architecture is the same as Stable Diffusion.
However, the latent representation of the input image is concatenated channel-wise with the noisy latents before being input into the denoising U-Net.`,ue,F,qe='To explore this model further, see the <a href="https://huggingface.co/spaces/cvlab/zero123-live" rel="nofollow">Live Demo</a>',ce,k,ge,S,De=`<a href="https://3d-diffusion.github.io/" rel="nofollow">3DiM</a> - X-UNet architecture, with cross-attention between input and noisy frames.
<a href="https://arxiv.org/pdf/2311.13617.pdf" rel="nofollow">Zero123-XL</a> - Trained on the larger objaverseXL dataset. See also <a href="https://huggingface.co/stabilityai/stable-zero123" rel="nofollow">Stable Zero 123</a>`,we,j,Ie='<a href="https://arxiv.org/abs/2310.15110" rel="nofollow">Zero123++</a> - Generates 6 new fixed views, at fixed relative positions to the input view, with reference attention between input and generated images',ve,E,xe;return f=new U({props:{title:"Novel View Synthesis",local:"novel-view-synthesis",headingTag:"h1"}}),c=new U({props:{title:"PixelNeRF",local:"pixelnerf",headingTag:"h2"}}),b=new U({props:{title:"Results (from the PixelNeRF website)",local:"results-from-the-pixelnerf-website",headingTag:"h3"}}),P=new U({props:{title:"Related methods",local:"related-methods",headingTag:"h3"}}),N=new U({props:{title:"Zero123 (or Zero-1-to-3)",local:"zero123-or-zero-1-to-3",headingTag:"h2"}}),k=new U({props:{title:"Related methods",local:"related-methods",headingTag:"h3"}}),{c(){h=l("meta"),G=a(),V=l("p"),W=a(),z(f.$$.fragment),X=a(),p=l("p"),p.textContent=ye,O=a(),d=l("p"),d.textContent=$e,B=a(),m=l("p"),m.innerHTML=Te,Q=a(),u=l("p"),u.innerHTML=Pe,J=a(),z(c.$$.fragment),K=a(),g=l("p"),g.textContent=Le,Y=a(),w=l("p"),w.innerHTML=He,ee=a(),v=l("p"),v.innerHTML=Ne,te=a(),x=l("p"),x.innerHTML=_e,ie=a(),z(b.$$.fragment),ne=a(),y=l("p"),y.innerHTML=Re,ae=a(),$=l("p"),$.innerHTML=Me,se=a(),T=l("p"),T.innerHTML=Ce,le=a(),z(P.$$.fragment),re=a(),L=l("p"),L.innerHTML=Fe,oe=a(),H=l("p"),H.innerHTML=ke,he=a(),z(N.$$.fragment),fe=a(),_=l("p"),_.textContent=Se,pe=a(),R=l("p"),R.innerHTML=je,de=a(),M=l("p"),M.innerHTML=ze,me=a(),C=l("p"),C.textContent=Ze,ue=a(),F=l("p"),F.innerHTML=qe,ce=a(),z(k.$$.fragment),ge=a(),S=l("p"),S.innerHTML=De,we=a(),j=l("p"),j.innerHTML=Ie,ve=a(),E=l("p"),this.h()},l(e){const t=Oe("svelte-u9bgzb",document.head);h=r(t,"META",{name:!0,content:!0}),t.forEach(i),G=s(e),V=r(e,"P",{}),Ae(V).forEach(i),W=s(e),Z(f.$$.fragment,e),X=s(e),p=r(e,"P",{"data-svelte-h":!0}),o(p)!=="svelte-md009s"&&(p.textContent=ye),O=s(e),d=r(e,"P",{"data-svelte-h":!0}),o(d)!=="svelte-ip51yg"&&(d.textContent=$e),B=s(e),m=r(e,"P",{"data-svelte-h":!0}),o(m)!=="svelte-1qxehg6"&&(m.innerHTML=Te),Q=s(e),u=r(e,"P",{"data-svelte-h":!0}),o(u)!=="svelte-zc8dx0"&&(u.innerHTML=Pe),J=s(e),Z(c.$$.fragment,e),K=s(e),g=r(e,"P",{"data-svelte-h":!0}),o(g)!=="svelte-ujrcl0"&&(g.textContent=Le),Y=s(e),w=r(e,"P",{"data-svelte-h":!0}),o(w)!=="svelte-1a5qqgg"&&(w.innerHTML=He),ee=s(e),v=r(e,"P",{"data-svelte-h":!0}),o(v)!=="svelte-p566d"&&(v.innerHTML=Ne),te=s(e),x=r(e,"P",{"data-svelte-h":!0}),o(x)!=="svelte-18yx0n5"&&(x.innerHTML=_e),ie=s(e),Z(b.$$.fragment,e),ne=s(e),y=r(e,"P",{"data-svelte-h":!0}),o(y)!=="svelte-kuwwii"&&(y.innerHTML=Re),ae=s(e),$=r(e,"P",{"data-svelte-h":!0}),o($)!=="svelte-1fd4odk"&&($.innerHTML=Me),se=s(e),T=r(e,"P",{"data-svelte-h":!0}),o(T)!=="svelte-zil5op"&&(T.innerHTML=Ce),le=s(e),Z(P.$$.fragment,e),re=s(e),L=r(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-jcdds8"&&(L.innerHTML=Fe),oe=s(e),H=r(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-ien78q"&&(H.innerHTML=ke),he=s(e),Z(N.$$.fragment,e),fe=s(e),_=r(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-177283l"&&(_.textContent=Se),pe=s(e),R=r(e,"P",{"data-svelte-h":!0}),o(R)!=="svelte-2ht5cx"&&(R.innerHTML=je),de=s(e),M=r(e,"P",{"data-svelte-h":!0}),o(M)!=="svelte-1t7mcg"&&(M.innerHTML=ze),me=s(e),C=r(e,"P",{"data-svelte-h":!0}),o(C)!=="svelte-5qhqp7"&&(C.textContent=Ze),ue=s(e),F=r(e,"P",{"data-svelte-h":!0}),o(F)!=="svelte-ggnn2t"&&(F.innerHTML=qe),ce=s(e),Z(k.$$.fragment,e),ge=s(e),S=r(e,"P",{"data-svelte-h":!0}),o(S)!=="svelte-117i4gt"&&(S.innerHTML=De),we=s(e),j=r(e,"P",{"data-svelte-h":!0}),o(j)!=="svelte-1yfjeya"&&(j.innerHTML=Ie),ve=s(e),E=r(e,"P",{}),Ae(E).forEach(i),this.h()},h(){Ue(h,"name","hf:doc:metadata"),Ue(h,"content",Je)},m(e,t){Be(document.head,h),n(e,G,t),n(e,V,t),n(e,W,t),q(f,e,t),n(e,X,t),n(e,p,t),n(e,O,t),n(e,d,t),n(e,B,t),n(e,m,t),n(e,Q,t),n(e,u,t),n(e,J,t),q(c,e,t),n(e,K,t),n(e,g,t),n(e,Y,t),n(e,w,t),n(e,ee,t),n(e,v,t),n(e,te,t),n(e,x,t),n(e,ie,t),q(b,e,t),n(e,ne,t),n(e,y,t),n(e,ae,t),n(e,$,t),n(e,se,t),n(e,T,t),n(e,le,t),q(P,e,t),n(e,re,t),n(e,L,t),n(e,oe,t),n(e,H,t),n(e,he,t),q(N,e,t),n(e,fe,t),n(e,_,t),n(e,pe,t),n(e,R,t),n(e,de,t),n(e,M,t),n(e,me,t),n(e,C,t),n(e,ue,t),n(e,F,t),n(e,ce,t),q(k,e,t),n(e,ge,t),n(e,S,t),n(e,we,t),n(e,j,t),n(e,ve,t),n(e,E,t),xe=!0},p:Ee,i(e){xe||(D(f.$$.fragment,e),D(c.$$.fragment,e),D(b.$$.fragment,e),D(P.$$.fragment,e),D(N.$$.fragment,e),D(k.$$.fragment,e),xe=!0)},o(e){I(f.$$.fragment,e),I(c.$$.fragment,e),I(b.$$.fragment,e),I(P.$$.fragment,e),I(N.$$.fragment,e),I(k.$$.fragment,e),xe=!1},d(e){e&&(i(G),i(V),i(W),i(X),i(p),i(O),i(d),i(B),i(m),i(Q),i(u),i(J),i(K),i(g),i(Y),i(w),i(ee),i(v),i(te),i(x),i(ie),i(ne),i(y),i(ae),i($),i(se),i(T),i(le),i(re),i(L),i(oe),i(H),i(he),i(fe),i(_),i(pe),i(R),i(de),i(M),i(me),i(C),i(ue),i(F),i(ce),i(ge),i(S),i(we),i(j),i(ve),i(E)),i(h),A(f,e),A(c,e),A(b,e),A(P,e),A(N,e),A(k,e)}}}const Je='{"title":"Novel View Synthesis","local":"novel-view-synthesis","sections":[{"title":"PixelNeRF","local":"pixelnerf","sections":[{"title":"Results (from the PixelNeRF website)","local":"results-from-the-pixelnerf-website","sections":[],"depth":3},{"title":"Related methods","local":"related-methods","sections":[],"depth":3}],"depth":2},{"title":"Zero123 (or Zero-1-to-3)","local":"zero123-or-zero-1-to-3","sections":[{"title":"Related methods","local":"related-methods","sections":[],"depth":3}],"depth":2}],"depth":1}';function Ke(be){return Ge(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class it extends We{constructor(h){super(),Xe(this,h,Ke,Qe,Ve,{})}}export{it as component};
