Buckets:

HuggingFaceDocBuilder's picture
download
raw
112 kB
import{s as On,b as es,o as ts,n as G}from"../chunks/scheduler.31fdf58d.js";import{S as os,i as ns,e as m,s as a,c as f,h as ss,a as p,d as s,b as r,f as P,j as M,g as h,k as I,l as i,m as d,n as u,t as _,o as T,p as b}from"../chunks/index.2f76fdf0.js";import{T as uo}from"../chunks/Tip.8d349121.js";import{C as as}from"../chunks/CopyLLMTxtMenu.53b607bf.js";import{D as j}from"../chunks/Docstring.7acc6835.js";import{C as se}from"../chunks/CodeBlock.e52df5d6.js";import{E as ne}from"../chunks/ExampleCodeBlock.f9704f52.js";import{P as rs}from"../chunks/PipelineTag.37119c44.js";import{H as Q,E as is}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.08750ec0.js";function ls(v){let o,y="Example:",c,l,g;return l=new se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBTZWdDb25maWclMkMlMjBDTElQU2VnTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMHdpdGglMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDTElQU2VnQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ01vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMGZyb20lMjBhJTIwQ0xJUFNlZ1RleHRDb25maWclMjBhbmQlMjBhJTIwQ0xJUFNlZ1Zpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQU2VnVGV4dCUyMGFuZCUyMENMSVBTZWdWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQU2VnVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBTZWdWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBTZWdDb25maWcodGV4dF9jb25maWclM0Rjb25maWdfdGV4dCUyQyUyMHZpc2lvbl9jb25maWclM0Rjb25maWdfdmlzaW9uKQ==",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(text_config=config_text, vision_config=config_vision)`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-11lpom8"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function ds(v){let o,y="Example:",c,l,g;return l=new se({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`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-11lpom8"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function cs(v){let o,y="Example:",c,l,g;return l=new se({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`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-11lpom8"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function ms(v){let o,y=`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(){o=m("p"),o.innerHTML=y},l(c){o=p(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-fincs2"&&(o.innerHTML=y)},m(c,l){d(c,o,l)},p:G,d(c){c&&s(o)}}}function ps(v){let o,y="Examples:",c,l,g;return l=new se({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMuaW1hZ2VfdXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEFtb2RlbCUyMCUzRCUyMENMSVBTZWdNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQXdpdGglMjB0b3JjaC5pbmZlcmVuY2VfbW9kZSgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image
<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 = load_image(url)
<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><span class="hljs-keyword">with</span> torch.inference_mode():
<span class="hljs-meta">... </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>`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function gs(v){let o,y="Examples:",c,l,g;return l=new se({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMENMSVBTZWdNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2guaW5mZXJlbmNlX21vZGUoKSUzQSUwQSUyMCUyMCUyMCUyMHRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">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><span class="hljs-keyword">with</span> torch.inference_mode():
<span class="hljs-meta">... </span> text_features = model.get_text_features(**inputs)`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function fs(v){let o,y="Examples:",c,l,g;return l=new se({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMuaW1hZ2VfdXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEFtb2RlbCUyMCUzRCUyMENMSVBTZWdNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5pbmZlcmVuY2VfbW9kZSgpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfaW1hZ2VfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image
<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 = load_image(url)
<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><span class="hljs-keyword">with</span> torch.inference_mode():
<span class="hljs-meta">... </span> image_features = model.get_image_features(**inputs)`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function hs(v){let o,y=`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(){o=m("p"),o.innerHTML=y},l(c){o=p(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-fincs2"&&(o.innerHTML=y)},m(c,l){d(c,o,l)},p:G,d(c){c&&s(o)}}}function us(v){let o,y="Examples:",c,l,g;return l=new se({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>`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function _s(v){let o,y=`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(){o=m("p"),o.innerHTML=y},l(c){o=p(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-fincs2"&&(o.innerHTML=y)},m(c,l){d(c,o,l)},p:G,d(c){c&&s(o)}}}function Ts(v){let o,y="Examples:",c,l,g;return l=new se({props:{code:"aW1wb3J0JTIwaHR0cHglMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBDTElQU2VnVmlzaW9uTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJDSURBUyUyRmNsaXBzZWctcmQ2NC1yZWZpbmVkJTIyKSUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ1Zpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJDSURBUyUyRmNsaXBzZWctcmQ2NC1yZWZpbmVkJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEF3aXRoJTIwaHR0cHguc3RyZWFtKCUyMkdFVCUyMiUyQyUyMHVybCklMjBhcyUyMHJlc3BvbnNlJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UucmVhZCgpKSklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> httpx
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<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">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><span class="hljs-keyword">with</span> httpx.stream(<span class="hljs-string">&quot;GET&quot;</span>, url) <span class="hljs-keyword">as</span> response:
<span class="hljs-meta">... </span> image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.read()))
<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>`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function bs(v){let o,y=`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(){o=m("p"),o.innerHTML=y},l(c){o=p(c,"P",{"data-svelte-h":!0}),M(o)!=="svelte-fincs2"&&(o.innerHTML=y)},m(c,l){d(c,o,l)},p:G,d(c){c&&s(o)}}}function Ms(v){let o,y="Examples:",c,l,g;return l=new se({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdGb3JJbWFnZVNlZ21lbnRhdGlvbiUwQWZyb20lMjB0cmFuc2Zvcm1lcnMuaW1hZ2VfdXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEFtb2RlbCUyMCUzRCUyMENMSVBTZWdGb3JJbWFnZVNlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyQ0lEQVMlMkZjbGlwc2VnLXJkNjQtcmVmaW5lZCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKHVybCklMEElMEF0ZXh0cyUyMCUzRCUyMCU1QiUyMmElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcmVtb3RlJTIyJTJDJTIwJTIyYSUyMGJsYW5rZXQlMjIlNUQlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRHRleHRzJTJDJTIwaW1hZ2VzJTNEJTVCaW1hZ2UlNUQlMjAqJTIwbGVuKHRleHRzKSUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2guaW5mZXJlbmNlX21vZGUoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQXByaW50KGxvZ2l0cy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">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> transformers.image_utils <span class="hljs-keyword">import</span> load_image
<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 = load_image(url)
<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><span class="hljs-keyword">with</span> torch.inference_mode():
<span class="hljs-meta">... </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>])`,lang:"python",wrap:!1}}),{c(){o=m("p"),o.textContent=y,c=a(),f(l.$$.fragment)},l(t){o=p(t,"P",{"data-svelte-h":!0}),M(o)!=="svelte-kvfsh7"&&(o.textContent=y),c=r(t),h(l.$$.fragment,t)},m(t,C){d(t,o,C),d(t,c,C),u(l,t,C),g=!0},p:G,i(t){g||(_(l.$$.fragment,t),g=!0)},o(t){T(l.$$.fragment,t),g=!1},d(t){t&&(s(o),s(c)),b(l,t)}}}function ys(v){let o,y,c,l,g,t="<em>This model was published in HF papers on 2021-12-18 and contributed to Hugging Face Transformers on 2022-11-08.</em>",C,be,Zt,Me,Bt,ye,Vt,Ce,fn=`The CLIPSeg model was proposed in <a href="https://huggingface.co/papers/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-shot and one-shot image segmentation.`,Nt,ve,hn="The abstract from the paper is the following:",Wt,Ie,un=`<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>`,Ft,ae,_n,Et,we,Tn='CLIPSeg overview. Taken from the <a href="https://huggingface.co/papers/2112.10003">original paper.</a>',Ht,$e,bn=`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>.`,Rt,Pe,Gt,xe,Mn=`<li><a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation">CLIPSegForImageSegmentation</a> adds a decoder on top of <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>. The latter is identical to <a href="/docs/transformers/pr_43265/en/model_doc/clip#transformers.CLIPModel">CLIPModel</a>.</li> <li><a href="/docs/transformers/pr_43265/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>`,Qt,Le,Xt,Se,yn="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.",qt,je,Dt,ke,Cn='<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>',At,Je,Yt,Z,Ue,_o,nt,vn=`This is the configuration class to store the configuration of a CLIPSegModel. It is used to instantiate a 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 <a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a>`,To,st,In=`Configuration objects inherit from <a href="/docs/transformers/pr_43265/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/pr_43265/en/main_classes/configuration#transformers.PreTrainedConfig">PreTrainedConfig</a> for more information.`,bo,re,Kt,ze,Ot,B,Ze,Mo,at,wn=`This is the configuration class to store the configuration of a CLIPSegModel. It is used to instantiate a 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 <a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a>`,yo,rt,$n=`Configuration objects inherit from <a href="/docs/transformers/pr_43265/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/pr_43265/en/main_classes/configuration#transformers.PreTrainedConfig">PreTrainedConfig</a> for more information.`,Co,ie,eo,Be,to,V,Ve,vo,it,Pn=`This is the configuration class to store the configuration of a CLIPSegModel. It is used to instantiate a 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 <a href="https://huggingface.co/CIDAS/clipseg-rd64" rel="nofollow">CIDAS/clipseg-rd64</a>`,Io,lt,xn=`Configuration objects inherit from <a href="/docs/transformers/pr_43265/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/pr_43265/en/main_classes/configuration#transformers.PreTrainedConfig">PreTrainedConfig</a> for more information.`,wo,le,oo,Ne,no,N,We,$o,dt,Ln="Constructs a CLIPSegProcessor which wraps a image processor and a tokenizer into a single processor.",Po,ct,Sn=`<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/pr_43265/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>. See the
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">~ViTImageProcessor</a> and <a href="/docs/transformers/pr_43265/en/model_doc/clip#transformers.CLIPTokenizer">~CLIPTokenizer</a> for more information.`,xo,mt,Fe,so,Ee,ao,w,He,Lo,pt,jn="The bare Clipseg Model outputting raw hidden-states without any specific head on top.",So,gt,kn=`This model inherits from <a href="/docs/transformers/pr_43265/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,jo,ft,Jn=`This model is also 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.`,ko,k,Re,Jo,ht,Un='The <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a> forward method, overrides the <code>__call__</code> special method.',Uo,de,zo,ut,zn=`<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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a>.</li> <li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> 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/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a>.</li> <li><strong>text_model_output</strong> (<code>~modeling_outputs.BaseModelOutputWithPooling</code>, <em>optional</em>) — The output of the <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a>.</li> <li><strong>vision_model_output</strong> (<code>~modeling_outputs.BaseModelOutputWithPooling</code>, <em>optional</em>) — The output of the <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a>.</li>`,Zo,ce,Bo,Y,Ge,Vo,_t,Zn=`<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>`,No,me,Wo,K,Qe,Fo,Tt,Bn=`<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>`,Eo,pe,ro,Xe,io,x,qe,Ho,bt,Vn="The text model from CLIPSEG without any head or projection on top.",Ro,Mt,Nn=`This model inherits from <a href="/docs/transformers/pr_43265/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Go,yt,Wn=`This model is also 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.`,Qo,J,De,Xo,Ct,Fn='The <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a> forward method, overrides the <code>__call__</code> special method.',qo,ge,Do,vt,En=`<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>`,Ao,fe,lo,Ae,co,L,Ye,Yo,It,Hn="The vision model from CLIPSEG without any head or projection on top.",Ko,wt,Rn=`This model inherits from <a href="/docs/transformers/pr_43265/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Oo,$t,Gn=`This model is also 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.`,en,U,Ke,tn,Pt,Qn='The <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a> forward method, overrides the <code>__call__</code> special method.',on,he,nn,xt,Xn=`<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>`,sn,ue,mo,Oe,po,S,et,an,Lt,qn="CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation.",rn,St,Dn=`This model inherits from <a href="/docs/transformers/pr_43265/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ln,jt,An=`This model is also 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.`,dn,z,tt,cn,kt,Yn='The <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation">CLIPSegForImageSegmentation</a> forward method, overrides the <code>__call__</code> special method.',mn,_e,pn,Jt,Kn=`<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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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</strong> (<code>torch.FloatTensor</code> 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/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a>.</li> <li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> 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/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a>.</li> <li><strong>text_model_output</strong> (<code>~modeling_outputs.BaseModelOutputWithPooling</code>, <em>optional</em>) — The output of the <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextModel">CLIPSegTextModel</a>.</li> <li><strong>vision_model_output</strong> (<code>~modeling_outputs.BaseModelOutputWithPooling</code>, <em>optional</em>) — The output of the <a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionModel">CLIPSegVisionModel</a>.</li>`,gn,Te,go,ot,fo,Ut,ho;return be=new as({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),Me=new Q({props:{title:"CLIPSeg",local:"clipseg",headingTag:"h1"}}),ye=new Q({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Pe=new Q({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),Le=new Q({props:{title:"Resources",local:"resources",headingTag:"h2"}}),je=new rs({props:{pipeline:"image-segmentation"}}),Je=new Q({props:{title:"CLIPSegConfig",local:"transformers.CLIPSegConfig",headingTag:"h2"}}),Ue=new j({props:{name:"class transformers.CLIPSegConfig",anchor:"transformers.CLIPSegConfig",parameters:[{name:"transformers_version",val:": str | None = None"},{name:"architectures",val:": list[str] | None = None"},{name:"output_hidden_states",val:": bool | None = False"},{name:"return_dict",val:": bool | None = True"},{name:"dtype",val:": typing.Union[str, ForwardRef('torch.dtype'), NoneType] = None"},{name:"chunk_size_feed_forward",val:": int = 0"},{name:"is_encoder_decoder",val:": bool = False"},{name:"id2label",val:": dict[int, str] | dict[str, str] | None = None"},{name:"label2id",val:": dict[str, int] | dict[str, str] | None = None"},{name:"problem_type",val:": typing.Optional[typing.Literal['regression', 'single_label_classification', 'multi_label_classification']] = None"},{name:"text_config",val:": dict | transformers.models.clipseg.configuration_clipseg.CLIPSegTextConfig | None = None"},{name:"vision_config",val:": dict | transformers.models.clipseg.configuration_clipseg.CLIPSegVisionConfig | None = None"},{name:"projection_dim",val:": int | None = 512"},{name:"logit_scale_init_value",val:": float | int | None = 2.6592"},{name:"initializer_factor",val:": float | None = 1.0"},{name:"extract_layers",val:": list[int] | tuple[int, ...] = (3, 6, 9)"},{name:"reduce_dim",val:": int = 64"},{name:"decoder_num_attention_heads",val:": int = 4"},{name:"decoder_attention_dropout",val:": float | int = 0.0"},{name:"decoder_hidden_act",val:": str = 'quick_gelu'"},{name:"decoder_intermediate_size",val:": int = 2048"},{name:"conditional_layer",val:": int = 0"},{name:"use_complex_transposed_convolution",val:": bool = False"}],parametersDescription:[{anchor:"transformers.CLIPSegConfig.text_config",description:`<strong>text_config</strong> (<code>Union[dict, ~models.clipseg.configuration_clipseg.CLIPSegTextConfig]</code>, <em>optional</em>) &#x2014;
The config object or dictionary of the text backbone.`,name:"text_config"},{anchor:"transformers.CLIPSegConfig.vision_config",description:`<strong>vision_config</strong> (<code>Union[dict, ~models.clipseg.configuration_clipseg.CLIPSegVisionConfig]</code>, <em>optional</em>) &#x2014;
The config object or dictionary of the vision backbone.`,name:"vision_config"},{anchor:"transformers.CLIPSegConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) &#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>Union[float, int]</code>, <em>optional</em>, defaults to <code>2.6592</code>) &#x2014;
The initial value of the <em>logit_scale</em> parameter.`,name:"logit_scale_init_value"},{anchor:"transformers.CLIPSegConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.CLIPSegConfig.extract_layers",description:`<strong>extract_layers</strong> (<code>list[int]</code>, <em>optional</em>, defaults to <code>[3, 6, 9]</code>) &#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 <code>4</code>) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_num_attention_heads"},{anchor:"transformers.CLIPSegConfig.decoder_attention_dropout",description:`<strong>decoder_attention_dropout</strong> (<code>Union[float, int]</code>, <em>optional</em>, defaults to <code>0.0</code>) &#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>, <em>optional</em>, defaults to <code>quick_gelu</code>) &#x2014;
The non-linear activation function (function or string) in the decoder. For example, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code>, etc.`,name:"decoder_hidden_act"},{anchor:"transformers.CLIPSegConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>2048</code>) &#x2014;
Dimension of the MLP representations.`,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"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/configuration_clipseg.py#L124"}}),re=new ne({props:{anchor:"transformers.CLIPSegConfig.example",$$slots:{default:[ls]},$$scope:{ctx:v}}}),ze=new Q({props:{title:"CLIPSegTextConfig",local:"transformers.CLIPSegTextConfig",headingTag:"h2"}}),Ze=new j({props:{name:"class transformers.CLIPSegTextConfig",anchor:"transformers.CLIPSegTextConfig",parameters:[{name:"transformers_version",val:": str | None = None"},{name:"architectures",val:": list[str] | None = None"},{name:"output_hidden_states",val:": bool | None = False"},{name:"return_dict",val:": bool | None = True"},{name:"dtype",val:": typing.Union[str, ForwardRef('torch.dtype'), NoneType] = None"},{name:"chunk_size_feed_forward",val:": int = 0"},{name:"is_encoder_decoder",val:": bool = False"},{name:"id2label",val:": dict[int, str] | dict[str, str] | None = None"},{name:"label2id",val:": dict[str, int] | dict[str, str] | None = None"},{name:"problem_type",val:": typing.Optional[typing.Literal['regression', 'single_label_classification', 'multi_label_classification']] = None"},{name:"vocab_size",val:": int = 49408"},{name:"hidden_size",val:": int = 512"},{name:"intermediate_size",val:": int = 2048"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 8"},{name:"max_position_embeddings",val:": int = 77"},{name:"hidden_act",val:": str = 'quick_gelu'"},{name:"layer_norm_eps",val:": float | None = 1e-05"},{name:"attention_dropout",val:": int | float | None = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"initializer_factor",val:": float | None = 1.0"},{name:"pad_token_id",val:": int | None = 1"},{name:"bos_token_id",val:": int | None = 49406"},{name:"eos_token_id",val:": int | list[int] | None = 49407"}],parametersDescription:[{anchor:"transformers.CLIPSegTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>49408</code>) &#x2014;
Vocabulary size of the model. Defines the number of different tokens that can be represented by the <code>input_ids</code>.`,name:"vocab_size"},{anchor:"transformers.CLIPSegTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>512</code>) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.CLIPSegTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>2048</code>) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to <code>12</code>) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to <code>8</code>) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to <code>77</code>) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.CLIPSegTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>quick_gelu</code>) &#x2014;
The non-linear activation function (function or string) in the decoder. For example, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code>, etc.`,name:"hidden_act"},{anchor:"transformers.CLIPSegTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1e-05</code>) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>Union[int, float]</code>, <em>optional</em>, defaults to <code>0.0</code>) &#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 <code>0.02</code>) &#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> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.CLIPSegTextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Token id used for padding in the vocabulary.`,name:"pad_token_id"},{anchor:"transformers.CLIPSegTextConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to <code>49406</code>) &#x2014;
Token id used for beginning-of-stream in the vocabulary.`,name:"bos_token_id"},{anchor:"transformers.CLIPSegTextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>Union[int, list[int]]</code>, <em>optional</em>, defaults to <code>49407</code>) &#x2014;
Token id used for end-of-stream in the vocabulary.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/configuration_clipseg.py#L31"}}),ie=new ne({props:{anchor:"transformers.CLIPSegTextConfig.example",$$slots:{default:[ds]},$$scope:{ctx:v}}}),Be=new Q({props:{title:"CLIPSegVisionConfig",local:"transformers.CLIPSegVisionConfig",headingTag:"h2"}}),Ve=new j({props:{name:"class transformers.CLIPSegVisionConfig",anchor:"transformers.CLIPSegVisionConfig",parameters:[{name:"transformers_version",val:": str | None = None"},{name:"architectures",val:": list[str] | None = None"},{name:"output_hidden_states",val:": bool | None = False"},{name:"return_dict",val:": bool | None = True"},{name:"dtype",val:": typing.Union[str, ForwardRef('torch.dtype'), NoneType] = None"},{name:"chunk_size_feed_forward",val:": int = 0"},{name:"is_encoder_decoder",val:": bool = False"},{name:"id2label",val:": dict[int, str] | dict[str, str] | None = None"},{name:"label2id",val:": dict[str, int] | dict[str, str] | None = None"},{name:"problem_type",val:": typing.Optional[typing.Literal['regression', 'single_label_classification', 'multi_label_classification']] = None"},{name:"hidden_size",val:": int = 768"},{name:"intermediate_size",val:": int = 3072"},{name:"num_hidden_layers",val:": int = 12"},{name:"num_attention_heads",val:": int = 12"},{name:"num_channels",val:": int = 3"},{name:"image_size",val:": int | list[int] | tuple[int, int] | None = 224"},{name:"patch_size",val:": int | list[int] | tuple[int, int] | None = 32"},{name:"hidden_act",val:": str = 'quick_gelu'"},{name:"layer_norm_eps",val:": float = 1e-05"},{name:"attention_dropout",val:": int | float | None = 0.0"},{name:"initializer_range",val:": float = 0.02"},{name:"initializer_factor",val:": float = 1.0"}],parametersDescription:[{anchor:"transformers.CLIPSegVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>768</code>) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.CLIPSegVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3072</code>) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to <code>12</code>) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to <code>12</code>) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3</code>) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.CLIPSegVisionConfig.image_size",description:`<strong>image_size</strong> (<code>Union[int, list[int], tuple[int, int]]</code>, <em>optional</em>, defaults to <code>224</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.CLIPSegVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>Union[int, list[int], tuple[int, int]]</code>, <em>optional</em>, defaults to <code>32</code>) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.CLIPSegVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>quick_gelu</code>) &#x2014;
The non-linear activation function (function or string) in the decoder. For example, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code>, etc.`,name:"hidden_act"},{anchor:"transformers.CLIPSegVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1e-05</code>) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>Union[int, float]</code>, <em>optional</em>, defaults to <code>0.0</code>) &#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 <code>0.02</code>) &#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> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) &#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/vr_43265/src/transformers/models/clipseg/configuration_clipseg.py#L80"}}),le=new ne({props:{anchor:"transformers.CLIPSegVisionConfig.example",$$slots:{default:[cs]},$$scope:{ctx:v}}}),Ne=new Q({props:{title:"CLIPSegProcessor",local:"transformers.CLIPSegProcessor",headingTag:"h2"}}),We=new j({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> (<code>ViTImageProcessor</code>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPSegProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/processing_clipseg.py#L24"}}),Fe=new j({props:{name:"__call__",anchor:"transformers.CLIPSegProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"images",val:" = None"},{name:"visual_prompt",val:" = None"},{name:"return_tensors",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegProcessor.__call__.text",description:"<strong>text</strong> (`<code>) -- The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings (pretokenized string). If you pass a pretokenized input, set </code>is_split_into_words=True` to avoid ambiguity with batched inputs.",name:"text"},{anchor:"transformers.CLIPSegProcessor.__call__.images",description:"<strong>images</strong> (`<code>) -- Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If passing in images with pixel values between 0 and 1, set </code>do_rescale=False`.",name:"images"},{anchor:"transformers.CLIPSegProcessor.__call__.visual_prompt",description:`<strong>visual_prompt</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>list[PIL.Image.Image]</code>, <code>list[np.ndarray]</code>, <code>list[torch.Tensor]</code>) &#x2014;
The visual prompt image or batch of images to be prepared. Each visual prompt image can be a PIL image,
NumPy array or PyTorch tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape
(C, H, W), where C is a number of channels, H and W are image height and width.`,name:"visual_prompt"},{anchor:"transformers.CLIPSegProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (&#x201C;) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/processing_clipseg.py#L28",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_43265/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li><strong>input_ids</strong> — List of token ids to be fed to a model. Returned when <code>text</code> is not <code>None</code>.</li>
<li><strong>attention_mask</strong> — List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>“attention_mask”</em> is in <code>self.model_input_names</code> and if <code>text</code> is not
<code>None</code>).</li>
<li><strong>pixel_values</strong> — Pixel values to be fed to a model. Returned when <code>images</code> is not <code>None</code>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/transformers/pr_43265/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),Ee=new Q({props:{title:"CLIPSegModel",local:"transformers.CLIPSegModel",headingTag:"h2"}}),He=new j({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/pr_43265/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/pr_43265/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/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L789"}}),Re=new j({props:{name:"forward",anchor:"transformers.CLIPSegModel.forward",parameters:[{name:"input_ids",val:": torch.LongTensor | None = None"},{name:"pixel_values",val:": torch.FloatTensor | None = None"},{name:"attention_mask",val:": torch.Tensor | None = None"},{name:"position_ids",val:": torch.LongTensor | None = None"},{name:"return_loss",val:": bool | None = None"},{name:"interpolate_pos_encoding",val:": bool = True"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_43265/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See <code>ViTImageProcessor.__call__()</code> for details (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> uses
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> for processing images).`,name:"pixel_values"},{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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{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.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L883",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <code>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>CLIPSegOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new uo({props:{$$slots:{default:[ms]},$$scope:{ctx:v}}}),ce=new ne({props:{anchor:"transformers.CLIPSegModel.forward.example",$$slots:{default:[ps]},$$scope:{ctx:v}}}),Ge=new j({props:{name:"get_text_features",anchor:"transformers.CLIPSegModel.get_text_features",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": torch.Tensor | None = None"},{name:"position_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_43265/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L810",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),me=new ne({props:{anchor:"transformers.CLIPSegModel.get_text_features.example",$$slots:{default:[gs]},$$scope:{ctx:v}}}),Qe=new j({props:{name:"get_image_features",anchor:"transformers.CLIPSegModel.get_image_features",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"interpolate_pos_encoding",val:": bool = True"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],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, image_size, image_size)</code>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See <code>ViTImageProcessor.__call__()</code> for details (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> uses
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> for processing images).`,name:"pixel_values"},{anchor:"transformers.CLIPSegModel.get_image_features.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L845",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new ne({props:{anchor:"transformers.CLIPSegModel.get_image_features.example",$$slots:{default:[fs]},$$scope:{ctx:v}}}),Xe=new Q({props:{title:"CLIPSegTextModel",local:"transformers.CLIPSegTextModel",headingTag:"h2"}}),qe=new j({props:{name:"class transformers.CLIPSegTextModel",anchor:"transformers.CLIPSegTextModel",parameters:[{name:"config",val:": CLIPSegTextConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegTextConfig">CLIPSegTextConfig</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/pr_43265/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/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L600"}}),De=new j({props:{name:"forward",anchor:"transformers.CLIPSegTextModel.forward",parameters:[{name:"input_ids",val:": torch.Tensor | None = None"},{name:"attention_mask",val:": torch.Tensor | None = None"},{name:"position_ids",val:": torch.Tensor | None = None"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],parametersDescription:[{anchor:"transformers.CLIPSegTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_43265/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L616",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ge=new uo({props:{$$slots:{default:[hs]},$$scope:{ctx:v}}}),fe=new ne({props:{anchor:"transformers.CLIPSegTextModel.forward.example",$$slots:{default:[us]},$$scope:{ctx:v}}}),Ae=new Q({props:{title:"CLIPSegVisionModel",local:"transformers.CLIPSegVisionModel",headingTag:"h2"}}),Ye=new j({props:{name:"class transformers.CLIPSegVisionModel",anchor:"transformers.CLIPSegVisionModel",parameters:[{name:"config",val:": CLIPSegVisionConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegVisionConfig">CLIPSegVisionConfig</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/pr_43265/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/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L700"}}),Ke=new j({props:{name:"forward",anchor:"transformers.CLIPSegVisionModel.forward",parameters:[{name:"pixel_values",val:": torch.FloatTensor | None"},{name:"interpolate_pos_encoding",val:": bool | None = True"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],parametersDescription:[{anchor:"transformers.CLIPSegVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See <code>ViTImageProcessor.__call__()</code> for details (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> uses
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> for processing images).`,name:"pixel_values"},{anchor:"transformers.CLIPSegVisionModel.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L716",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><a
href="/docs/transformers/pr_43265/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new uo({props:{$$slots:{default:[_s]},$$scope:{ctx:v}}}),ue=new ne({props:{anchor:"transformers.CLIPSegVisionModel.forward.example",$$slots:{default:[Ts]},$$scope:{ctx:v}}}),Oe=new Q({props:{title:"CLIPSegForImageSegmentation",local:"transformers.CLIPSegForImageSegmentation",headingTag:"h2"}}),et=new j({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/pr_43265/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/pr_43265/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/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L967"}}),tt=new j({props:{name:"forward",anchor:"transformers.CLIPSegForImageSegmentation.forward",parameters:[{name:"input_ids",val:": torch.FloatTensor | None = None"},{name:"pixel_values",val:": torch.FloatTensor | None = None"},{name:"conditional_pixel_values",val:": torch.FloatTensor | None = None"},{name:"conditional_embeddings",val:": torch.FloatTensor | None = None"},{name:"attention_mask",val:": torch.Tensor | None = None"},{name:"position_ids",val:": torch.LongTensor | None = None"},{name:"labels",val:": torch.LongTensor | None = None"},{name:"interpolate_pos_encoding",val:": bool = True"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.utils.generic.TransformersKwargs]"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_43265/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_43265/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See <code>ViTImageProcessor.__call__()</code> for details (<a href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegProcessor">CLIPSegProcessor</a> uses
<a href="/docs/transformers/pr_43265/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> for processing images).`,name:"pixel_values"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.conditional_pixel_values",description:`<strong>conditional_pixel_values</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
The pixel values of the conditional images.`,name:"conditional_pixel_values"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.conditional_embeddings",description:`<strong>conditional_embeddings</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.projection_dim)</code>, <em>optional</em>) &#x2014;
The conditional embeddings for the query images. If provided, the model will use this instead of computing
the embeddings from the conditional_pixel_values.`,name:"conditional_embeddings"},{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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{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"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"}],source:"https://github.com/huggingface/transformers/blob/vr_43265/src/transformers/models/clipseg/modeling_clipseg.py#L1007",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <code>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 (<a
href="/docs/transformers/pr_43265/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a>) and inputs.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>CLIPSegOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new uo({props:{$$slots:{default:[bs]},$$scope:{ctx:v}}}),Te=new ne({props:{anchor:"transformers.CLIPSegForImageSegmentation.forward.example",$$slots:{default:[Ms]},$$scope:{ctx:v}}}),ot=new is({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/clipseg.md"}}),{c(){o=m("meta"),y=a(),c=m("p"),l=a(),g=m("p"),g.innerHTML=t,C=a(),f(be.$$.fragment),Zt=a(),f(Me.$$.fragment),Bt=a(),f(ye.$$.fragment),Vt=a(),Ce=m("p"),Ce.innerHTML=fn,Nt=a(),ve=m("p"),ve.textContent=hn,Wt=a(),Ie=m("p"),Ie.innerHTML=un,Ft=a(),ae=m("img"),Et=a(),we=m("small"),we.innerHTML=Tn,Ht=a(),$e=m("p"),$e.innerHTML=bn,Rt=a(),f(Pe.$$.fragment),Gt=a(),xe=m("ul"),xe.innerHTML=Mn,Qt=a(),f(Le.$$.fragment),Xt=a(),Se=m("p"),Se.textContent=yn,qt=a(),f(je.$$.fragment),Dt=a(),ke=m("ul"),ke.innerHTML=Cn,At=a(),f(Je.$$.fragment),Yt=a(),Z=m("div"),f(Ue.$$.fragment),_o=a(),nt=m("p"),nt.innerHTML=vn,To=a(),st=m("p"),st.innerHTML=In,bo=a(),f(re.$$.fragment),Kt=a(),f(ze.$$.fragment),Ot=a(),B=m("div"),f(Ze.$$.fragment),Mo=a(),at=m("p"),at.innerHTML=wn,yo=a(),rt=m("p"),rt.innerHTML=$n,Co=a(),f(ie.$$.fragment),eo=a(),f(Be.$$.fragment),to=a(),V=m("div"),f(Ve.$$.fragment),vo=a(),it=m("p"),it.innerHTML=Pn,Io=a(),lt=m("p"),lt.innerHTML=xn,wo=a(),f(le.$$.fragment),oo=a(),f(Ne.$$.fragment),no=a(),N=m("div"),f(We.$$.fragment),$o=a(),dt=m("p"),dt.textContent=Ln,Po=a(),ct=m("p"),ct.innerHTML=Sn,xo=a(),mt=m("div"),f(Fe.$$.fragment),so=a(),f(Ee.$$.fragment),ao=a(),w=m("div"),f(He.$$.fragment),Lo=a(),pt=m("p"),pt.textContent=jn,So=a(),gt=m("p"),gt.innerHTML=kn,jo=a(),ft=m("p"),ft.innerHTML=Jn,ko=a(),k=m("div"),f(Re.$$.fragment),Jo=a(),ht=m("p"),ht.innerHTML=Un,Uo=a(),f(de.$$.fragment),zo=a(),ut=m("ul"),ut.innerHTML=zn,Zo=a(),f(ce.$$.fragment),Bo=a(),Y=m("div"),f(Ge.$$.fragment),Vo=a(),_t=m("ul"),_t.innerHTML=Zn,No=a(),f(me.$$.fragment),Wo=a(),K=m("div"),f(Qe.$$.fragment),Fo=a(),Tt=m("ul"),Tt.innerHTML=Bn,Eo=a(),f(pe.$$.fragment),ro=a(),f(Xe.$$.fragment),io=a(),x=m("div"),f(qe.$$.fragment),Ho=a(),bt=m("p"),bt.textContent=Vn,Ro=a(),Mt=m("p"),Mt.innerHTML=Nn,Go=a(),yt=m("p"),yt.innerHTML=Wn,Qo=a(),J=m("div"),f(De.$$.fragment),Xo=a(),Ct=m("p"),Ct.innerHTML=Fn,qo=a(),f(ge.$$.fragment),Do=a(),vt=m("ul"),vt.innerHTML=En,Ao=a(),f(fe.$$.fragment),lo=a(),f(Ae.$$.fragment),co=a(),L=m("div"),f(Ye.$$.fragment),Yo=a(),It=m("p"),It.textContent=Hn,Ko=a(),wt=m("p"),wt.innerHTML=Rn,Oo=a(),$t=m("p"),$t.innerHTML=Gn,en=a(),U=m("div"),f(Ke.$$.fragment),tn=a(),Pt=m("p"),Pt.innerHTML=Qn,on=a(),f(he.$$.fragment),nn=a(),xt=m("ul"),xt.innerHTML=Xn,sn=a(),f(ue.$$.fragment),mo=a(),f(Oe.$$.fragment),po=a(),S=m("div"),f(et.$$.fragment),an=a(),Lt=m("p"),Lt.textContent=qn,rn=a(),St=m("p"),St.innerHTML=Dn,ln=a(),jt=m("p"),jt.innerHTML=An,dn=a(),z=m("div"),f(tt.$$.fragment),cn=a(),kt=m("p"),kt.innerHTML=Yn,mn=a(),f(_e.$$.fragment),pn=a(),Jt=m("ul"),Jt.innerHTML=Kn,gn=a(),f(Te.$$.fragment),go=a(),f(ot.$$.fragment),fo=a(),Ut=m("p"),this.h()},l(e){const n=ss("svelte-u9bgzb",document.head);o=p(n,"META",{name:!0,content:!0}),n.forEach(s),y=r(e),c=p(e,"P",{}),P(c).forEach(s),l=r(e),g=p(e,"P",{"data-svelte-h":!0}),M(g)!=="svelte-8uwfu9"&&(g.innerHTML=t),C=r(e),h(be.$$.fragment,e),Zt=r(e),h(Me.$$.fragment,e),Bt=r(e),h(ye.$$.fragment,e),Vt=r(e),Ce=p(e,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-krih9e"&&(Ce.innerHTML=fn),Nt=r(e),ve=p(e,"P",{"data-svelte-h":!0}),M(ve)!=="svelte-vfdo9a"&&(ve.textContent=hn),Wt=r(e),Ie=p(e,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-2767bu"&&(Ie.innerHTML=un),Ft=r(e),ae=p(e,"IMG",{src:!0,alt:!0,width:!0}),Et=r(e),we=p(e,"SMALL",{"data-svelte-h":!0}),M(we)!=="svelte-jxty9y"&&(we.innerHTML=Tn),Ht=r(e),$e=p(e,"P",{"data-svelte-h":!0}),M($e)!=="svelte-14bl8yt"&&($e.innerHTML=bn),Rt=r(e),h(Pe.$$.fragment,e),Gt=r(e),xe=p(e,"UL",{"data-svelte-h":!0}),M(xe)!=="svelte-1xk2lpt"&&(xe.innerHTML=Mn),Qt=r(e),h(Le.$$.fragment,e),Xt=r(e),Se=p(e,"P",{"data-svelte-h":!0}),M(Se)!=="svelte-i5etz8"&&(Se.textContent=yn),qt=r(e),h(je.$$.fragment,e),Dt=r(e),ke=p(e,"UL",{"data-svelte-h":!0}),M(ke)!=="svelte-ksa1e9"&&(ke.innerHTML=Cn),At=r(e),h(Je.$$.fragment,e),Yt=r(e),Z=p(e,"DIV",{class:!0});var X=P(Z);h(Ue.$$.fragment,X),_o=r(X),nt=p(X,"P",{"data-svelte-h":!0}),M(nt)!=="svelte-1teequ0"&&(nt.innerHTML=vn),To=r(X),st=p(X,"P",{"data-svelte-h":!0}),M(st)!=="svelte-1e8815j"&&(st.innerHTML=In),bo=r(X),h(re.$$.fragment,X),X.forEach(s),Kt=r(e),h(ze.$$.fragment,e),Ot=r(e),B=p(e,"DIV",{class:!0});var q=P(B);h(Ze.$$.fragment,q),Mo=r(q),at=p(q,"P",{"data-svelte-h":!0}),M(at)!=="svelte-1teequ0"&&(at.innerHTML=wn),yo=r(q),rt=p(q,"P",{"data-svelte-h":!0}),M(rt)!=="svelte-1e8815j"&&(rt.innerHTML=$n),Co=r(q),h(ie.$$.fragment,q),q.forEach(s),eo=r(e),h(Be.$$.fragment,e),to=r(e),V=p(e,"DIV",{class:!0});var D=P(V);h(Ve.$$.fragment,D),vo=r(D),it=p(D,"P",{"data-svelte-h":!0}),M(it)!=="svelte-1teequ0"&&(it.innerHTML=Pn),Io=r(D),lt=p(D,"P",{"data-svelte-h":!0}),M(lt)!=="svelte-1e8815j"&&(lt.innerHTML=xn),wo=r(D),h(le.$$.fragment,D),D.forEach(s),oo=r(e),h(Ne.$$.fragment,e),no=r(e),N=p(e,"DIV",{class:!0});var A=P(N);h(We.$$.fragment,A),$o=r(A),dt=p(A,"P",{"data-svelte-h":!0}),M(dt)!=="svelte-5b85r6"&&(dt.textContent=Ln),Po=r(A),ct=p(A,"P",{"data-svelte-h":!0}),M(ct)!=="svelte-16aahcd"&&(ct.innerHTML=Sn),xo=r(A),mt=p(A,"DIV",{class:!0});var zt=P(mt);h(Fe.$$.fragment,zt),zt.forEach(s),A.forEach(s),so=r(e),h(Ee.$$.fragment,e),ao=r(e),w=p(e,"DIV",{class:!0});var $=P(w);h(He.$$.fragment,$),Lo=r($),pt=p($,"P",{"data-svelte-h":!0}),M(pt)!=="svelte-9mbg47"&&(pt.textContent=jn),So=r($),gt=p($,"P",{"data-svelte-h":!0}),M(gt)!=="svelte-1gb3c10"&&(gt.innerHTML=kn),jo=r($),ft=p($,"P",{"data-svelte-h":!0}),M(ft)!=="svelte-hswkmf"&&(ft.innerHTML=Jn),ko=r($),k=p($,"DIV",{class:!0});var W=P(k);h(Re.$$.fragment,W),Jo=r(W),ht=p(W,"P",{"data-svelte-h":!0}),M(ht)!=="svelte-1g8ejeo"&&(ht.innerHTML=Un),Uo=r(W),h(de.$$.fragment,W),zo=r(W),ut=p(W,"UL",{"data-svelte-h":!0}),M(ut)!=="svelte-1u4bche"&&(ut.innerHTML=zn),Zo=r(W),h(ce.$$.fragment,W),W.forEach(s),Bo=r($),Y=p($,"DIV",{class:!0});var te=P(Y);h(Ge.$$.fragment,te),Vo=r(te),_t=p(te,"UL",{"data-svelte-h":!0}),M(_t)!=="svelte-1vt4ztn"&&(_t.innerHTML=Zn),No=r(te),h(me.$$.fragment,te),te.forEach(s),Wo=r($),K=p($,"DIV",{class:!0});var oe=P(K);h(Qe.$$.fragment,oe),Fo=r(oe),Tt=p(oe,"UL",{"data-svelte-h":!0}),M(Tt)!=="svelte-1vt4ztn"&&(Tt.innerHTML=Bn),Eo=r(oe),h(pe.$$.fragment,oe),oe.forEach(s),$.forEach(s),ro=r(e),h(Xe.$$.fragment,e),io=r(e),x=p(e,"DIV",{class:!0});var F=P(x);h(qe.$$.fragment,F),Ho=r(F),bt=p(F,"P",{"data-svelte-h":!0}),M(bt)!=="svelte-l3fi04"&&(bt.textContent=Vn),Ro=r(F),Mt=p(F,"P",{"data-svelte-h":!0}),M(Mt)!=="svelte-1gb3c10"&&(Mt.innerHTML=Nn),Go=r(F),yt=p(F,"P",{"data-svelte-h":!0}),M(yt)!=="svelte-hswkmf"&&(yt.innerHTML=Wn),Qo=r(F),J=p(F,"DIV",{class:!0});var E=P(J);h(De.$$.fragment,E),Xo=r(E),Ct=p(E,"P",{"data-svelte-h":!0}),M(Ct)!=="svelte-11i8i3y"&&(Ct.innerHTML=Fn),qo=r(E),h(ge.$$.fragment,E),Do=r(E),vt=p(E,"UL",{"data-svelte-h":!0}),M(vt)!=="svelte-1vt4ztn"&&(vt.innerHTML=En),Ao=r(E),h(fe.$$.fragment,E),E.forEach(s),F.forEach(s),lo=r(e),h(Ae.$$.fragment,e),co=r(e),L=p(e,"DIV",{class:!0});var H=P(L);h(Ye.$$.fragment,H),Yo=r(H),It=p(H,"P",{"data-svelte-h":!0}),M(It)!=="svelte-o299j1"&&(It.textContent=Hn),Ko=r(H),wt=p(H,"P",{"data-svelte-h":!0}),M(wt)!=="svelte-1gb3c10"&&(wt.innerHTML=Rn),Oo=r(H),$t=p(H,"P",{"data-svelte-h":!0}),M($t)!=="svelte-hswkmf"&&($t.innerHTML=Gn),en=r(H),U=p(H,"DIV",{class:!0});var R=P(U);h(Ke.$$.fragment,R),tn=r(R),Pt=p(R,"P",{"data-svelte-h":!0}),M(Pt)!=="svelte-dns4kw"&&(Pt.innerHTML=Qn),on=r(R),h(he.$$.fragment,R),nn=r(R),xt=p(R,"UL",{"data-svelte-h":!0}),M(xt)!=="svelte-1vt4ztn"&&(xt.innerHTML=Xn),sn=r(R),h(ue.$$.fragment,R),R.forEach(s),H.forEach(s),mo=r(e),h(Oe.$$.fragment,e),po=r(e),S=p(e,"DIV",{class:!0});var O=P(S);h(et.$$.fragment,O),an=r(O),Lt=p(O,"P",{"data-svelte-h":!0}),M(Lt)!=="svelte-qndran"&&(Lt.textContent=qn),rn=r(O),St=p(O,"P",{"data-svelte-h":!0}),M(St)!=="svelte-1gb3c10"&&(St.innerHTML=Dn),ln=r(O),jt=p(O,"P",{"data-svelte-h":!0}),M(jt)!=="svelte-hswkmf"&&(jt.innerHTML=An),dn=r(O),z=p(O,"DIV",{class:!0});var ee=P(z);h(tt.$$.fragment,ee),cn=r(ee),kt=p(ee,"P",{"data-svelte-h":!0}),M(kt)!=="svelte-7wwpfo"&&(kt.innerHTML=Yn),mn=r(ee),h(_e.$$.fragment,ee),pn=r(ee),Jt=p(ee,"UL",{"data-svelte-h":!0}),M(Jt)!=="svelte-1u4bche"&&(Jt.innerHTML=Kn),gn=r(ee),h(Te.$$.fragment,ee),ee.forEach(s),O.forEach(s),go=r(e),h(ot.$$.fragment,e),fo=r(e),Ut=p(e,"P",{}),P(Ut).forEach(s),this.h()},h(){I(o,"name","hf:doc:metadata"),I(o,"content",Cs),es(ae.src,_n="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/clipseg_architecture.png")||I(ae,"src",_n),I(ae,"alt","drawing"),I(ae,"width","600"),I(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(S,"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,n){i(document.head,o),d(e,y,n),d(e,c,n),d(e,l,n),d(e,g,n),d(e,C,n),u(be,e,n),d(e,Zt,n),u(Me,e,n),d(e,Bt,n),u(ye,e,n),d(e,Vt,n),d(e,Ce,n),d(e,Nt,n),d(e,ve,n),d(e,Wt,n),d(e,Ie,n),d(e,Ft,n),d(e,ae,n),d(e,Et,n),d(e,we,n),d(e,Ht,n),d(e,$e,n),d(e,Rt,n),u(Pe,e,n),d(e,Gt,n),d(e,xe,n),d(e,Qt,n),u(Le,e,n),d(e,Xt,n),d(e,Se,n),d(e,qt,n),u(je,e,n),d(e,Dt,n),d(e,ke,n),d(e,At,n),u(Je,e,n),d(e,Yt,n),d(e,Z,n),u(Ue,Z,null),i(Z,_o),i(Z,nt),i(Z,To),i(Z,st),i(Z,bo),u(re,Z,null),d(e,Kt,n),u(ze,e,n),d(e,Ot,n),d(e,B,n),u(Ze,B,null),i(B,Mo),i(B,at),i(B,yo),i(B,rt),i(B,Co),u(ie,B,null),d(e,eo,n),u(Be,e,n),d(e,to,n),d(e,V,n),u(Ve,V,null),i(V,vo),i(V,it),i(V,Io),i(V,lt),i(V,wo),u(le,V,null),d(e,oo,n),u(Ne,e,n),d(e,no,n),d(e,N,n),u(We,N,null),i(N,$o),i(N,dt),i(N,Po),i(N,ct),i(N,xo),i(N,mt),u(Fe,mt,null),d(e,so,n),u(Ee,e,n),d(e,ao,n),d(e,w,n),u(He,w,null),i(w,Lo),i(w,pt),i(w,So),i(w,gt),i(w,jo),i(w,ft),i(w,ko),i(w,k),u(Re,k,null),i(k,Jo),i(k,ht),i(k,Uo),u(de,k,null),i(k,zo),i(k,ut),i(k,Zo),u(ce,k,null),i(w,Bo),i(w,Y),u(Ge,Y,null),i(Y,Vo),i(Y,_t),i(Y,No),u(me,Y,null),i(w,Wo),i(w,K),u(Qe,K,null),i(K,Fo),i(K,Tt),i(K,Eo),u(pe,K,null),d(e,ro,n),u(Xe,e,n),d(e,io,n),d(e,x,n),u(qe,x,null),i(x,Ho),i(x,bt),i(x,Ro),i(x,Mt),i(x,Go),i(x,yt),i(x,Qo),i(x,J),u(De,J,null),i(J,Xo),i(J,Ct),i(J,qo),u(ge,J,null),i(J,Do),i(J,vt),i(J,Ao),u(fe,J,null),d(e,lo,n),u(Ae,e,n),d(e,co,n),d(e,L,n),u(Ye,L,null),i(L,Yo),i(L,It),i(L,Ko),i(L,wt),i(L,Oo),i(L,$t),i(L,en),i(L,U),u(Ke,U,null),i(U,tn),i(U,Pt),i(U,on),u(he,U,null),i(U,nn),i(U,xt),i(U,sn),u(ue,U,null),d(e,mo,n),u(Oe,e,n),d(e,po,n),d(e,S,n),u(et,S,null),i(S,an),i(S,Lt),i(S,rn),i(S,St),i(S,ln),i(S,jt),i(S,dn),i(S,z),u(tt,z,null),i(z,cn),i(z,kt),i(z,mn),u(_e,z,null),i(z,pn),i(z,Jt),i(z,gn),u(Te,z,null),d(e,go,n),u(ot,e,n),d(e,fo,n),d(e,Ut,n),ho=!0},p(e,[n]){const X={};n&2&&(X.$$scope={dirty:n,ctx:e}),re.$set(X);const q={};n&2&&(q.$$scope={dirty:n,ctx:e}),ie.$set(q);const D={};n&2&&(D.$$scope={dirty:n,ctx:e}),le.$set(D);const A={};n&2&&(A.$$scope={dirty:n,ctx:e}),de.$set(A);const zt={};n&2&&(zt.$$scope={dirty:n,ctx:e}),ce.$set(zt);const $={};n&2&&($.$$scope={dirty:n,ctx:e}),me.$set($);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),pe.$set(W);const te={};n&2&&(te.$$scope={dirty:n,ctx:e}),ge.$set(te);const oe={};n&2&&(oe.$$scope={dirty:n,ctx:e}),fe.$set(oe);const F={};n&2&&(F.$$scope={dirty:n,ctx:e}),he.$set(F);const E={};n&2&&(E.$$scope={dirty:n,ctx:e}),ue.$set(E);const H={};n&2&&(H.$$scope={dirty:n,ctx:e}),_e.$set(H);const R={};n&2&&(R.$$scope={dirty:n,ctx:e}),Te.$set(R)},i(e){ho||(_(be.$$.fragment,e),_(Me.$$.fragment,e),_(ye.$$.fragment,e),_(Pe.$$.fragment,e),_(Le.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(Ue.$$.fragment,e),_(re.$$.fragment,e),_(ze.$$.fragment,e),_(Ze.$$.fragment,e),_(ie.$$.fragment,e),_(Be.$$.fragment,e),_(Ve.$$.fragment,e),_(le.$$.fragment,e),_(Ne.$$.fragment,e),_(We.$$.fragment,e),_(Fe.$$.fragment,e),_(Ee.$$.fragment,e),_(He.$$.fragment,e),_(Re.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(Ge.$$.fragment,e),_(me.$$.fragment,e),_(Qe.$$.fragment,e),_(pe.$$.fragment,e),_(Xe.$$.fragment,e),_(qe.$$.fragment,e),_(De.$$.fragment,e),_(ge.$$.fragment,e),_(fe.$$.fragment,e),_(Ae.$$.fragment,e),_(Ye.$$.fragment,e),_(Ke.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(Oe.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(_e.$$.fragment,e),_(Te.$$.fragment,e),_(ot.$$.fragment,e),ho=!0)},o(e){T(be.$$.fragment,e),T(Me.$$.fragment,e),T(ye.$$.fragment,e),T(Pe.$$.fragment,e),T(Le.$$.fragment,e),T(je.$$.fragment,e),T(Je.$$.fragment,e),T(Ue.$$.fragment,e),T(re.$$.fragment,e),T(ze.$$.fragment,e),T(Ze.$$.fragment,e),T(ie.$$.fragment,e),T(Be.$$.fragment,e),T(Ve.$$.fragment,e),T(le.$$.fragment,e),T(Ne.$$.fragment,e),T(We.$$.fragment,e),T(Fe.$$.fragment,e),T(Ee.$$.fragment,e),T(He.$$.fragment,e),T(Re.$$.fragment,e),T(de.$$.fragment,e),T(ce.$$.fragment,e),T(Ge.$$.fragment,e),T(me.$$.fragment,e),T(Qe.$$.fragment,e),T(pe.$$.fragment,e),T(Xe.$$.fragment,e),T(qe.$$.fragment,e),T(De.$$.fragment,e),T(ge.$$.fragment,e),T(fe.$$.fragment,e),T(Ae.$$.fragment,e),T(Ye.$$.fragment,e),T(Ke.$$.fragment,e),T(he.$$.fragment,e),T(ue.$$.fragment,e),T(Oe.$$.fragment,e),T(et.$$.fragment,e),T(tt.$$.fragment,e),T(_e.$$.fragment,e),T(Te.$$.fragment,e),T(ot.$$.fragment,e),ho=!1},d(e){e&&(s(y),s(c),s(l),s(g),s(C),s(Zt),s(Bt),s(Vt),s(Ce),s(Nt),s(ve),s(Wt),s(Ie),s(Ft),s(ae),s(Et),s(we),s(Ht),s($e),s(Rt),s(Gt),s(xe),s(Qt),s(Xt),s(Se),s(qt),s(Dt),s(ke),s(At),s(Yt),s(Z),s(Kt),s(Ot),s(B),s(eo),s(to),s(V),s(oo),s(no),s(N),s(so),s(ao),s(w),s(ro),s(io),s(x),s(lo),s(co),s(L),s(mo),s(po),s(S),s(go),s(fo),s(Ut)),s(o),b(be,e),b(Me,e),b(ye,e),b(Pe,e),b(Le,e),b(je,e),b(Je,e),b(Ue),b(re),b(ze,e),b(Ze),b(ie),b(Be,e),b(Ve),b(le),b(Ne,e),b(We),b(Fe),b(Ee,e),b(He),b(Re),b(de),b(ce),b(Ge),b(me),b(Qe),b(pe),b(Xe,e),b(qe),b(De),b(ge),b(fe),b(Ae,e),b(Ye),b(Ke),b(he),b(ue),b(Oe,e),b(et),b(tt),b(_e),b(Te),b(ot,e)}}}const Cs='{"title":"CLIPSeg","local":"clipseg","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"CLIPSegConfig","local":"transformers.CLIPSegConfig","sections":[],"depth":2},{"title":"CLIPSegTextConfig","local":"transformers.CLIPSegTextConfig","sections":[],"depth":2},{"title":"CLIPSegVisionConfig","local":"transformers.CLIPSegVisionConfig","sections":[],"depth":2},{"title":"CLIPSegProcessor","local":"transformers.CLIPSegProcessor","sections":[],"depth":2},{"title":"CLIPSegModel","local":"transformers.CLIPSegModel","sections":[],"depth":2},{"title":"CLIPSegTextModel","local":"transformers.CLIPSegTextModel","sections":[],"depth":2},{"title":"CLIPSegVisionModel","local":"transformers.CLIPSegVisionModel","sections":[],"depth":2},{"title":"CLIPSegForImageSegmentation","local":"transformers.CLIPSegForImageSegmentation","sections":[],"depth":2}],"depth":1}';function vs(v){return ts(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Js extends os{constructor(o){super(),ns(this,o,vs,ys,On,{})}}export{Js as component};

Xet Storage Details

Size:
112 kB
·
Xet hash:
dd23f6b053bd0b82a05ce4c1d40287147bc62f55ec2390591a191264d157e063

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.