import{S as ys,i as Rs,s as Ms,e as n,k as p,w as v,t as i,M as Ts,c as s,d as t,m as h,a as r,x as b,h as l,b as c,N as $s,G as o,g as u,y,q as R,o as M,B as T,v as js,L as En}from"../../chunks/vendor-hf-doc-builder.js";import{T as bs}from"../../chunks/Tip-hf-doc-builder.js";import{D as ze}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Un}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Be}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Cn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Is(I){let m,S,w,f,_;return f=new Un({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFN3aW4yU1JDb25maWclMkMlMjBTd2luMlNSTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwU3dpbjJTUiUyMGNhaWRhcyUyRnN3aW4yc3ItY2xhc3NpY2Fsc3IteDItNjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU3dpbjJTUkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjYWlkYXMlMkZzd2luMnNyLWNsYXNzaWNhbHNyLXgyLTY0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTd2luMlNSTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Swin2SRConfig, Swin2SRModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Swin2SR caidas/swin2sr-classicalsr-x2-64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Swin2SRConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the caidas/swin2sr-classicalsr-x2-64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swin2SRModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){m=n("p"),S=i("Example:"),w=p(),v(f.$$.fragment)},l(a){m=s(a,"P",{});var g=r(m);S=l(g,"Example:"),g.forEach(t),w=h(a),b(f.$$.fragment,a)},m(a,g){u(a,m,g),o(m,S),u(a,w,g),y(f,a,g),_=!0},p:En,i(a){_||(R(f.$$.fragment,a),_=!0)},o(a){M(f.$$.fragment,a),_=!1},d(a){a&&t(m),a&&t(w),T(f,a)}}}function Cs(I){let m,S,w,f,_;return{c(){m=n("p"),S=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),w=n("code"),f=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){m=s(a,"P",{});var g=r(m);S=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),w=s(g,"CODE",{});var x=r(w);f=l(x,"Module"),x.forEach(t),_=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(a,g){u(a,m,g),o(m,S),o(m,w),o(w,f),o(m,_)},d(a){a&&t(m)}}}function Es(I){let m,S,w,f,_;return f=new Un({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFN3aW4yU1JNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyY2FpZGFzJTJGc3dpbjJTUi1jbGFzc2ljYWwtc3IteDItNjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTd2luMlNSTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmNhaWRhcyUyRnN3aW4yU1ItY2xhc3NpY2FsLXNyLXgyLTY0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swin2SRModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;caidas/swin2SR-classical-sr-x2-64&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swin2SRModel.from_pretrained(<span class="hljs-string">&quot;caidas/swin2SR-classical-sr-x2-64&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">180</span>, <span class="hljs-number">488</span>, <span class="hljs-number">648</span>]`}}),{c(){m=n("p"),S=i("Example:"),w=p(),v(f.$$.fragment)},l(a){m=s(a,"P",{});var g=r(m);S=l(g,"Example:"),g.forEach(t),w=h(a),b(f.$$.fragment,a)},m(a,g){u(a,m,g),o(m,S),u(a,w,g),y(f,a,g),_=!0},p:En,i(a){_||(R(f.$$.fragment,a),_=!0)},o(a){M(f.$$.fragment,a),_=!1},d(a){a&&t(m),a&&t(w),T(f,a)}}}function Us(I){let m,S,w,f,_;return{c(){m=n("p"),S=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),w=n("code"),f=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){m=s(a,"P",{});var g=r(m);S=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),w=s(g,"CODE",{});var x=r(w);f=l(x,"Module"),x.forEach(t),_=l(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(a,g){u(a,m,g),o(m,S),o(m,w),o(w,f),o(m,_)},d(a){a&&t(m)}}}function xs(I){let m,S,w,f,_;return f=new Un({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMjBTd2luMlNSRm9ySW1hZ2VTdXBlclJlc29sdXRpb24lMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmNhaWRhcyUyRnN3aW4yU1ItY2xhc3NpY2FsLXNyLXgyLTY0JTIyKSUwQW1vZGVsJTIwJTNEJTIwU3dpbjJTUkZvckltYWdlU3VwZXJSZXNvbHV0aW9uLmZyb21fcHJldHJhaW5lZCglMjJjYWlkYXMlMkZzd2luMlNSLWNsYXNzaWNhbC1zci14Mi02NCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3BhY2VzJTJGampvdXJuZXkxMTI1JTJGc3dpbjJzciUyRnJlc29sdmUlMkZtYWluJTJGc2FtcGxlcyUyRmJ1dHRlcmZseS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMjMlMjBwcmVwYXJlJTIwaW1hZ2UlMjBmb3IlMjB0aGUlMjBtb2RlbCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwZm9yd2FyZCUyMHBhc3MlMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQW91dHB1dCUyMCUzRCUyMG91dHB1dHMucmVjb25zdHJ1Y3Rpb24uZGF0YS5zcXVlZXplKCkuZmxvYXQoKS5jcHUoKS5jbGFtcF8oMCUyQyUyMDEpLm51bXB5KCklMEFvdXRwdXQlMjAlM0QlMjBucC5tb3ZlYXhpcyhvdXRwdXQlMkMlMjBzb3VyY2UlM0QwJTJDJTIwZGVzdGluYXRpb24lM0QtMSklMEFvdXRwdXQlMjAlM0QlMjAob3V0cHV0JTIwKiUyMDI1NS4wKS5yb3VuZCgpLmFzdHlwZShucC51aW50OCklMjAlMjAlMjMlMjBmbG9hdDMyJTIwdG8lMjB1aW50OCUwQSUyMyUyMHlvdSUyMGNhbiUyMHZpc3VhbGl6ZSUyMCU2MG91dHB1dCU2MCUyMHdpdGglMjAlNjBJbWFnZS5mcm9tYXJyYXklNjA=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Swin2SRForImageSuperResolution

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;caidas/swin2SR-classical-sr-x2-64&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Swin2SRForImageSuperResolution.from_pretrained(<span class="hljs-string">&quot;caidas/swin2SR-classical-sr-x2-64&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://huggingface.co/spaces/jjourney1125/swin2sr/resolve/main/samples/butterfly.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = outputs.reconstruction.data.squeeze().<span class="hljs-built_in">float</span>().cpu().clamp_(<span class="hljs-number">0</span>, <span class="hljs-number">1</span>).numpy()
<span class="hljs-meta">&gt;&gt;&gt; </span>output = np.moveaxis(output, source=<span class="hljs-number">0</span>, destination=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output = (output * <span class="hljs-number">255.0</span>).<span class="hljs-built_in">round</span>().astype(np.uint8)  <span class="hljs-comment"># float32 to uint8</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># you can visualize \`output\` with \`Image.fromarray\`</span>`}}),{c(){m=n("p"),S=i("Example:"),w=p(),v(f.$$.fragment)},l(a){m=s(a,"P",{});var g=r(m);S=l(g,"Example:"),g.forEach(t),w=h(a),b(f.$$.fragment,a)},m(a,g){u(a,m,g),o(m,S),u(a,w,g),y(f,a,g),_=!0},p:En,i(a){_||(R(f.$$.fragment,a),_=!0)},o(a){M(f.$$.fragment,a),_=!1},d(a){a&&t(m),a&&t(w),T(f,a)}}}function ks(I){let m,S,w,f,_,a,g,x,et,To,N,V,no,pe,ot,so,tt,$o,C,nt,he,st,rt,ue,at,it,Ze,lt,ct,jo,Ae,dt,Io,qe,ro,mt,Co,Y,xn,Eo,fe,pt,Ge,ht,Uo,F,ut,ge,ft,gt,we,wt,_t,xo,W,H,ao,_e,St,io,vt,ko,Q,bt,Se,yt,Rt,Jo,D,Mt,ve,Tt,$t,Fo,P,L,lo,be,jt,co,It,No,k,ye,Ct,mo,Et,Ut,O,Re,xt,po,kt,Wo,z,K,ho,Me,Jt,uo,Ft,Po,$,Te,Nt,B,Wt,Xe,Pt,zt,$e,Bt,Zt,At,Z,qt,Ve,Gt,Xt,Ye,Vt,Yt,Ht,ee,zo,A,oe,fo,je,Qt,go,Dt,Bo,J,Ie,Lt,Ce,Ot,Ee,Kt,en,on,E,Ue,tn,q,nn,He,sn,rn,wo,an,ln,cn,te,dn,ne,Zo,G,se,_o,xe,mn,So,pn,Ao,j,ke,hn,vo,un,fn,Je,gn,Fe,wn,_n,Sn,U,Ne,vn,X,bn,Qe,yn,Rn,bo,Mn,Tn,$n,re,jn,ae,qo;return a=new Be({}),pe=new Be({}),_e=new Be({}),be=new Be({}),ye=new ze({props:{name:"class transformers.Swin2SRImageProcessor",anchor:"transformers.Swin2SRImageProcessor",parameters:[{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_pad",val:": bool = True"},{name:"pad_size",val:": int = 8"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Swin2SRImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.Swin2SRImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/image_processing_swin2sr.py#L38"}}),Re=new ze({props:{name:"preprocess",anchor:"transformers.Swin2SRImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"pad_size",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Swin2SRImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to pad the image to make the height and width divisible by <code>window_size</code>.`,name:"do_pad"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.pad_size",description:`<strong>pad_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size of the sliding window for the local attention.`,name:"pad_size"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of typ, input_data_format=input_data_formate
<code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.Swin2SRImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/image_processing_swin2sr.py#L109"}}),Me=new Be({}),Te=new ze({props:{name:"class transformers.Swin2SRConfig",anchor:"transformers.Swin2SRConfig",parameters:[{name:"image_size",val:" = 64"},{name:"patch_size",val:" = 1"},{name:"num_channels",val:" = 3"},{name:"embed_dim",val:" = 180"},{name:"depths",val:" = [6, 6, 6, 6, 6, 6]"},{name:"num_heads",val:" = [6, 6, 6, 6, 6, 6]"},{name:"window_size",val:" = 8"},{name:"mlp_ratio",val:" = 2.0"},{name:"qkv_bias",val:" = True"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.1"},{name:"hidden_act",val:" = 'gelu'"},{name:"use_absolute_embeddings",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"upscale",val:" = 2"},{name:"img_range",val:" = 1.0"},{name:"resi_connection",val:" = '1conv'"},{name:"upsampler",val:" = 'pixelshuffle'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Swin2SRConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Swin2SRConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Swin2SRConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.Swin2SRConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 180) &#x2014;
Dimensionality of patch embedding.`,name:"embed_dim"},{anchor:"transformers.Swin2SRConfig.depths",description:`<strong>depths</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[6, 6, 6, 6, 6, 6]</code>) &#x2014;
Depth of each layer in the Transformer encoder.`,name:"depths"},{anchor:"transformers.Swin2SRConfig.num_heads",description:`<strong>num_heads</strong> (<code>list(int)</code>, <em>optional</em>, defaults to <code>[6, 6, 6, 6, 6, 6]</code>) &#x2014;
Number of attention heads in each layer of the Transformer encoder.`,name:"num_heads"},{anchor:"transformers.Swin2SRConfig.window_size",description:`<strong>window_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Size of windows.`,name:"window_size"},{anchor:"transformers.Swin2SRConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Ratio of MLP hidden dimensionality to embedding dimensionality.`,name:"mlp_ratio"},{anchor:"transformers.Swin2SRConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not a learnable bias should be added to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.Swin2SRConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.Swin2SRConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.Swin2SRConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Stochastic depth rate.`,name:"drop_path_rate"},{anchor:"transformers.Swin2SRConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Swin2SRConfig.use_absolute_embeddings",description:`<strong>use_absolute_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add absolute position embeddings to the patch embeddings.`,name:"use_absolute_embeddings"},{anchor:"transformers.Swin2SRConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Swin2SRConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Swin2SRConfig.upscale",description:`<strong>upscale</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The upscale factor for the image. 2/3/4/8 for image super resolution, 1 for denoising and compress artifact
reduction`,name:"upscale"},{anchor:"transformers.Swin2SRConfig.img_range",description:`<strong>img_range</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
The range of the values of the input image.`,name:"img_range"},{anchor:"transformers.Swin2SRConfig.resi_connection",description:`<strong>resi_connection</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;1conv&quot;</code>) &#x2014;
The convolutional block to use before the residual connection in each stage.`,name:"resi_connection"},{anchor:"transformers.Swin2SRConfig.upsampler",description:`<strong>upsampler</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pixelshuffle&quot;</code>) &#x2014;
The reconstruction reconstruction module. Can be &#x2018;pixelshuffle&#x2019;/&#x2018;pixelshuffledirect&#x2019;/&#x2018;nearest+conv&#x2019;/None.`,name:"upsampler"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/configuration_swin2sr.py#L30"}}),ee=new Cn({props:{anchor:"transformers.Swin2SRConfig.example",$$slots:{default:[Is]},$$scope:{ctx:I}}}),je=new Be({}),Ie=new ze({props:{name:"class transformers.Swin2SRModel",anchor:"transformers.Swin2SRModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swin2SRModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRConfig">Swin2SRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/modeling_swin2sr.py#L847"}}),Ue=new ze({props:{name:"forward",anchor:"transformers.Swin2SRModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Swin2SRModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">Swin2SRImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.Swin2SRModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Swin2SRModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Swin2SRModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Swin2SRModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/modeling_swin2sr.py#L896",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRConfig"
>Swin2SRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new bs({props:{$$slots:{default:[Cs]},$$scope:{ctx:I}}}),ne=new Cn({props:{anchor:"transformers.Swin2SRModel.forward.example",$$slots:{default:[Es]},$$scope:{ctx:I}}}),xe=new Be({}),ke=new ze({props:{name:"class transformers.Swin2SRForImageSuperResolution",anchor:"transformers.Swin2SRForImageSuperResolution",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Swin2SRForImageSuperResolution.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRConfig">Swin2SRConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/modeling_swin2sr.py#L1101"}}),Ne=new ze({props:{name:"forward",anchor:"transformers.Swin2SRForImageSuperResolution.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Swin2SRForImageSuperResolution.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">Swin2SRImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.Swin2SRForImageSuperResolution.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.Swin2SRForImageSuperResolution.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Swin2SRForImageSuperResolution.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.Swin2SRForImageSuperResolution.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/swin2sr/modeling_swin2sr.py#L1128",returnDescription:`
<p>A <code>transformers.modeling_outputs.ImageSuperResolutionOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRConfig"
>Swin2SRConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Reconstruction loss.</p>
</li>
<li>
<p><strong>reconstruction</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Reconstructed images, possibly upscaled.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.ImageSuperResolutionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new bs({props:{$$slots:{default:[Us]},$$scope:{ctx:I}}}),ae=new Cn({props:{anchor:"transformers.Swin2SRForImageSuperResolution.forward.example",$$slots:{default:[xs]},$$scope:{ctx:I}}}),{c(){m=n("meta"),S=p(),w=n("h1"),f=n("a"),_=n("span"),v(a.$$.fragment),g=p(),x=n("span"),et=i("Swin2SR"),To=p(),N=n("h2"),V=n("a"),no=n("span"),v(pe.$$.fragment),ot=p(),so=n("span"),tt=i("Overview"),$o=p(),C=n("p"),nt=i("The Swin2SR model was proposed in "),he=n("a"),st=i("Swin2SR: SwinV2 Transformer for Compressed Image Super-Resolution and Restoration"),rt=i(` by Marcos V. Conde, Ui-Jin Choi, Maxime Burchi, Radu Timofte.
Swin2R improves the `),ue=n("a"),at=i("SwinIR"),it=i(" model by incorporating "),Ze=n("a"),lt=i("Swin Transformer v2"),ct=i(` layers which mitigates issues such as training instability, resolution gaps between pre-training
and fine-tuning, and hunger on data.`),jo=p(),Ae=n("p"),dt=i("The abstract from the paper is the following:"),Io=p(),qe=n("p"),ro=n("em"),mt=i(`Compression plays an important role on the efficient transmission and storage of images and videos through band-limited systems such as streaming services, virtual reality or videogames. However, compression unavoidably leads to artifacts and the loss of the original information, which may severely degrade the visual quality. For these reasons, quality enhancement of compressed images has become a popular research topic. While most state-of-the-art image restoration methods are based on convolutional neural networks, other transformers-based methods such as SwinIR, show impressive performance on these tasks.
In this paper, we explore the novel Swin Transformer V2, to improve SwinIR for image super-resolution, and in particular, the compressed input scenario. Using this method we can tackle the major issues in training transformer vision models, such as training instability, resolution gaps between pre-training and fine-tuning, and hunger on data. We conduct experiments on three representative tasks: JPEG compression artifacts removal, image super-resolution (classical and lightweight), and compressed image super-resolution. Experimental results demonstrate that our method, Swin2SR, can improve the training convergence and performance of SwinIR, and is a top-5 solution at the \u201CAIM 2022 Challenge on Super-Resolution of Compressed Image and Video\u201D.`),Co=p(),Y=n("img"),Eo=p(),fe=n("small"),pt=i("Swin2SR architecture. Taken from the "),Ge=n("a"),ht=i("original paper."),Uo=p(),F=n("p"),ut=i("This model was contributed by "),ge=n("a"),ft=i("nielsr"),gt=i(`.
The original code can be found `),we=n("a"),wt=i("here"),_t=i("."),xo=p(),W=n("h2"),H=n("a"),ao=n("span"),v(_e.$$.fragment),St=p(),io=n("span"),vt=i("Resources"),ko=p(),Q=n("p"),bt=i("Demo notebooks for Swin2SR can be found "),Se=n("a"),yt=i("here"),Rt=i("."),Jo=p(),D=n("p"),Mt=i("A demo Space for image super-resolution with SwinSR can be found "),ve=n("a"),Tt=i("here"),$t=i("."),Fo=p(),P=n("h2"),L=n("a"),lo=n("span"),v(be.$$.fragment),jt=p(),co=n("span"),It=i("Swin2SRImageProcessor"),No=p(),k=n("div"),v(ye.$$.fragment),Ct=p(),mo=n("p"),Et=i("Constructs a Swin2SR image processor."),Ut=p(),O=n("div"),v(Re.$$.fragment),xt=p(),po=n("p"),kt=i("Preprocess an image or batch of images."),Wo=p(),z=n("h2"),K=n("a"),ho=n("span"),v(Me.$$.fragment),Jt=p(),uo=n("span"),Ft=i("Swin2SRConfig"),Po=p(),$=n("div"),v(Te.$$.fragment),Nt=p(),B=n("p"),Wt=i("This is the configuration class to store the configuration of a "),Xe=n("a"),Pt=i("Swin2SRModel"),zt=i(`. It is used to instantiate a Swin
Transformer v2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Swin Transformer v2
`),$e=n("a"),Bt=i("caidas/swin2sr-classicalsr-x2-64"),Zt=i(" architecture."),At=p(),Z=n("p"),qt=i("Configuration objects inherit from "),Ve=n("a"),Gt=i("PretrainedConfig"),Xt=i(` and can be used to control the model outputs. Read the
documentation from `),Ye=n("a"),Vt=i("PretrainedConfig"),Yt=i(" for more information."),Ht=p(),v(ee.$$.fragment),zo=p(),A=n("h2"),oe=n("a"),fo=n("span"),v(je.$$.fragment),Qt=p(),go=n("span"),Dt=i("Swin2SRModel"),Bo=p(),J=n("div"),v(Ie.$$.fragment),Lt=p(),Ce=n("p"),Ot=i(`The bare Swin2SR Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ee=n("a"),Kt=i("torch.nn.Module"),en=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),on=p(),E=n("div"),v(Ue.$$.fragment),tn=p(),q=n("p"),nn=i("The "),He=n("a"),sn=i("Swin2SRModel"),rn=i(" forward method, overrides the "),wo=n("code"),an=i("__call__"),ln=i(" special method."),cn=p(),v(te.$$.fragment),dn=p(),v(ne.$$.fragment),Zo=p(),G=n("h2"),se=n("a"),_o=n("span"),v(xe.$$.fragment),mn=p(),So=n("span"),pn=i("Swin2SRForImageSuperResolution"),Ao=p(),j=n("div"),v(ke.$$.fragment),hn=p(),vo=n("p"),un=i("Swin2SR Model transformer with an upsampler head on top for image super resolution and restoration."),fn=p(),Je=n("p"),gn=i("This model is a PyTorch "),Fe=n("a"),wn=i("torch.nn.Module"),_n=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Sn=p(),U=n("div"),v(Ne.$$.fragment),vn=p(),X=n("p"),bn=i("The "),Qe=n("a"),yn=i("Swin2SRForImageSuperResolution"),Rn=i(" forward method, overrides the "),bo=n("code"),Mn=i("__call__"),Tn=i(" special method."),$n=p(),v(re.$$.fragment),jn=p(),v(ae.$$.fragment),this.h()},l(e){const d=Ts('[data-svelte="svelte-1phssyn"]',document.head);m=s(d,"META",{name:!0,content:!0}),d.forEach(t),S=h(e),w=s(e,"H1",{class:!0});var We=r(w);f=s(We,"A",{id:!0,class:!0,href:!0});var yo=r(f);_=s(yo,"SPAN",{});var Ro=r(_);b(a.$$.fragment,Ro),Ro.forEach(t),yo.forEach(t),g=h(We),x=s(We,"SPAN",{});var Mo=r(x);et=l(Mo,"Swin2SR"),Mo.forEach(t),We.forEach(t),To=h(e),N=s(e,"H2",{class:!0});var Pe=r(N);V=s(Pe,"A",{id:!0,class:!0,href:!0});var kn=r(V);no=s(kn,"SPAN",{});var Jn=r(no);b(pe.$$.fragment,Jn),Jn.forEach(t),kn.forEach(t),ot=h(Pe),so=s(Pe,"SPAN",{});var Fn=r(so);tt=l(Fn,"Overview"),Fn.forEach(t),Pe.forEach(t),$o=h(e),C=s(e,"P",{});var ie=r(C);nt=l(ie,"The Swin2SR model was proposed in "),he=s(ie,"A",{href:!0,rel:!0});var Nn=r(he);st=l(Nn,"Swin2SR: SwinV2 Transformer for Compressed Image Super-Resolution and Restoration"),Nn.forEach(t),rt=l(ie,` by Marcos V. Conde, Ui-Jin Choi, Maxime Burchi, Radu Timofte.
Swin2R improves the `),ue=s(ie,"A",{href:!0,rel:!0});var Wn=r(ue);at=l(Wn,"SwinIR"),Wn.forEach(t),it=l(ie," model by incorporating "),Ze=s(ie,"A",{href:!0});var Pn=r(Ze);lt=l(Pn,"Swin Transformer v2"),Pn.forEach(t),ct=l(ie,` layers which mitigates issues such as training instability, resolution gaps between pre-training
and fine-tuning, and hunger on data.`),ie.forEach(t),jo=h(e),Ae=s(e,"P",{});var zn=r(Ae);dt=l(zn,"The abstract from the paper is the following:"),zn.forEach(t),Io=h(e),qe=s(e,"P",{});var Bn=r(qe);ro=s(Bn,"EM",{});var Zn=r(ro);mt=l(Zn,`Compression plays an important role on the efficient transmission and storage of images and videos through band-limited systems such as streaming services, virtual reality or videogames. However, compression unavoidably leads to artifacts and the loss of the original information, which may severely degrade the visual quality. For these reasons, quality enhancement of compressed images has become a popular research topic. While most state-of-the-art image restoration methods are based on convolutional neural networks, other transformers-based methods such as SwinIR, show impressive performance on these tasks.
In this paper, we explore the novel Swin Transformer V2, to improve SwinIR for image super-resolution, and in particular, the compressed input scenario. Using this method we can tackle the major issues in training transformer vision models, such as training instability, resolution gaps between pre-training and fine-tuning, and hunger on data. We conduct experiments on three representative tasks: JPEG compression artifacts removal, image super-resolution (classical and lightweight), and compressed image super-resolution. Experimental results demonstrate that our method, Swin2SR, can improve the training convergence and performance of SwinIR, and is a top-5 solution at the \u201CAIM 2022 Challenge on Super-Resolution of Compressed Image and Video\u201D.`),Zn.forEach(t),Bn.forEach(t),Co=h(e),Y=s(e,"IMG",{src:!0,alt:!0,width:!0}),Eo=h(e),fe=s(e,"SMALL",{});var In=r(fe);pt=l(In,"Swin2SR architecture. Taken from the "),Ge=s(In,"A",{href:!0});var An=r(Ge);ht=l(An,"original paper."),An.forEach(t),In.forEach(t),Uo=h(e),F=s(e,"P",{});var De=r(F);ut=l(De,"This model was contributed by "),ge=s(De,"A",{href:!0,rel:!0});var qn=r(ge);ft=l(qn,"nielsr"),qn.forEach(t),gt=l(De,`.
The original code can be found `),we=s(De,"A",{href:!0,rel:!0});var Gn=r(we);wt=l(Gn,"here"),Gn.forEach(t),_t=l(De,"."),De.forEach(t),xo=h(e),W=s(e,"H2",{class:!0});var Go=r(W);H=s(Go,"A",{id:!0,class:!0,href:!0});var Xn=r(H);ao=s(Xn,"SPAN",{});var Vn=r(ao);b(_e.$$.fragment,Vn),Vn.forEach(t),Xn.forEach(t),St=h(Go),io=s(Go,"SPAN",{});var Yn=r(io);vt=l(Yn,"Resources"),Yn.forEach(t),Go.forEach(t),ko=h(e),Q=s(e,"P",{});var Xo=r(Q);bt=l(Xo,"Demo notebooks for Swin2SR can be found "),Se=s(Xo,"A",{href:!0,rel:!0});var Hn=r(Se);yt=l(Hn,"here"),Hn.forEach(t),Rt=l(Xo,"."),Xo.forEach(t),Jo=h(e),D=s(e,"P",{});var Vo=r(D);Mt=l(Vo,"A demo Space for image super-resolution with SwinSR can be found "),ve=s(Vo,"A",{href:!0,rel:!0});var Qn=r(ve);Tt=l(Qn,"here"),Qn.forEach(t),$t=l(Vo,"."),Vo.forEach(t),Fo=h(e),P=s(e,"H2",{class:!0});var Yo=r(P);L=s(Yo,"A",{id:!0,class:!0,href:!0});var Dn=r(L);lo=s(Dn,"SPAN",{});var Ln=r(lo);b(be.$$.fragment,Ln),Ln.forEach(t),Dn.forEach(t),jt=h(Yo),co=s(Yo,"SPAN",{});var On=r(co);It=l(On,"Swin2SRImageProcessor"),On.forEach(t),Yo.forEach(t),No=h(e),k=s(e,"DIV",{class:!0});var Le=r(k);b(ye.$$.fragment,Le),Ct=h(Le),mo=s(Le,"P",{});var Kn=r(mo);Et=l(Kn,"Constructs a Swin2SR image processor."),Kn.forEach(t),Ut=h(Le),O=s(Le,"DIV",{class:!0});var Ho=r(O);b(Re.$$.fragment,Ho),xt=h(Ho),po=s(Ho,"P",{});var es=r(po);kt=l(es,"Preprocess an image or batch of images."),es.forEach(t),Ho.forEach(t),Le.forEach(t),Wo=h(e),z=s(e,"H2",{class:!0});var Qo=r(z);K=s(Qo,"A",{id:!0,class:!0,href:!0});var os=r(K);ho=s(os,"SPAN",{});var ts=r(ho);b(Me.$$.fragment,ts),ts.forEach(t),os.forEach(t),Jt=h(Qo),uo=s(Qo,"SPAN",{});var ns=r(uo);Ft=l(ns,"Swin2SRConfig"),ns.forEach(t),Qo.forEach(t),Po=h(e),$=s(e,"DIV",{class:!0});var le=r($);b(Te.$$.fragment,le),Nt=h(le),B=s(le,"P",{});var Oe=r(B);Wt=l(Oe,"This is the configuration class to store the configuration of a "),Xe=s(Oe,"A",{href:!0});var ss=r(Xe);Pt=l(ss,"Swin2SRModel"),ss.forEach(t),zt=l(Oe,`. It is used to instantiate a Swin
Transformer v2 model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Swin Transformer v2
`),$e=s(Oe,"A",{href:!0,rel:!0});var rs=r($e);Bt=l(rs,"caidas/swin2sr-classicalsr-x2-64"),rs.forEach(t),Zt=l(Oe," architecture."),Oe.forEach(t),At=h(le),Z=s(le,"P",{});var Ke=r(Z);qt=l(Ke,"Configuration objects inherit from "),Ve=s(Ke,"A",{href:!0});var as=r(Ve);Gt=l(as,"PretrainedConfig"),as.forEach(t),Xt=l(Ke,` and can be used to control the model outputs. Read the
documentation from `),Ye=s(Ke,"A",{href:!0});var is=r(Ye);Vt=l(is,"PretrainedConfig"),is.forEach(t),Yt=l(Ke," for more information."),Ke.forEach(t),Ht=h(le),b(ee.$$.fragment,le),le.forEach(t),zo=h(e),A=s(e,"H2",{class:!0});var Do=r(A);oe=s(Do,"A",{id:!0,class:!0,href:!0});var ls=r(oe);fo=s(ls,"SPAN",{});var cs=r(fo);b(je.$$.fragment,cs),cs.forEach(t),ls.forEach(t),Qt=h(Do),go=s(Do,"SPAN",{});var ds=r(go);Dt=l(ds,"Swin2SRModel"),ds.forEach(t),Do.forEach(t),Bo=h(e),J=s(e,"DIV",{class:!0});var eo=r(J);b(Ie.$$.fragment,eo),Lt=h(eo),Ce=s(eo,"P",{});var Lo=r(Ce);Ot=l(Lo,`The bare Swin2SR Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ee=s(Lo,"A",{href:!0,rel:!0});var ms=r(Ee);Kt=l(ms,"torch.nn.Module"),ms.forEach(t),en=l(Lo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Lo.forEach(t),on=h(eo),E=s(eo,"DIV",{class:!0});var ce=r(E);b(Ue.$$.fragment,ce),tn=h(ce),q=s(ce,"P",{});var oo=r(q);nn=l(oo,"The "),He=s(oo,"A",{href:!0});var ps=r(He);sn=l(ps,"Swin2SRModel"),ps.forEach(t),rn=l(oo," forward method, overrides the "),wo=s(oo,"CODE",{});var hs=r(wo);an=l(hs,"__call__"),hs.forEach(t),ln=l(oo," special method."),oo.forEach(t),cn=h(ce),b(te.$$.fragment,ce),dn=h(ce),b(ne.$$.fragment,ce),ce.forEach(t),eo.forEach(t),Zo=h(e),G=s(e,"H2",{class:!0});var Oo=r(G);se=s(Oo,"A",{id:!0,class:!0,href:!0});var us=r(se);_o=s(us,"SPAN",{});var fs=r(_o);b(xe.$$.fragment,fs),fs.forEach(t),us.forEach(t),mn=h(Oo),So=s(Oo,"SPAN",{});var gs=r(So);pn=l(gs,"Swin2SRForImageSuperResolution"),gs.forEach(t),Oo.forEach(t),Ao=h(e),j=s(e,"DIV",{class:!0});var de=r(j);b(ke.$$.fragment,de),hn=h(de),vo=s(de,"P",{});var ws=r(vo);un=l(ws,"Swin2SR Model transformer with an upsampler head on top for image super resolution and restoration."),ws.forEach(t),fn=h(de),Je=s(de,"P",{});var Ko=r(Je);gn=l(Ko,"This model is a PyTorch "),Fe=s(Ko,"A",{href:!0,rel:!0});var _s=r(Fe);wn=l(_s,"torch.nn.Module"),_s.forEach(t),_n=l(Ko,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ko.forEach(t),Sn=h(de),U=s(de,"DIV",{class:!0});var me=r(U);b(Ne.$$.fragment,me),vn=h(me),X=s(me,"P",{});var to=r(X);bn=l(to,"The "),Qe=s(to,"A",{href:!0});var Ss=r(Qe);yn=l(Ss,"Swin2SRForImageSuperResolution"),Ss.forEach(t),Rn=l(to," forward method, overrides the "),bo=s(to,"CODE",{});var vs=r(bo);Mn=l(vs,"__call__"),vs.forEach(t),Tn=l(to," special method."),to.forEach(t),$n=h(me),b(re.$$.fragment,me),jn=h(me),b(ae.$$.fragment,me),me.forEach(t),de.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(Js)),c(f,"id","swin2sr"),c(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(f,"href","#swin2sr"),c(w,"class","relative group"),c(V,"id","overview"),c(V,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(V,"href","#overview"),c(N,"class","relative group"),c(he,"href","https://arxiv.org/abs/2209.11345"),c(he,"rel","nofollow"),c(ue,"href","https://github.com/JingyunLiang/SwinIR/"),c(ue,"rel","nofollow"),c(Ze,"href","swinv2"),$s(Y.src,xn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/swin2sr_architecture.png")||c(Y,"src",xn),c(Y,"alt","drawing"),c(Y,"width","600"),c(Ge,"href","https://arxiv.org/abs/2209.11345"),c(ge,"href","https://huggingface.co/nielsr"),c(ge,"rel","nofollow"),c(we,"href","https://github.com/mv-lab/swin2sr"),c(we,"rel","nofollow"),c(H,"id","resources"),c(H,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(H,"href","#resources"),c(W,"class","relative group"),c(Se,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Swin2SR"),c(Se,"rel","nofollow"),c(ve,"href","https://huggingface.co/spaces/jjourney1125/swin2sr"),c(ve,"rel","nofollow"),c(L,"id","transformers.Swin2SRImageProcessor"),c(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(L,"href","#transformers.Swin2SRImageProcessor"),c(P,"class","relative group"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(K,"id","transformers.Swin2SRConfig"),c(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(K,"href","#transformers.Swin2SRConfig"),c(z,"class","relative group"),c(Xe,"href","/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRModel"),c($e,"href","https://huggingface.co/caidas/swin2sr-classicalsr-x2-64"),c($e,"rel","nofollow"),c(Ve,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Ye,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(oe,"id","transformers.Swin2SRModel"),c(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(oe,"href","#transformers.Swin2SRModel"),c(A,"class","relative group"),c(Ee,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ee,"rel","nofollow"),c(He,"href","/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRModel"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(se,"id","transformers.Swin2SRForImageSuperResolution"),c(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(se,"href","#transformers.Swin2SRForImageSuperResolution"),c(G,"class","relative group"),c(Fe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Fe,"rel","nofollow"),c(Qe,"href","/docs/transformers/v4.33.0/en/model_doc/swin2sr#transformers.Swin2SRForImageSuperResolution"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,d){o(document.head,m),u(e,S,d),u(e,w,d),o(w,f),o(f,_),y(a,_,null),o(w,g),o(w,x),o(x,et),u(e,To,d),u(e,N,d),o(N,V),o(V,no),y(pe,no,null),o(N,ot),o(N,so),o(so,tt),u(e,$o,d),u(e,C,d),o(C,nt),o(C,he),o(he,st),o(C,rt),o(C,ue),o(ue,at),o(C,it),o(C,Ze),o(Ze,lt),o(C,ct),u(e,jo,d),u(e,Ae,d),o(Ae,dt),u(e,Io,d),u(e,qe,d),o(qe,ro),o(ro,mt),u(e,Co,d),u(e,Y,d),u(e,Eo,d),u(e,fe,d),o(fe,pt),o(fe,Ge),o(Ge,ht),u(e,Uo,d),u(e,F,d),o(F,ut),o(F,ge),o(ge,ft),o(F,gt),o(F,we),o(we,wt),o(F,_t),u(e,xo,d),u(e,W,d),o(W,H),o(H,ao),y(_e,ao,null),o(W,St),o(W,io),o(io,vt),u(e,ko,d),u(e,Q,d),o(Q,bt),o(Q,Se),o(Se,yt),o(Q,Rt),u(e,Jo,d),u(e,D,d),o(D,Mt),o(D,ve),o(ve,Tt),o(D,$t),u(e,Fo,d),u(e,P,d),o(P,L),o(L,lo),y(be,lo,null),o(P,jt),o(P,co),o(co,It),u(e,No,d),u(e,k,d),y(ye,k,null),o(k,Ct),o(k,mo),o(mo,Et),o(k,Ut),o(k,O),y(Re,O,null),o(O,xt),o(O,po),o(po,kt),u(e,Wo,d),u(e,z,d),o(z,K),o(K,ho),y(Me,ho,null),o(z,Jt),o(z,uo),o(uo,Ft),u(e,Po,d),u(e,$,d),y(Te,$,null),o($,Nt),o($,B),o(B,Wt),o(B,Xe),o(Xe,Pt),o(B,zt),o(B,$e),o($e,Bt),o(B,Zt),o($,At),o($,Z),o(Z,qt),o(Z,Ve),o(Ve,Gt),o(Z,Xt),o(Z,Ye),o(Ye,Vt),o(Z,Yt),o($,Ht),y(ee,$,null),u(e,zo,d),u(e,A,d),o(A,oe),o(oe,fo),y(je,fo,null),o(A,Qt),o(A,go),o(go,Dt),u(e,Bo,d),u(e,J,d),y(Ie,J,null),o(J,Lt),o(J,Ce),o(Ce,Ot),o(Ce,Ee),o(Ee,Kt),o(Ce,en),o(J,on),o(J,E),y(Ue,E,null),o(E,tn),o(E,q),o(q,nn),o(q,He),o(He,sn),o(q,rn),o(q,wo),o(wo,an),o(q,ln),o(E,cn),y(te,E,null),o(E,dn),y(ne,E,null),u(e,Zo,d),u(e,G,d),o(G,se),o(se,_o),y(xe,_o,null),o(G,mn),o(G,So),o(So,pn),u(e,Ao,d),u(e,j,d),y(ke,j,null),o(j,hn),o(j,vo),o(vo,un),o(j,fn),o(j,Je),o(Je,gn),o(Je,Fe),o(Fe,wn),o(Je,_n),o(j,Sn),o(j,U),y(Ne,U,null),o(U,vn),o(U,X),o(X,bn),o(X,Qe),o(Qe,yn),o(X,Rn),o(X,bo),o(bo,Mn),o(X,Tn),o(U,$n),y(re,U,null),o(U,jn),y(ae,U,null),qo=!0},p(e,[d]){const We={};d&2&&(We.$$scope={dirty:d,ctx:e}),ee.$set(We);const yo={};d&2&&(yo.$$scope={dirty:d,ctx:e}),te.$set(yo);const Ro={};d&2&&(Ro.$$scope={dirty:d,ctx:e}),ne.$set(Ro);const Mo={};d&2&&(Mo.$$scope={dirty:d,ctx:e}),re.$set(Mo);const Pe={};d&2&&(Pe.$$scope={dirty:d,ctx:e}),ae.$set(Pe)},i(e){qo||(R(a.$$.fragment,e),R(pe.$$.fragment,e),R(_e.$$.fragment,e),R(be.$$.fragment,e),R(ye.$$.fragment,e),R(Re.$$.fragment,e),R(Me.$$.fragment,e),R(Te.$$.fragment,e),R(ee.$$.fragment,e),R(je.$$.fragment,e),R(Ie.$$.fragment,e),R(Ue.$$.fragment,e),R(te.$$.fragment,e),R(ne.$$.fragment,e),R(xe.$$.fragment,e),R(ke.$$.fragment,e),R(Ne.$$.fragment,e),R(re.$$.fragment,e),R(ae.$$.fragment,e),qo=!0)},o(e){M(a.$$.fragment,e),M(pe.$$.fragment,e),M(_e.$$.fragment,e),M(be.$$.fragment,e),M(ye.$$.fragment,e),M(Re.$$.fragment,e),M(Me.$$.fragment,e),M(Te.$$.fragment,e),M(ee.$$.fragment,e),M(je.$$.fragment,e),M(Ie.$$.fragment,e),M(Ue.$$.fragment,e),M(te.$$.fragment,e),M(ne.$$.fragment,e),M(xe.$$.fragment,e),M(ke.$$.fragment,e),M(Ne.$$.fragment,e),M(re.$$.fragment,e),M(ae.$$.fragment,e),qo=!1},d(e){t(m),e&&t(S),e&&t(w),T(a),e&&t(To),e&&t(N),T(pe),e&&t($o),e&&t(C),e&&t(jo),e&&t(Ae),e&&t(Io),e&&t(qe),e&&t(Co),e&&t(Y),e&&t(Eo),e&&t(fe),e&&t(Uo),e&&t(F),e&&t(xo),e&&t(W),T(_e),e&&t(ko),e&&t(Q),e&&t(Jo),e&&t(D),e&&t(Fo),e&&t(P),T(be),e&&t(No),e&&t(k),T(ye),T(Re),e&&t(Wo),e&&t(z),T(Me),e&&t(Po),e&&t($),T(Te),T(ee),e&&t(zo),e&&t(A),T(je),e&&t(Bo),e&&t(J),T(Ie),T(Ue),T(te),T(ne),e&&t(Zo),e&&t(G),T(xe),e&&t(Ao),e&&t(j),T(ke),T(Ne),T(re),T(ae)}}}const Js={local:"swin2sr",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.Swin2SRImageProcessor",title:"Swin2SRImageProcessor"},{local:"transformers.Swin2SRConfig",title:"Swin2SRConfig"},{local:"transformers.Swin2SRModel",title:"Swin2SRModel"},{local:"transformers.Swin2SRForImageSuperResolution",title:"Swin2SRForImageSuperResolution"}],title:"Swin2SR"};function Fs(I){return js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class As extends ys{constructor(m){super();Rs(this,m,Fs,ks,Ms,{})}}export{As as default,Js as metadata};
