import{s as br,f as Cr,o as Mr,n as L}from"../chunks/scheduler.9bc65507.js";import{S as Tr,i as Ir,g as r,s as l,u,A as wr,h as a,f as o,c as d,j as M,v as _,y as f,k as g,o as s,a as p,w as v,d as y,t as b,x as C}from"../chunks/index.78c82d43.js";import{T as co}from"../chunks/Tip.87d55b76.js";import{D as $}from"../chunks/Docstring.4e7352e2.js";import{C as ne}from"../chunks/CodeBlock.73e038be.js";import{I as E}from"../chunks/IconCopyLink.bedaa44d.js";import{E as oe}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as $r}from"../chunks/PipelineTag.75b0f707.js";function Sr(w){let n,T="Example:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBTZWdDb25maWclMkMlMjBDTElQU2VnTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMHdpdGglMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDTElQU2VnQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ01vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMGZyb20lMjBhJTIwQ0xJUFNlZ1RleHRDb25maWclMjBhbmQlMjBhJTIwQ0xJUFNlZ1Zpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQU2VnVGV4dCUyMGFuZCUyMENMSVBTZWdWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQU2VnVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBTZWdWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBTZWdDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPSegConfig, CLIPSegModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegConfig with CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPSegConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegModel (with random weights) from the CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegModel(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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a CLIPSegConfig from a CLIPSegTextConfig and a CLIPSegVisionConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegText and CLIPSegVision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = CLIPSegTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = CLIPSegVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = CLIPSegConfig.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Pr(w){let n,T="Example:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBTZWdUZXh0Q29uZmlnJTJDJTIwQ0xJUFNlZ1RleHRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQU2VnVGV4dENvbmZpZyUyMHdpdGglMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDTElQU2VnVGV4dENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBTZWdUZXh0TW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMENJREFTJTJGY2xpcHNlZy1yZDY0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPSegTextConfig, CLIPSegTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegTextConfig with CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPSegTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegTextModel (with random weights) from the CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegTextModel(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`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function xr(w){let n,T="Example:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBTZWdWaXNpb25Db25maWclMkMlMjBDTElQU2VnVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ1Zpc2lvbkNvbmZpZyUyMHdpdGglMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDTElQU2VnVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ1Zpc2lvbk1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ1Zpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPSegVisionConfig, CLIPSegVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegVisionConfig with CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPSegVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPSegVisionModel (with random weights) from the CIDAS/clipseg-rd64 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegVisionModel(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`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-11lpom8"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Lr(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function jr(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",highlighted:`<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> AutoProcessor, CLIPSegModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegModel.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.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>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Jr(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function kr(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQU2VnTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJDSURBUyUyRmNsaXBzZWctcmQ2NC1yZWZpbmVkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJDSURBUyUyRmNsaXBzZWctcmQ2NC1yZWZpbmVkJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPSegModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegModel.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Zr(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function Ur(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBaW1hZ2VfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfaW1hZ2VfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<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> AutoProcessor, CLIPSegModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegModel.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.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>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function zr(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function Wr(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQU2VnVGV4dE1vZGVsJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEFtb2RlbCUyMCUzRCUyMENMSVBTZWdUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMChFT1MlMjB0b2tlbiklMjBzdGF0ZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPSegTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegTextModel.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Nr(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function Vr(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdWaXNpb25Nb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjBDTFMlMjBzdGF0ZXM=",highlighted:`<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> AutoProcessor, CLIPSegVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegVisionModel.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.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>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Br(w){let n,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=r("p"),n.innerHTML=T},l(m){n=a(m,"P",{"data-svelte-h":!0}),f(n)!=="svelte-fincs2"&&(n.innerHTML=T)},m(m,c){p(m,n,c)},p:L,d(m){m&&o(n)}}}function Er(w){let n,T="Examples:",m,c,h;return c=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBDTElQU2VnRm9ySW1hZ2VTZWdtZW50YXRpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnRm9ySW1hZ2VTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHRzJTIwJTNEJTIwJTVCJTIyYSUyMGNhdCUyMiUyQyUyMCUyMmElMjByZW1vdGUlMjIlMkMlMjAlMjJhJTIwYmxhbmtldCUyMiU1RCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdGV4dHMlMkMlMjBpbWFnZXMlM0QlNUJpbWFnZSU1RCUyMColMjBsZW4odGV4dHMpJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQXByaW50KGxvZ2l0cy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegForImageSegmentation
<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>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPSegForImageSegmentation.from_pretrained(<span class="hljs-string">&quot;CIDAS/clipseg-rd64-refined&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.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>texts = [<span class="hljs-string">&quot;a cat&quot;</span>, <span class="hljs-string">&quot;a remote&quot;</span>, <span class="hljs-string">&quot;a blanket&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, images=[image] * <span class="hljs-built_in">len</span>(texts), padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(logits.shape)
torch.Size([<span class="hljs-number">3</span>, <span class="hljs-number">352</span>, <span class="hljs-number">352</span>])`,wrap:!1}}),{c(){n=r("p"),n.textContent=T,m=l(),u(c.$$.fragment)},l(t){n=a(t,"P",{"data-svelte-h":!0}),f(n)!=="svelte-kvfsh7"&&(n.textContent=T),m=d(t),_(c.$$.fragment,t)},m(t,I){p(t,n,I),p(t,m,I),v(c,t,I),h=!0},p:L,i(t){h||(y(c.$$.fragment,t),h=!0)},o(t){b(c.$$.fragment,t),h=!1},d(t){t&&(o(n),o(m)),C(c,t)}}}function Fr(w){let n,T,m,c,h,t,I,Fe,vn,Jt,ys="CLIPSeg",Lo,H,se,po,qe,yn,kt,bs="Overview",jo,He,Cs=`The CLIPSeg model was proposed in <a href="https://arxiv.org/abs/2112.10003" rel="nofollow">Image Segmentation Using Text and Image Prompts</a> by Timo Lüddecke
and Alexander Ecker. CLIPSeg adds a minimal decoder on top of a frozen <a href="clip">CLIP</a> model for zero- and one-shot image segmentation.`,Jo,Xe,Ms="The abstract from the paper is the following:",ko,Re,Ts=`<em>Image segmentation is usually addressed by training a
model for a fixed set of object classes. Incorporating additional classes or more complex queries later is expensive
as it requires re-training the model on a dataset that encompasses these expressions. Here we propose a system
that can generate image segmentations based on arbitrary
prompts at test time. A prompt can be either a text or an
image. This approach enables us to create a unified model
(trained once) for three common segmentation tasks, which
come with distinct challenges: referring expression segmentation, zero-shot segmentation and one-shot segmentation.
We build upon the CLIP model as a backbone which we extend with a transformer-based decoder that enables dense
prediction. After training on an extended version of the
PhraseCut dataset, our system generates a binary segmentation map for an image based on a free-text prompt or on
an additional image expressing the query. We analyze different variants of the latter image-based prompts in detail.
This novel hybrid input allows for dynamic adaptation not
only to the three segmentation tasks mentioned above, but
to any binary segmentation task where a text or image query
can be formulated. Finally, we find our system to adapt well
to generalized queries involving affordances or properties</em>`,Zo,Ge,Is="Tips:",Uo,De,ws=`<li><a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation">CLIPSegForImageSegmentation</a> adds a decoder on top of <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>. The latter is identical to <a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a>.</li> <li><a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation">CLIPSegForImageSegmentation</a> can generate image segmentations based on arbitrary prompts at test time. A prompt can be either a text
(provided to the model as <code>input_ids</code>) or an image (provided to the model as <code>conditional_pixel_values</code>). One can also provide custom
conditional embeddings (provided to the model as <code>conditional_embeddings</code>).</li>`,zo,re,$s,Wo,Qe,Ss='CLIPSeg overview. Taken from the <a href="https://arxiv.org/abs/2112.10003">original paper.</a>',No,Ae,Ps=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>.
The original code can be found <a href="https://github.com/timojl/clipseg" rel="nofollow">here</a>.`,Vo,X,ae,mo,Ye,bn,Zt,xs="Resources",Bo,Oe,Ls="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with CLIPSeg. If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",Eo,Ke,Fo,et,js='<li>A notebook that illustrates <a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/CLIPSeg/Zero_shot_image_segmentation_with_CLIPSeg.ipynb" rel="nofollow">zero-shot image segmentation with CLIPSeg</a>.</li>',qo,R,ie,go,tt,Cn,Ut,Js="CLIPSegConfig",Ho,S,ot,Mn,zt,ks=`<a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>. It is used to
instantiate a CLIPSeg model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the CLIPSeg
<a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a> architecture.`,Tn,Wt,Zs=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,In,le,wn,de,nt,$n,Nt,Us=`Instantiate a <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</a> (or a derived class) from clipseg text model configuration and clipseg vision
model configuration.`,Xo,G,ce,fo,st,Sn,Vt,zs="CLIPSegTextConfig",Ro,j,rt,Pn,Bt,Ws=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>. It is used to instantiate an
CLIPSeg 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 CLIPSeg
<a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a> architecture.`,xn,Et,Ns=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ln,pe,Go,D,me,ho,at,jn,Ft,Vs="CLIPSegVisionConfig",Do,J,it,Jn,qt,Bs=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>. It is used to instantiate an
CLIPSeg 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 CLIPSeg
<a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a> architecture.`,kn,Ht,Es=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Zn,ge,Qo,Q,fe,uo,lt,Un,Xt,Fs="CLIPSegProcessor",Ao,P,dt,zn,Rt,qs="Constructs a CLIPSeg processor which wraps a CLIPSeg image processor and a CLIP tokenizer into a single processor.",Wn,Gt,Hs=`<a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.34.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegProcessor.decode">decode()</a> for more information.`,Nn,he,ct,Vn,Dt,Xs=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Bn,ue,pt,En,Qt,Rs=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,Yo,A,_e,_o,mt,Fn,At,Gs="CLIPSegModel",Oo,x,gt,qn,Yt,Ds=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Hn,U,ft,Xn,Ot,Qs='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a> forward method, overrides the <code>__call__</code> special method.',Rn,ve,Gn,ye,Dn,z,ht,Qn,Kt,As='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a> forward method, overrides the <code>__call__</code> special method.',An,be,Yn,Ce,On,W,ut,Kn,eo,Ys='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a> forward method, overrides the <code>__call__</code> special method.',es,Me,ts,Te,Ko,Y,Ie,vo,_t,os,to,Os="CLIPSegTextModel",en,O,vt,ns,N,yt,ss,oo,Ks='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a> forward method, overrides the <code>__call__</code> special method.',rs,we,as,$e,tn,K,Se,yo,bt,is,no,er="CLIPSegVisionModel",on,ee,Ct,ls,V,Mt,ds,so,tr='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a> forward method, overrides the <code>__call__</code> special method.',cs,Pe,ps,xe,nn,te,Le,bo,Tt,ms,ro,or="CLIPSegForImageSegmentation",sn,k,It,gs,ao,nr="CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation.",fs,io,sr=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,hs,B,wt,us,lo,rr='The <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation">CLIPSegForImageSegmentation</a> forward method, overrides the <code>__call__</code> special method.',_s,je,vs,Je,rn,Co,an;return Fe=new E({}),qe=new E({}),Ye=new E({}),Ke=new $r({props:{pipeline:"image-segmentation"}}),tt=new E({}),ot=new $({props:{name:"class transformers.CLIPSegConfig",anchor:"transformers.CLIPSegConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"extract_layers",val:" = [3, 6, 9]"},{name:"reduce_dim",val:" = 64"},{name:"decoder_num_attention_heads",val:" = 4"},{name:"decoder_attention_dropout",val:" = 0.0"},{name:"decoder_hidden_act",val:" = 'quick_gelu'"},{name:"decoder_intermediate_size",val:" = 2048"},{name:"conditional_layer",val:" = 0"},{name:"use_complex_transposed_convolution",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegTextConfig">CLIPSegTextConfig</a>.`,name:"text_config"},{anchor:"transformers.CLIPSegConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionConfig">CLIPSegVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.CLIPSegConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.CLIPSegConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original CLIPSeg implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.CLIPSegConfig.extract_layers",description:`<strong>extract_layers</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [3, 6, 9]) &#x2014;
Layers to extract when forwarding the query image through the frozen visual backbone of CLIP.`,name:"extract_layers"},{anchor:"transformers.CLIPSegConfig.reduce_dim",description:`<strong>reduce_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality to reduce the CLIP vision embedding.`,name:"reduce_dim"},{anchor:"transformers.CLIPSegConfig.decoder_num_attention_heads",description:`<strong>decoder_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads in the decoder of CLIPSeg.`,name:"decoder_num_attention_heads"},{anchor:"transformers.CLIPSegConfig.decoder_attention_dropout",description:`<strong>decoder_attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"decoder_attention_dropout"},{anchor:"transformers.CLIPSegConfig.decoder_hidden_act",description:`<strong>decoder_hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"decoder_hidden_act"},{anchor:"transformers.CLIPSegConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layers in the Transformer decoder.`,name:"decoder_intermediate_size"},{anchor:"transformers.CLIPSegConfig.conditional_layer",description:`<strong>conditional_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The layer to use of the Transformer encoder whose activations will be combined with the condition
embeddings using FiLM (Feature-wise Linear Modulation). If 0, the last layer is used.`,name:"conditional_layer"},{anchor:"transformers.CLIPSegConfig.use_complex_transposed_convolution",description:`<strong>use_complex_transposed_convolution</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a more complex transposed convolution in the decoder, enabling more fine-grained
segmentation.`,name:"use_complex_transposed_convolution"},{anchor:"transformers.CLIPSegConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/configuration_clipseg.py#L239"}}),le=new oe({props:{anchor:"transformers.CLIPSegConfig.example",$$slots:{default:[Sr]},$$scope:{ctx:w}}}),nt=new $({props:{name:"from_text_vision_configs",anchor:"transformers.CLIPSegConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": CLIPSegTextConfig"},{name:"vision_config",val:": CLIPSegVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/configuration_clipseg.py#L414",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a></p>
`}}),st=new E({}),rt=new $({props:{name:"class transformers.CLIPSegTextConfig",anchor:"transformers.CLIPSegTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the CLIPSeg text model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>.`,name:"vocab_size"},{anchor:"transformers.CLIPSegTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPSegTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.CLIPSegTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPSegTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPSegTextConfig.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.CLIPSegTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/configuration_clipseg.py#L31"}}),pe=new oe({props:{anchor:"transformers.CLIPSegTextConfig.example",$$slots:{default:[Pr]},$$scope:{ctx:w}}}),at=new E({}),it=new $({props:{name:"class transformers.CLIPSegVisionConfig",anchor:"transformers.CLIPSegVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPSegVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.CLIPSegVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.CLIPSegVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPSegVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPSegVisionConfig.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.CLIPSegVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/configuration_clipseg.py#L136"}}),ge=new oe({props:{anchor:"transformers.CLIPSegVisionConfig.example",$$slots:{default:[xr]},$$scope:{ctx:w}}}),lt=new E({}),dt=new $({props:{name:"class transformers.CLIPSegProcessor",anchor:"transformers.CLIPSegProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPSegProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/processing_clipseg.py#L25"}}),ct=new $({props:{name:"batch_decode",anchor:"transformers.CLIPSegProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/processing_clipseg.py#L133"}}),pt=new $({props:{name:"decode",anchor:"transformers.CLIPSegProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/processing_clipseg.py#L140"}}),mt=new E({}),gt=new $({props:{name:"class transformers.CLIPSegModel",anchor:"transformers.CLIPSegModel",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L968"}}),ft=new $({props:{name:"forward",anchor:"transformers.CLIPSegModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = 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.CLIPSegModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPSegModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.CLIPSegModel.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.CLIPSegModel.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.CLIPSegModel.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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L1099",returnDescription:`
<p>A <code>transformers.models.clipseg.modeling_clipseg.CLIPSegOutput</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 (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clipseg.modeling_clipseg.CLIPSegOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new co({props:{$$slots:{default:[Lr]},$$scope:{ctx:w}}}),ye=new oe({props:{anchor:"transformers.CLIPSegModel.forward.example",$$slots:{default:[jr]},$$scope:{ctx:w}}}),ht=new $({props:{name:"get_text_features",anchor:"transformers.CLIPSegModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = 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.CLIPSegModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPSegModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegModel.get_text_features.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.CLIPSegModel.get_text_features.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.CLIPSegModel.get_text_features.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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L1003",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),be=new co({props:{$$slots:{default:[Jr]},$$scope:{ctx:w}}}),Ce=new oe({props:{anchor:"transformers.CLIPSegModel.get_text_features.example",$$slots:{default:[kr]},$$scope:{ctx:w}}}),ut=new $({props:{name:"get_image_features",anchor:"transformers.CLIPSegModel.get_image_features",parameters:[{name:"pixel_values",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.CLIPSegModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegModel.get_image_features.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.CLIPSegModel.get_image_features.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.CLIPSegModel.get_image_features.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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L1050",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Me=new co({props:{$$slots:{default:[Zr]},$$scope:{ctx:w}}}),Te=new oe({props:{anchor:"transformers.CLIPSegModel.get_image_features.example",$$slots:{default:[Ur]},$$scope:{ctx:w}}}),_t=new E({}),vt=new $({props:{name:"class transformers.CLIPSegTextModel",anchor:"transformers.CLIPSegTextModel",parameters:[{name:"config",val:": CLIPSegTextConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L800"}}),yt=new $({props:{name:"forward",anchor:"transformers.CLIPSegTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = 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.CLIPSegTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPSegTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegTextModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegTextModel.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.CLIPSegTextModel.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.CLIPSegTextModel.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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L817",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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 (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegTextConfig'&gt;</code>) 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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>) — 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>) — 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.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new co({props:{$$slots:{default:[zr]},$$scope:{ctx:w}}}),$e=new oe({props:{anchor:"transformers.CLIPSegTextModel.forward.example",$$slots:{default:[Wr]},$$scope:{ctx:w}}}),bt=new E({}),Ct=new $({props:{name:"class transformers.CLIPSegVisionModel",anchor:"transformers.CLIPSegVisionModel",parameters:[{name:"config",val:": CLIPSegVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L915"}}),Mt=new $({props:{name:"forward",anchor:"transformers.CLIPSegVisionModel.forward",parameters:[{name:"pixel_values",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.CLIPSegVisionModel.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegVisionModel.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.CLIPSegVisionModel.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.CLIPSegVisionModel.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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L928",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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 (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegVisionConfig'&gt;</code>) 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>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>) — 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>) — 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.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new co({props:{$$slots:{default:[Nr]},$$scope:{ctx:w}}}),xe=new oe({props:{anchor:"transformers.CLIPSegVisionModel.forward.example",$$slots:{default:[Vr]},$$scope:{ctx:w}}}),Tt=new E({}),It=new $({props:{name:"class transformers.CLIPSegForImageSegmentation",anchor:"transformers.CLIPSegForImageSegmentation",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</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.34.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.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L1356"}}),wt=new $({props:{name:"forward",anchor:"transformers.CLIPSegForImageSegmentation.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = 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.CLIPSegForImageSegmentation.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegForImageSegmentation.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. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.CLIPSegForImageSegmentation.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.CLIPSegForImageSegmentation.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.CLIPSegForImageSegmentation.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/clipseg/modeling_clipseg.py#L1401",returnDescription:`
<p>A <code>transformers.models.clipseg.modeling_clipseg.CLIPSegImageSegmentationOutput</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 (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.
…</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clipseg.modeling_clipseg.CLIPSegImageSegmentationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new co({props:{$$slots:{default:[Br]},$$scope:{ctx:w}}}),Je=new oe({props:{anchor:"transformers.CLIPSegForImageSegmentation.forward.example",$$slots:{default:[Er]},$$scope:{ctx:w}}}),{c(){n=r("meta"),T=l(),m=r("p"),c=l(),h=r("h1"),t=r("a"),I=r("span"),u(Fe.$$.fragment),vn=l(),Jt=r("span"),Jt.textContent=ys,Lo=l(),H=r("h2"),se=r("a"),po=r("span"),u(qe.$$.fragment),yn=l(),kt=r("span"),kt.textContent=bs,jo=l(),He=r("p"),He.innerHTML=Cs,Jo=l(),Xe=r("p"),Xe.textContent=Ms,ko=l(),Re=r("p"),Re.innerHTML=Ts,Zo=l(),Ge=r("p"),Ge.textContent=Is,Uo=l(),De=r("ul"),De.innerHTML=ws,zo=l(),re=r("img"),Wo=l(),Qe=r("small"),Qe.innerHTML=Ss,No=l(),Ae=r("p"),Ae.innerHTML=Ps,Vo=l(),X=r("h2"),ae=r("a"),mo=r("span"),u(Ye.$$.fragment),bn=l(),Zt=r("span"),Zt.textContent=xs,Bo=l(),Oe=r("p"),Oe.textContent=Ls,Eo=l(),u(Ke.$$.fragment),Fo=l(),et=r("ul"),et.innerHTML=js,qo=l(),R=r("h2"),ie=r("a"),go=r("span"),u(tt.$$.fragment),Cn=l(),Ut=r("span"),Ut.textContent=Js,Ho=l(),S=r("div"),u(ot.$$.fragment),Mn=l(),zt=r("p"),zt.innerHTML=ks,Tn=l(),Wt=r("p"),Wt.innerHTML=Zs,In=l(),u(le.$$.fragment),wn=l(),de=r("div"),u(nt.$$.fragment),$n=l(),Nt=r("p"),Nt.innerHTML=Us,Xo=l(),G=r("h2"),ce=r("a"),fo=r("span"),u(st.$$.fragment),Sn=l(),Vt=r("span"),Vt.textContent=zs,Ro=l(),j=r("div"),u(rt.$$.fragment),Pn=l(),Bt=r("p"),Bt.innerHTML=Ws,xn=l(),Et=r("p"),Et.innerHTML=Ns,Ln=l(),u(pe.$$.fragment),Go=l(),D=r("h2"),me=r("a"),ho=r("span"),u(at.$$.fragment),jn=l(),Ft=r("span"),Ft.textContent=Vs,Do=l(),J=r("div"),u(it.$$.fragment),Jn=l(),qt=r("p"),qt.innerHTML=Bs,kn=l(),Ht=r("p"),Ht.innerHTML=Es,Zn=l(),u(ge.$$.fragment),Qo=l(),Q=r("h2"),fe=r("a"),uo=r("span"),u(lt.$$.fragment),Un=l(),Xt=r("span"),Xt.textContent=Fs,Ao=l(),P=r("div"),u(dt.$$.fragment),zn=l(),Rt=r("p"),Rt.textContent=qs,Wn=l(),Gt=r("p"),Gt.innerHTML=Hs,Nn=l(),he=r("div"),u(ct.$$.fragment),Vn=l(),Dt=r("p"),Dt.innerHTML=Xs,Bn=l(),ue=r("div"),u(pt.$$.fragment),En=l(),Qt=r("p"),Qt.innerHTML=Rs,Yo=l(),A=r("h2"),_e=r("a"),_o=r("span"),u(mt.$$.fragment),Fn=l(),At=r("span"),At.textContent=Gs,Oo=l(),x=r("div"),u(gt.$$.fragment),qn=l(),Yt=r("p"),Yt.innerHTML=Ds,Hn=l(),U=r("div"),u(ft.$$.fragment),Xn=l(),Ot=r("p"),Ot.innerHTML=Qs,Rn=l(),u(ve.$$.fragment),Gn=l(),u(ye.$$.fragment),Dn=l(),z=r("div"),u(ht.$$.fragment),Qn=l(),Kt=r("p"),Kt.innerHTML=As,An=l(),u(be.$$.fragment),Yn=l(),u(Ce.$$.fragment),On=l(),W=r("div"),u(ut.$$.fragment),Kn=l(),eo=r("p"),eo.innerHTML=Ys,es=l(),u(Me.$$.fragment),ts=l(),u(Te.$$.fragment),Ko=l(),Y=r("h2"),Ie=r("a"),vo=r("span"),u(_t.$$.fragment),os=l(),to=r("span"),to.textContent=Os,en=l(),O=r("div"),u(vt.$$.fragment),ns=l(),N=r("div"),u(yt.$$.fragment),ss=l(),oo=r("p"),oo.innerHTML=Ks,rs=l(),u(we.$$.fragment),as=l(),u($e.$$.fragment),tn=l(),K=r("h2"),Se=r("a"),yo=r("span"),u(bt.$$.fragment),is=l(),no=r("span"),no.textContent=er,on=l(),ee=r("div"),u(Ct.$$.fragment),ls=l(),V=r("div"),u(Mt.$$.fragment),ds=l(),so=r("p"),so.innerHTML=tr,cs=l(),u(Pe.$$.fragment),ps=l(),u(xe.$$.fragment),nn=l(),te=r("h2"),Le=r("a"),bo=r("span"),u(Tt.$$.fragment),ms=l(),ro=r("span"),ro.textContent=or,sn=l(),k=r("div"),u(It.$$.fragment),gs=l(),ao=r("p"),ao.textContent=nr,fs=l(),io=r("p"),io.innerHTML=sr,hs=l(),B=r("div"),u(wt.$$.fragment),us=l(),lo=r("p"),lo.innerHTML=rr,_s=l(),u(je.$$.fragment),vs=l(),u(Je.$$.fragment),rn=l(),Co=r("p"),this.h()},l(e){const i=wr("svelte-1phssyn",document.head);n=a(i,"META",{name:!0,content:!0}),i.forEach(o),T=d(e),m=a(e,"P",{}),M(m).forEach(o),c=d(e),h=a(e,"H1",{class:!0});var $t=M(h);t=a($t,"A",{id:!0,class:!0,href:!0});var Mo=M(t);I=a(Mo,"SPAN",{});var To=M(I);_(Fe.$$.fragment,To),To.forEach(o),Mo.forEach(o),vn=d($t),Jt=a($t,"SPAN",{"data-svelte-h":!0}),f(Jt)!=="svelte-ygnjaw"&&(Jt.textContent=ys),$t.forEach(o),Lo=d(e),H=a(e,"H2",{class:!0});var St=M(H);se=a(St,"A",{id:!0,class:!0,href:!0});var Io=M(se);po=a(Io,"SPAN",{});var wo=M(po);_(qe.$$.fragment,wo),wo.forEach(o),Io.forEach(o),yn=d(St),kt=a(St,"SPAN",{"data-svelte-h":!0}),f(kt)!=="svelte-1jsw1pg"&&(kt.textContent=bs),St.forEach(o),jo=d(e),He=a(e,"P",{"data-svelte-h":!0}),f(He)!=="svelte-1m7a0jl"&&(He.innerHTML=Cs),Jo=d(e),Xe=a(e,"P",{"data-svelte-h":!0}),f(Xe)!=="svelte-vfdo9a"&&(Xe.textContent=Ms),ko=d(e),Re=a(e,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-2767bu"&&(Re.innerHTML=Ts),Zo=d(e),Ge=a(e,"P",{"data-svelte-h":!0}),f(Ge)!=="svelte-axv494"&&(Ge.textContent=Is),Uo=d(e),De=a(e,"UL",{"data-svelte-h":!0}),f(De)!=="svelte-10alb9h"&&(De.innerHTML=ws),zo=d(e),re=a(e,"IMG",{src:!0,alt:!0,width:!0}),Wo=d(e),Qe=a(e,"SMALL",{"data-svelte-h":!0}),f(Qe)!=="svelte-r8s5wt"&&(Qe.innerHTML=Ss),No=d(e),Ae=a(e,"P",{"data-svelte-h":!0}),f(Ae)!=="svelte-14bl8yt"&&(Ae.innerHTML=Ps),Vo=d(e),X=a(e,"H2",{class:!0});var Pt=M(X);ae=a(Pt,"A",{id:!0,class:!0,href:!0});var $o=M(ae);mo=a($o,"SPAN",{});var So=M(mo);_(Ye.$$.fragment,So),So.forEach(o),$o.forEach(o),bn=d(Pt),Zt=a(Pt,"SPAN",{"data-svelte-h":!0}),f(Zt)!=="svelte-w4zzv6"&&(Zt.textContent=xs),Pt.forEach(o),Bo=d(e),Oe=a(e,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-i5etz8"&&(Oe.textContent=Ls),Eo=d(e),_(Ke.$$.fragment,e),Fo=d(e),et=a(e,"UL",{"data-svelte-h":!0}),f(et)!=="svelte-ksa1e9"&&(et.innerHTML=js),qo=d(e),R=a(e,"H2",{class:!0});var xt=M(R);ie=a(xt,"A",{id:!0,class:!0,href:!0});var Po=M(ie);go=a(Po,"SPAN",{});var xo=M(go);_(tt.$$.fragment,xo),xo.forEach(o),Po.forEach(o),Cn=d(xt),Ut=a(xt,"SPAN",{"data-svelte-h":!0}),f(Ut)!=="svelte-7mbj4e"&&(Ut.textContent=Js),xt.forEach(o),Ho=d(e),S=a(e,"DIV",{class:!0});var Z=M(S);_(ot.$$.fragment,Z),Mn=d(Z),zt=a(Z,"P",{"data-svelte-h":!0}),f(zt)!=="svelte-abphor"&&(zt.innerHTML=ks),Tn=d(Z),Wt=a(Z,"P",{"data-svelte-h":!0}),f(Wt)!=="svelte-10kqkkl"&&(Wt.innerHTML=Zs),In=d(Z),_(le.$$.fragment,Z),wn=d(Z),de=a(Z,"DIV",{class:!0});var Lt=M(de);_(nt.$$.fragment,Lt),$n=d(Lt),Nt=a(Lt,"P",{"data-svelte-h":!0}),f(Nt)!=="svelte-1yk2cqb"&&(Nt.innerHTML=Us),Lt.forEach(o),Z.forEach(o),Xo=d(e),G=a(e,"H2",{class:!0});var jt=M(G);ce=a(jt,"A",{id:!0,class:!0,href:!0});var ar=M(ce);fo=a(ar,"SPAN",{});var ir=M(fo);_(st.$$.fragment,ir),ir.forEach(o),ar.forEach(o),Sn=d(jt),Vt=a(jt,"SPAN",{"data-svelte-h":!0}),f(Vt)!=="svelte-j5tq1l"&&(Vt.textContent=zs),jt.forEach(o),Ro=d(e),j=a(e,"DIV",{class:!0});var ke=M(j);_(rt.$$.fragment,ke),Pn=d(ke),Bt=a(ke,"P",{"data-svelte-h":!0}),f(Bt)!=="svelte-rktveq"&&(Bt.innerHTML=Ws),xn=d(ke),Et=a(ke,"P",{"data-svelte-h":!0}),f(Et)!=="svelte-10kqkkl"&&(Et.innerHTML=Ns),Ln=d(ke),_(pe.$$.fragment,ke),ke.forEach(o),Go=d(e),D=a(e,"H2",{class:!0});var ln=M(D);me=a(ln,"A",{id:!0,class:!0,href:!0});var lr=M(me);ho=a(lr,"SPAN",{});var dr=M(ho);_(at.$$.fragment,dr),dr.forEach(o),lr.forEach(o),jn=d(ln),Ft=a(ln,"SPAN",{"data-svelte-h":!0}),f(Ft)!=="svelte-1vgfrs2"&&(Ft.textContent=Vs),ln.forEach(o),Do=d(e),J=a(e,"DIV",{class:!0});var Ze=M(J);_(it.$$.fragment,Ze),Jn=d(Ze),qt=a(Ze,"P",{"data-svelte-h":!0}),f(qt)!=="svelte-rktveq"&&(qt.innerHTML=Bs),kn=d(Ze),Ht=a(Ze,"P",{"data-svelte-h":!0}),f(Ht)!=="svelte-10kqkkl"&&(Ht.innerHTML=Es),Zn=d(Ze),_(ge.$$.fragment,Ze),Ze.forEach(o),Qo=d(e),Q=a(e,"H2",{class:!0});var dn=M(Q);fe=a(dn,"A",{id:!0,class:!0,href:!0});var cr=M(fe);uo=a(cr,"SPAN",{});var pr=M(uo);_(lt.$$.fragment,pr),pr.forEach(o),cr.forEach(o),Un=d(dn),Xt=a(dn,"SPAN",{"data-svelte-h":!0}),f(Xt)!=="svelte-1vjwwhu"&&(Xt.textContent=Fs),dn.forEach(o),Ao=d(e),P=a(e,"DIV",{class:!0});var F=M(P);_(dt.$$.fragment,F),zn=d(F),Rt=a(F,"P",{"data-svelte-h":!0}),f(Rt)!=="svelte-9hszhx"&&(Rt.textContent=qs),Wn=d(F),Gt=a(F,"P",{"data-svelte-h":!0}),f(Gt)!=="svelte-t3njmy"&&(Gt.innerHTML=Hs),Nn=d(F),he=a(F,"DIV",{class:!0});var cn=M(he);_(ct.$$.fragment,cn),Vn=d(cn),Dt=a(cn,"P",{"data-svelte-h":!0}),f(Dt)!=="svelte-13zh1xk"&&(Dt.innerHTML=Xs),cn.forEach(o),Bn=d(F),ue=a(F,"DIV",{class:!0});var pn=M(ue);_(pt.$$.fragment,pn),En=d(pn),Qt=a(pn,"P",{"data-svelte-h":!0}),f(Qt)!=="svelte-1qa4qlq"&&(Qt.innerHTML=Rs),pn.forEach(o),F.forEach(o),Yo=d(e),A=a(e,"H2",{class:!0});var mn=M(A);_e=a(mn,"A",{id:!0,class:!0,href:!0});var mr=M(_e);_o=a(mr,"SPAN",{});var gr=M(_o);_(mt.$$.fragment,gr),gr.forEach(o),mr.forEach(o),Fn=d(mn),At=a(mn,"SPAN",{"data-svelte-h":!0}),f(At)!=="svelte-bamk4h"&&(At.textContent=Gs),mn.forEach(o),Oo=d(e),x=a(e,"DIV",{class:!0});var q=M(x);_(gt.$$.fragment,q),qn=d(q),Yt=a(q,"P",{"data-svelte-h":!0}),f(Yt)!=="svelte-1gjh92c"&&(Yt.innerHTML=Ds),Hn=d(q),U=a(q,"DIV",{class:!0});var Ue=M(U);_(ft.$$.fragment,Ue),Xn=d(Ue),Ot=a(Ue,"P",{"data-svelte-h":!0}),f(Ot)!=="svelte-z1n0t8"&&(Ot.innerHTML=Qs),Rn=d(Ue),_(ve.$$.fragment,Ue),Gn=d(Ue),_(ye.$$.fragment,Ue),Ue.forEach(o),Dn=d(q),z=a(q,"DIV",{class:!0});var ze=M(z);_(ht.$$.fragment,ze),Qn=d(ze),Kt=a(ze,"P",{"data-svelte-h":!0}),f(Kt)!=="svelte-z1n0t8"&&(Kt.innerHTML=As),An=d(ze),_(be.$$.fragment,ze),Yn=d(ze),_(Ce.$$.fragment,ze),ze.forEach(o),On=d(q),W=a(q,"DIV",{class:!0});var We=M(W);_(ut.$$.fragment,We),Kn=d(We),eo=a(We,"P",{"data-svelte-h":!0}),f(eo)!=="svelte-z1n0t8"&&(eo.innerHTML=Ys),es=d(We),_(Me.$$.fragment,We),ts=d(We),_(Te.$$.fragment,We),We.forEach(o),q.forEach(o),Ko=d(e),Y=a(e,"H2",{class:!0});var gn=M(Y);Ie=a(gn,"A",{id:!0,class:!0,href:!0});var fr=M(Ie);vo=a(fr,"SPAN",{});var hr=M(vo);_(_t.$$.fragment,hr),hr.forEach(o),fr.forEach(o),os=d(gn),to=a(gn,"SPAN",{"data-svelte-h":!0}),f(to)!=="svelte-1kvra0e"&&(to.textContent=Os),gn.forEach(o),en=d(e),O=a(e,"DIV",{class:!0});var fn=M(O);_(vt.$$.fragment,fn),ns=d(fn),N=a(fn,"DIV",{class:!0});var Ne=M(N);_(yt.$$.fragment,Ne),ss=d(Ne),oo=a(Ne,"P",{"data-svelte-h":!0}),f(oo)!=="svelte-bd6oei"&&(oo.innerHTML=Ks),rs=d(Ne),_(we.$$.fragment,Ne),as=d(Ne),_($e.$$.fragment,Ne),Ne.forEach(o),fn.forEach(o),tn=d(e),K=a(e,"H2",{class:!0});var hn=M(K);Se=a(hn,"A",{id:!0,class:!0,href:!0});var ur=M(Se);yo=a(ur,"SPAN",{});var _r=M(yo);_(bt.$$.fragment,_r),_r.forEach(o),ur.forEach(o),is=d(hn),no=a(hn,"SPAN",{"data-svelte-h":!0}),f(no)!=="svelte-zv4ue1"&&(no.textContent=er),hn.forEach(o),on=d(e),ee=a(e,"DIV",{class:!0});var un=M(ee);_(Ct.$$.fragment,un),ls=d(un),V=a(un,"DIV",{class:!0});var Ve=M(V);_(Mt.$$.fragment,Ve),ds=d(Ve),so=a(Ve,"P",{"data-svelte-h":!0}),f(so)!=="svelte-1enoozw"&&(so.innerHTML=tr),cs=d(Ve),_(Pe.$$.fragment,Ve),ps=d(Ve),_(xe.$$.fragment,Ve),Ve.forEach(o),un.forEach(o),nn=d(e),te=a(e,"H2",{class:!0});var _n=M(te);Le=a(_n,"A",{id:!0,class:!0,href:!0});var vr=M(Le);bo=a(vr,"SPAN",{});var yr=M(bo);_(Tt.$$.fragment,yr),yr.forEach(o),vr.forEach(o),ms=d(_n),ro=a(_n,"SPAN",{"data-svelte-h":!0}),f(ro)!=="svelte-1p1t032"&&(ro.textContent=or),_n.forEach(o),sn=d(e),k=a(e,"DIV",{class:!0});var Be=M(k);_(It.$$.fragment,Be),gs=d(Be),ao=a(Be,"P",{"data-svelte-h":!0}),f(ao)!=="svelte-qndran"&&(ao.textContent=nr),fs=d(Be),io=a(Be,"P",{"data-svelte-h":!0}),f(io)!=="svelte-1gjh92c"&&(io.innerHTML=sr),hs=d(Be),B=a(Be,"DIV",{class:!0});var Ee=M(B);_(wt.$$.fragment,Ee),us=d(Ee),lo=a(Ee,"P",{"data-svelte-h":!0}),f(lo)!=="svelte-1qpw9r4"&&(lo.innerHTML=rr),_s=d(Ee),_(je.$$.fragment,Ee),vs=d(Ee),_(Je.$$.fragment,Ee),Ee.forEach(o),Be.forEach(o),rn=d(e),Co=a(e,"P",{}),M(Co).forEach(o),this.h()},h(){g(n,"name","hf:doc:metadata"),g(n,"content",JSON.stringify(qr)),g(t,"id","clipseg"),g(t,"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"),g(t,"href","#clipseg"),g(h,"class","relative group"),g(se,"id","overview"),g(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"),g(se,"href","#overview"),g(H,"class","relative group"),Cr(re.src,$s="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/clipseg_architecture.png")||g(re,"src",$s),g(re,"alt","drawing"),g(re,"width","600"),g(ae,"id","resources"),g(ae,"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"),g(ae,"href","#resources"),g(X,"class","relative group"),g(ie,"id","transformers.CLIPSegConfig"),g(ie,"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"),g(ie,"href","#transformers.CLIPSegConfig"),g(R,"class","relative group"),g(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ce,"id","transformers.CLIPSegTextConfig"),g(ce,"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"),g(ce,"href","#transformers.CLIPSegTextConfig"),g(G,"class","relative group"),g(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(me,"id","transformers.CLIPSegVisionConfig"),g(me,"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"),g(me,"href","#transformers.CLIPSegVisionConfig"),g(D,"class","relative group"),g(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(fe,"id","transformers.CLIPSegProcessor"),g(fe,"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"),g(fe,"href","#transformers.CLIPSegProcessor"),g(Q,"class","relative group"),g(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(_e,"id","transformers.CLIPSegModel"),g(_e,"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"),g(_e,"href","#transformers.CLIPSegModel"),g(A,"class","relative group"),g(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ie,"id","transformers.CLIPSegTextModel"),g(Ie,"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"),g(Ie,"href","#transformers.CLIPSegTextModel"),g(Y,"class","relative group"),g(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Se,"id","transformers.CLIPSegVisionModel"),g(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"),g(Se,"href","#transformers.CLIPSegVisionModel"),g(K,"class","relative group"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Le,"id","transformers.CLIPSegForImageSegmentation"),g(Le,"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"),g(Le,"href","#transformers.CLIPSegForImageSegmentation"),g(te,"class","relative group"),g(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(k,"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,i){s(document.head,n),p(e,T,i),p(e,m,i),p(e,c,i),p(e,h,i),s(h,t),s(t,I),v(Fe,I,null),s(h,vn),s(h,Jt),p(e,Lo,i),p(e,H,i),s(H,se),s(se,po),v(qe,po,null),s(H,yn),s(H,kt),p(e,jo,i),p(e,He,i),p(e,Jo,i),p(e,Xe,i),p(e,ko,i),p(e,Re,i),p(e,Zo,i),p(e,Ge,i),p(e,Uo,i),p(e,De,i),p(e,zo,i),p(e,re,i),p(e,Wo,i),p(e,Qe,i),p(e,No,i),p(e,Ae,i),p(e,Vo,i),p(e,X,i),s(X,ae),s(ae,mo),v(Ye,mo,null),s(X,bn),s(X,Zt),p(e,Bo,i),p(e,Oe,i),p(e,Eo,i),v(Ke,e,i),p(e,Fo,i),p(e,et,i),p(e,qo,i),p(e,R,i),s(R,ie),s(ie,go),v(tt,go,null),s(R,Cn),s(R,Ut),p(e,Ho,i),p(e,S,i),v(ot,S,null),s(S,Mn),s(S,zt),s(S,Tn),s(S,Wt),s(S,In),v(le,S,null),s(S,wn),s(S,de),v(nt,de,null),s(de,$n),s(de,Nt),p(e,Xo,i),p(e,G,i),s(G,ce),s(ce,fo),v(st,fo,null),s(G,Sn),s(G,Vt),p(e,Ro,i),p(e,j,i),v(rt,j,null),s(j,Pn),s(j,Bt),s(j,xn),s(j,Et),s(j,Ln),v(pe,j,null),p(e,Go,i),p(e,D,i),s(D,me),s(me,ho),v(at,ho,null),s(D,jn),s(D,Ft),p(e,Do,i),p(e,J,i),v(it,J,null),s(J,Jn),s(J,qt),s(J,kn),s(J,Ht),s(J,Zn),v(ge,J,null),p(e,Qo,i),p(e,Q,i),s(Q,fe),s(fe,uo),v(lt,uo,null),s(Q,Un),s(Q,Xt),p(e,Ao,i),p(e,P,i),v(dt,P,null),s(P,zn),s(P,Rt),s(P,Wn),s(P,Gt),s(P,Nn),s(P,he),v(ct,he,null),s(he,Vn),s(he,Dt),s(P,Bn),s(P,ue),v(pt,ue,null),s(ue,En),s(ue,Qt),p(e,Yo,i),p(e,A,i),s(A,_e),s(_e,_o),v(mt,_o,null),s(A,Fn),s(A,At),p(e,Oo,i),p(e,x,i),v(gt,x,null),s(x,qn),s(x,Yt),s(x,Hn),s(x,U),v(ft,U,null),s(U,Xn),s(U,Ot),s(U,Rn),v(ve,U,null),s(U,Gn),v(ye,U,null),s(x,Dn),s(x,z),v(ht,z,null),s(z,Qn),s(z,Kt),s(z,An),v(be,z,null),s(z,Yn),v(Ce,z,null),s(x,On),s(x,W),v(ut,W,null),s(W,Kn),s(W,eo),s(W,es),v(Me,W,null),s(W,ts),v(Te,W,null),p(e,Ko,i),p(e,Y,i),s(Y,Ie),s(Ie,vo),v(_t,vo,null),s(Y,os),s(Y,to),p(e,en,i),p(e,O,i),v(vt,O,null),s(O,ns),s(O,N),v(yt,N,null),s(N,ss),s(N,oo),s(N,rs),v(we,N,null),s(N,as),v($e,N,null),p(e,tn,i),p(e,K,i),s(K,Se),s(Se,yo),v(bt,yo,null),s(K,is),s(K,no),p(e,on,i),p(e,ee,i),v(Ct,ee,null),s(ee,ls),s(ee,V),v(Mt,V,null),s(V,ds),s(V,so),s(V,cs),v(Pe,V,null),s(V,ps),v(xe,V,null),p(e,nn,i),p(e,te,i),s(te,Le),s(Le,bo),v(Tt,bo,null),s(te,ms),s(te,ro),p(e,sn,i),p(e,k,i),v(It,k,null),s(k,gs),s(k,ao),s(k,fs),s(k,io),s(k,hs),s(k,B),v(wt,B,null),s(B,us),s(B,lo),s(B,_s),v(je,B,null),s(B,vs),v(Je,B,null),p(e,rn,i),p(e,Co,i),an=!0},p(e,[i]){const $t={};i&2&&($t.$$scope={dirty:i,ctx:e}),le.$set($t);const Mo={};i&2&&(Mo.$$scope={dirty:i,ctx:e}),pe.$set(Mo);const To={};i&2&&(To.$$scope={dirty:i,ctx:e}),ge.$set(To);const St={};i&2&&(St.$$scope={dirty:i,ctx:e}),ve.$set(St);const Io={};i&2&&(Io.$$scope={dirty:i,ctx:e}),ye.$set(Io);const wo={};i&2&&(wo.$$scope={dirty:i,ctx:e}),be.$set(wo);const Pt={};i&2&&(Pt.$$scope={dirty:i,ctx:e}),Ce.$set(Pt);const $o={};i&2&&($o.$$scope={dirty:i,ctx:e}),Me.$set($o);const So={};i&2&&(So.$$scope={dirty:i,ctx:e}),Te.$set(So);const xt={};i&2&&(xt.$$scope={dirty:i,ctx:e}),we.$set(xt);const Po={};i&2&&(Po.$$scope={dirty:i,ctx:e}),$e.$set(Po);const xo={};i&2&&(xo.$$scope={dirty:i,ctx:e}),Pe.$set(xo);const Z={};i&2&&(Z.$$scope={dirty:i,ctx:e}),xe.$set(Z);const Lt={};i&2&&(Lt.$$scope={dirty:i,ctx:e}),je.$set(Lt);const jt={};i&2&&(jt.$$scope={dirty:i,ctx:e}),Je.$set(jt)},i(e){an||(y(Fe.$$.fragment,e),y(qe.$$.fragment,e),y(Ye.$$.fragment,e),y(Ke.$$.fragment,e),y(tt.$$.fragment,e),y(ot.$$.fragment,e),y(le.$$.fragment,e),y(nt.$$.fragment,e),y(st.$$.fragment,e),y(rt.$$.fragment,e),y(pe.$$.fragment,e),y(at.$$.fragment,e),y(it.$$.fragment,e),y(ge.$$.fragment,e),y(lt.$$.fragment,e),y(dt.$$.fragment,e),y(ct.$$.fragment,e),y(pt.$$.fragment,e),y(mt.$$.fragment,e),y(gt.$$.fragment,e),y(ft.$$.fragment,e),y(ve.$$.fragment,e),y(ye.$$.fragment,e),y(ht.$$.fragment,e),y(be.$$.fragment,e),y(Ce.$$.fragment,e),y(ut.$$.fragment,e),y(Me.$$.fragment,e),y(Te.$$.fragment,e),y(_t.$$.fragment,e),y(vt.$$.fragment,e),y(yt.$$.fragment,e),y(we.$$.fragment,e),y($e.$$.fragment,e),y(bt.$$.fragment,e),y(Ct.$$.fragment,e),y(Mt.$$.fragment,e),y(Pe.$$.fragment,e),y(xe.$$.fragment,e),y(Tt.$$.fragment,e),y(It.$$.fragment,e),y(wt.$$.fragment,e),y(je.$$.fragment,e),y(Je.$$.fragment,e),an=!0)},o(e){b(Fe.$$.fragment,e),b(qe.$$.fragment,e),b(Ye.$$.fragment,e),b(Ke.$$.fragment,e),b(tt.$$.fragment,e),b(ot.$$.fragment,e),b(le.$$.fragment,e),b(nt.$$.fragment,e),b(st.$$.fragment,e),b(rt.$$.fragment,e),b(pe.$$.fragment,e),b(at.$$.fragment,e),b(it.$$.fragment,e),b(ge.$$.fragment,e),b(lt.$$.fragment,e),b(dt.$$.fragment,e),b(ct.$$.fragment,e),b(pt.$$.fragment,e),b(mt.$$.fragment,e),b(gt.$$.fragment,e),b(ft.$$.fragment,e),b(ve.$$.fragment,e),b(ye.$$.fragment,e),b(ht.$$.fragment,e),b(be.$$.fragment,e),b(Ce.$$.fragment,e),b(ut.$$.fragment,e),b(Me.$$.fragment,e),b(Te.$$.fragment,e),b(_t.$$.fragment,e),b(vt.$$.fragment,e),b(yt.$$.fragment,e),b(we.$$.fragment,e),b($e.$$.fragment,e),b(bt.$$.fragment,e),b(Ct.$$.fragment,e),b(Mt.$$.fragment,e),b(Pe.$$.fragment,e),b(xe.$$.fragment,e),b(Tt.$$.fragment,e),b(It.$$.fragment,e),b(wt.$$.fragment,e),b(je.$$.fragment,e),b(Je.$$.fragment,e),an=!1},d(e){e&&(o(T),o(m),o(c),o(h),o(Lo),o(H),o(jo),o(He),o(Jo),o(Xe),o(ko),o(Re),o(Zo),o(Ge),o(Uo),o(De),o(zo),o(re),o(Wo),o(Qe),o(No),o(Ae),o(Vo),o(X),o(Bo),o(Oe),o(Eo),o(Fo),o(et),o(qo),o(R),o(Ho),o(S),o(Xo),o(G),o(Ro),o(j),o(Go),o(D),o(Do),o(J),o(Qo),o(Q),o(Ao),o(P),o(Yo),o(A),o(Oo),o(x),o(Ko),o(Y),o(en),o(O),o(tn),o(K),o(on),o(ee),o(nn),o(te),o(sn),o(k),o(rn),o(Co)),o(n),C(Fe),C(qe),C(Ye),C(Ke,e),C(tt),C(ot),C(le),C(nt),C(st),C(rt),C(pe),C(at),C(it),C(ge),C(lt),C(dt),C(ct),C(pt),C(mt),C(gt),C(ft),C(ve),C(ye),C(ht),C(be),C(Ce),C(ut),C(Me),C(Te),C(_t),C(vt),C(yt),C(we),C($e),C(bt),C(Ct),C(Mt),C(Pe),C(xe),C(Tt),C(It),C(wt),C(je),C(Je)}}}const qr={local:"clipseg",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.CLIPSegConfig",title:"CLIPSegConfig"},{local:"transformers.CLIPSegTextConfig",title:"CLIPSegTextConfig"},{local:"transformers.CLIPSegVisionConfig",title:"CLIPSegVisionConfig"},{local:"transformers.CLIPSegProcessor",title:"CLIPSegProcessor"},{local:"transformers.CLIPSegModel",title:"CLIPSegModel"},{local:"transformers.CLIPSegTextModel",title:"CLIPSegTextModel"},{local:"transformers.CLIPSegVisionModel",title:"CLIPSegVisionModel"},{local:"transformers.CLIPSegForImageSegmentation",title:"CLIPSegForImageSegmentation"}],title:"CLIPSeg"};function Hr(w){return Mr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Kr extends Tr{constructor(n){super(),Ir(this,n,Hr,Fr,br,{})}}export{Kr as component};
