import{S as Wd,i as Bd,s as Nd,e as s,k as g,w as y,t as i,M as Vd,c as r,d as o,m as f,a,x as I,h as l,b as c,N as Fd,G as e,g as _,y as C,q as w,o as M,B as T,v as Ad,L as Me}from"../../chunks/vendor-hf-doc-builder.js";import{T as Oo}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Te}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as D}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as we}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Dd}from"../../chunks/PipelineTag-hf-doc-builder.js";function qd(P){let d,b,u,p,v;return p=new Te({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBTZWdDb25maWclMkMlMjBDTElQU2VnTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMHdpdGglMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDTElQU2VnQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFNlZ01vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBDSURBUyUyRmNsaXBzZWctcmQ2NCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ0xJUFNlZ01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZyUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwYWxzbyUyMGluaXRpYWxpemUlMjBhJTIwQ0xJUFNlZ0NvbmZpZyUyMGZyb20lMjBhJTIwQ0xJUFNlZ1RleHRDb25maWclMjBhbmQlMjBhJTIwQ0xJUFNlZ1Zpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQU2VnVGV4dCUyMGFuZCUyMENMSVBTZWdWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQU2VnVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBTZWdWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBTZWdDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPSegConfig, CLIPSegModel

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>config = CLIPSegConfig.from_text_vision_configs(config_text, config_vision)`}}),{c(){d=s("p"),b=i("Example:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function Rd(P){let d,b,u,p,v;return p=new Te({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`}}),{c(){d=s("p"),b=i("Example:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function Xd(P){let d,b,u,p,v;return p=new Te({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`}}),{c(){d=s("p"),b=i("Example:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function Gd(P){let d,b,u,p,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var $=a(u);p=l($,"Module"),$.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,b),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function Qd(P){let d,b,u,p,v;return p=new Te({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjB3ZSUyMGNhbiUyMHRha2UlMjB0aGUlMjBzb2Z0bWF4JTIwdG8lMjBnZXQlMjB0aGUlMjBsYWJlbCUyMHByb2JhYmlsaXRpZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),b=i("Examples:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function Od(P){let d,b,u,p,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var $=a(u);p=l($,"Module"),$.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,b),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function Kd(P){let d,b,u,p,v;return p=new Te({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdNb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBaW1hZ2VfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfaW1hZ2VfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`}}),{c(){d=s("p"),b=i("Examples:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function ec(P){let d,b,u,p,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var $=a(u);p=l($,"Module"),$.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,b),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function tc(P){let d,b,u,p,v;return p=new Te({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>`}}),{c(){d=s("p"),b=i("Examples:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function oc(P){let d,b,u,p,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var $=a(u);p=l($,"Module"),$.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,b),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function nc(P){let d,b,u,p,v;return p=new Te({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBTZWdWaXNpb25Nb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjBDTFMlMjBzdGF0ZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegVisionModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),b=i("Examples:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function sc(P){let d,b,u,p,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var $=a(u);p=l($,"Module"),$.forEach(o),v=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,b),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function rc(P){let d,b,u,p,v;return p=new Te({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBDTElQU2VnRm9ySW1hZ2VTZWdtZW50YXRpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBbW9kZWwlMjAlM0QlMjBDTElQU2VnRm9ySW1hZ2VTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMkNJREFTJTJGY2xpcHNlZy1yZDY0LXJlZmluZWQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHRzJTIwJTNEJTIwJTVCJTIyYSUyMGNhdCUyMiUyQyUyMCUyMmElMjByZW1vdGUlMjIlMkMlMjAlMjJhJTIwYmxhbmtldCUyMiU1RCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdGV4dHMlMkMlMjBpbWFnZXMlM0QlNUJpbWFnZSU1RCUyMColMjBsZW4odGV4dHMpJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQXByaW50KGxvZ2l0cy5zaGFwZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPSegForImageSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;a cat&quot;</span>, <span class="hljs-string">&quot;a remote&quot;</span>, <span class="hljs-string">&quot;a blanket&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, images=[image] * <span class="hljs-built_in">len</span>(texts), padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(logits.shape)
torch.Size([<span class="hljs-number">3</span>, <span class="hljs-number">352</span>, <span class="hljs-number">352</span>])`}}),{c(){d=s("p"),b=i("Examples:"),u=g(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);b=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,b),_(n,u,m),C(p,n,m),v=!0},p:Me,i(n){v||(w(p.$$.fragment,n),v=!0)},o(n){M(p.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(u),T(p,n)}}}function ac(P){let d,b,u,p,v,n,m,$,Fs,qn,O,Pe,Ko,mt,As,en,Ds,Rn,q,qs,pt,Rs,Xs,ro,Gs,Qs,Xn,ao,Hs,Gn,io,tn,Ys,Qn,lo,Os,Hn,$e,R,co,Ks,er,mo,tr,or,po,nr,sr,rr,U,go,ar,ir,on,lr,dr,nn,cr,mr,sn,pr,gr,Yn,Se,fl,On,gt,fr,fo,hr,Kn,X,ur,ft,_r,vr,ht,br,yr,es,K,Le,rn,ut,Ir,an,Cr,ts,ho,wr,os,_t,ns,uo,vt,Mr,bt,Tr,Pr,ss,ee,xe,ln,yt,$r,dn,Sr,rs,L,It,Lr,G,_o,xr,Jr,vo,jr,kr,Ct,Er,Zr,Ur,te,zr,bo,Wr,Br,yo,Nr,Vr,Fr,Je,Ar,je,wt,Dr,Mt,qr,Io,Rr,Xr,as,oe,ke,cn,Tt,Gr,mn,Qr,is,k,Pt,Hr,ne,Yr,Co,Or,Kr,$t,ea,ta,oa,se,na,wo,sa,ra,Mo,aa,ia,la,Ee,ls,re,Ze,pn,St,da,gn,ca,ds,E,Lt,ma,ae,pa,To,ga,fa,xt,ha,ua,_a,ie,va,Po,ba,ya,$o,Ia,Ca,wa,Ue,cs,le,ze,fn,Jt,Ma,hn,Ta,ms,x,jt,Pa,un,$a,Sa,j,So,La,xa,Lo,Ja,ja,xo,ka,Ea,_n,Za,Ua,Jo,za,Wa,Ba,We,kt,Na,Et,Va,jo,Fa,Aa,Da,Be,Zt,qa,Ut,Ra,ko,Xa,Ga,ps,de,Ne,vn,zt,Qa,bn,Ha,gs,J,Wt,Ya,Bt,Oa,Nt,Ka,ei,ti,z,Vt,oi,ce,ni,Eo,si,ri,yn,ai,ii,li,Ve,di,Fe,ci,W,Ft,mi,me,pi,Zo,gi,fi,In,hi,ui,_i,Ae,vi,De,bi,B,At,yi,pe,Ii,Uo,Ci,wi,Cn,Mi,Ti,Pi,qe,$i,Re,fs,ge,Xe,wn,Dt,Si,Mn,Li,hs,fe,qt,xi,N,Rt,Ji,he,ji,zo,ki,Ei,Tn,Zi,Ui,zi,Ge,Wi,Qe,us,ue,He,Pn,Xt,Bi,$n,Ni,_s,_e,Gt,Vi,V,Qt,Fi,ve,Ai,Wo,Di,qi,Sn,Ri,Xi,Gi,Ye,Qi,Oe,vs,be,Ke,Ln,Ht,Hi,xn,Yi,bs,Z,Yt,Oi,Jn,Ki,el,Ot,tl,Kt,ol,nl,sl,F,eo,rl,ye,al,Bo,il,ll,jn,dl,cl,ml,et,pl,tt,ys;return n=new D({}),mt=new D({}),ut=new D({}),_t=new Dd({props:{pipeline:"image-segmentation"}}),yt=new D({}),It=new S({props:{name:"class transformers.CLIPSegConfig",anchor:"transformers.CLIPSegConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"extract_layers",val:" = [3, 6, 9]"},{name:"reduce_dim",val:" = 64"},{name:"decoder_num_attention_heads",val:" = 4"},{name:"decoder_attention_dropout",val:" = 0.0"},{name:"decoder_hidden_act",val:" = 'quick_gelu'"},{name:"decoder_intermediate_size",val:" = 2048"},{name:"conditional_layer",val:" = 0"},{name:"use_complex_transposed_convolution",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegTextConfig">CLIPSegTextConfig</a>.`,name:"text_config"},{anchor:"transformers.CLIPSegConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionConfig">CLIPSegVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.CLIPSegConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.CLIPSegConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original CLIPSeg implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.CLIPSegConfig.extract_layers",description:`<strong>extract_layers</strong> (<code>List[int]</code>, <em>optional</em>, defaults to [3, 6, 9]) &#x2014;
Layers to extract when forwarding the query image through the frozen visual backbone of CLIP.`,name:"extract_layers"},{anchor:"transformers.CLIPSegConfig.reduce_dim",description:`<strong>reduce_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality to reduce the CLIP vision embedding.`,name:"reduce_dim"},{anchor:"transformers.CLIPSegConfig.decoder_num_attention_heads",description:`<strong>decoder_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of attention heads in the decoder of CLIPSeg.`,name:"decoder_num_attention_heads"},{anchor:"transformers.CLIPSegConfig.decoder_attention_dropout",description:`<strong>decoder_attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"decoder_attention_dropout"},{anchor:"transformers.CLIPSegConfig.decoder_hidden_act",description:`<strong>decoder_hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"decoder_hidden_act"},{anchor:"transformers.CLIPSegConfig.decoder_intermediate_size",description:`<strong>decoder_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layers in the Transformer decoder.`,name:"decoder_intermediate_size"},{anchor:"transformers.CLIPSegConfig.conditional_layer",description:`<strong>conditional_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The layer to use of the Transformer encoder whose activations will be combined with the condition
embeddings using FiLM (Feature-wise Linear Modulation). If 0, the last layer is used.`,name:"conditional_layer"},{anchor:"transformers.CLIPSegConfig.use_complex_transposed_convolution",description:`<strong>use_complex_transposed_convolution</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a more complex transposed convolution in the decoder, enabling more fine-grained
segmentation.`,name:"use_complex_transposed_convolution"},{anchor:"transformers.CLIPSegConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/configuration_clipseg.py#L239"}}),Je=new we({props:{anchor:"transformers.CLIPSegConfig.example",$$slots:{default:[qd]},$$scope:{ctx:P}}}),wt=new S({props:{name:"from_text_vision_configs",anchor:"transformers.CLIPSegConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": CLIPSegTextConfig"},{name:"vision_config",val:": CLIPSegVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/configuration_clipseg.py#L414",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a></p>
`}}),Tt=new D({}),Pt=new S({props:{name:"class transformers.CLIPSegTextConfig",anchor:"transformers.CLIPSegTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the CLIPSeg text model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel">CLIPSegModel</a>.`,name:"vocab_size"},{anchor:"transformers.CLIPSegTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPSegTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.CLIPSegTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPSegTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPSegTextConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.CLIPSegTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/configuration_clipseg.py#L31"}}),Ee=new we({props:{anchor:"transformers.CLIPSegTextConfig.example",$$slots:{default:[Rd]},$$scope:{ctx:P}}}),St=new D({}),Lt=new S({props:{name:"class transformers.CLIPSegVisionConfig",anchor:"transformers.CLIPSegVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPSegVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.CLIPSegVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.CLIPSegVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPSegVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPSegVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.CLIPSegVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/configuration_clipseg.py#L136"}}),Ue=new we({props:{anchor:"transformers.CLIPSegVisionConfig.example",$$slots:{default:[Xd]},$$scope:{ctx:P}}}),Jt=new D({}),jt=new S({props:{name:"class transformers.CLIPSegProcessor",anchor:"transformers.CLIPSegProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPSegProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/processing_clipseg.py#L25"}}),kt=new S({props:{name:"batch_decode",anchor:"transformers.CLIPSegProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/processing_clipseg.py#L133"}}),Zt=new S({props:{name:"decode",anchor:"transformers.CLIPSegProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/processing_clipseg.py#L140"}}),zt=new D({}),Wt=new S({props:{name:"class transformers.CLIPSegModel",anchor:"transformers.CLIPSegModel",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L968"}}),Vt=new S({props:{name:"forward",anchor:"transformers.CLIPSegModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.CLIPSegModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L1099",returnDescription:`
<p>A <code>transformers.models.clipseg.modeling_clipseg.CLIPSegOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clipseg.modeling_clipseg.CLIPSegOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new Oo({props:{$$slots:{default:[Gd]},$$scope:{ctx:P}}}),Fe=new we({props:{anchor:"transformers.CLIPSegModel.forward.example",$$slots:{default:[Qd]},$$scope:{ctx:P}}}),Ft=new S({props:{name:"get_text_features",anchor:"transformers.CLIPSegModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegModel.get_text_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegModel.get_text_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L1003",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"
>CLIPSegTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ae=new Oo({props:{$$slots:{default:[Hd]},$$scope:{ctx:P}}}),De=new we({props:{anchor:"transformers.CLIPSegModel.get_text_features.example",$$slots:{default:[Yd]},$$scope:{ctx:P}}}),At=new S({props:{name:"get_image_features",anchor:"transformers.CLIPSegModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegModel.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegModel.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L1050",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),qe=new Oo({props:{$$slots:{default:[Od]},$$scope:{ctx:P}}}),Re=new we({props:{anchor:"transformers.CLIPSegModel.get_image_features.example",$$slots:{default:[Kd]},$$scope:{ctx:P}}}),Dt=new D({}),qt=new S({props:{name:"class transformers.CLIPSegTextModel",anchor:"transformers.CLIPSegTextModel",parameters:[{name:"config",val:": CLIPSegTextConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L800"}}),Rt=new S({props:{name:"forward",anchor:"transformers.CLIPSegTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegTextModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegTextModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L817",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ge=new Oo({props:{$$slots:{default:[ec]},$$scope:{ctx:P}}}),Qe=new we({props:{anchor:"transformers.CLIPSegTextModel.forward.example",$$slots:{default:[tc]},$$scope:{ctx:P}}}),Xt=new D({}),Gt=new S({props:{name:"class transformers.CLIPSegVisionModel",anchor:"transformers.CLIPSegVisionModel",parameters:[{name:"config",val:": CLIPSegVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L915"}}),Qt=new S({props:{name:"forward",anchor:"transformers.CLIPSegVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegVisionModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegVisionModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L928",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 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>) \u2014 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>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ye=new Oo({props:{$$slots:{default:[oc]},$$scope:{ctx:P}}}),Oe=new we({props:{anchor:"transformers.CLIPSegVisionModel.forward.example",$$slots:{default:[nc]},$$scope:{ctx:P}}}),Ht=new D({}),Yt=new S({props:{name:"class transformers.CLIPSegForImageSegmentation",anchor:"transformers.CLIPSegForImageSegmentation",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegConfig">CLIPSegConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L1356"}}),eo=new S({props:{name:"forward",anchor:"transformers.CLIPSegForImageSegmentation.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.CLIPSegForImageSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clipseg/modeling_clipseg.py#L1401",returnDescription:`
<p>A <code>transformers.models.clipseg.modeling_clipseg.CLIPSegImageSegmentationOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clipseg.configuration_clipseg.CLIPSegTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.
\u2026</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"
>CLIPSegVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clipseg.modeling_clipseg.CLIPSegImageSegmentationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),et=new Oo({props:{$$slots:{default:[sc]},$$scope:{ctx:P}}}),tt=new we({props:{anchor:"transformers.CLIPSegForImageSegmentation.forward.example",$$slots:{default:[rc]},$$scope:{ctx:P}}}),{c(){d=s("meta"),b=g(),u=s("h1"),p=s("a"),v=s("span"),y(n.$$.fragment),m=g(),$=s("span"),Fs=i("CLIPSeg"),qn=g(),O=s("h2"),Pe=s("a"),Ko=s("span"),y(mt.$$.fragment),As=g(),en=s("span"),Ds=i("Overview"),Rn=g(),q=s("p"),qs=i("The CLIPSeg model was proposed in "),pt=s("a"),Rs=i("Image Segmentation Using Text and Image Prompts"),Xs=i(` by Timo L\xFCddecke
and Alexander Ecker. CLIPSeg adds a minimal decoder on top of a frozen `),ro=s("a"),Gs=i("CLIP"),Qs=i(" model for zero- and one-shot image segmentation."),Xn=g(),ao=s("p"),Hs=i("The abstract from the paper is the following:"),Gn=g(),io=s("p"),tn=s("em"),Ys=i(`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`),Qn=g(),lo=s("p"),Os=i("Tips:"),Hn=g(),$e=s("ul"),R=s("li"),co=s("a"),Ks=i("CLIPSegForImageSegmentation"),er=i(" adds a decoder on top of "),mo=s("a"),tr=i("CLIPSegModel"),or=i(". The latter is identical to "),po=s("a"),nr=i("CLIPModel"),sr=i("."),rr=g(),U=s("li"),go=s("a"),ar=i("CLIPSegForImageSegmentation"),ir=i(` can generate image segmentations based on arbitrary prompts at test time. A prompt can be either a text
(provided to the model as `),on=s("code"),lr=i("input_ids"),dr=i(") or an image (provided to the model as "),nn=s("code"),cr=i("conditional_pixel_values"),mr=i(`). One can also provide custom
conditional embeddings (provided to the model as `),sn=s("code"),pr=i("conditional_embeddings"),gr=i(")."),Yn=g(),Se=s("img"),On=g(),gt=s("small"),fr=i("CLIPSeg overview. Taken from the "),fo=s("a"),hr=i("original paper."),Kn=g(),X=s("p"),ur=i("This model was contributed by "),ft=s("a"),_r=i("nielsr"),vr=i(`.
The original code can be found `),ht=s("a"),br=i("here"),yr=i("."),es=g(),K=s("h2"),Le=s("a"),rn=s("span"),y(ut.$$.fragment),Ir=g(),an=s("span"),Cr=i("Resources"),ts=g(),ho=s("p"),wr=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIPSeg. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),os=g(),y(_t.$$.fragment),ns=g(),uo=s("ul"),vt=s("li"),Mr=i("A notebook that illustrates "),bt=s("a"),Tr=i("zero-shot image segmentation with CLIPSeg"),Pr=i("."),ss=g(),ee=s("h2"),xe=s("a"),ln=s("span"),y(yt.$$.fragment),$r=g(),dn=s("span"),Sr=i("CLIPSegConfig"),rs=g(),L=s("div"),y(It.$$.fragment),Lr=g(),G=s("p"),_o=s("a"),xr=i("CLIPSegConfig"),Jr=i(" is the configuration class to store the configuration of a "),vo=s("a"),jr=i("CLIPSegModel"),kr=i(`. It is used to
instantiate a CLIPSeg model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the CLIPSeg
`),Ct=s("a"),Er=i("CIDAS/clipseg-rd64"),Zr=i(" architecture."),Ur=g(),te=s("p"),zr=i("Configuration objects inherit from "),bo=s("a"),Wr=i("PretrainedConfig"),Br=i(` and can be used to control the model outputs. Read the
documentation from `),yo=s("a"),Nr=i("PretrainedConfig"),Vr=i(" for more information."),Fr=g(),y(Je.$$.fragment),Ar=g(),je=s("div"),y(wt.$$.fragment),Dr=g(),Mt=s("p"),qr=i("Instantiate a "),Io=s("a"),Rr=i("CLIPSegConfig"),Xr=i(` (or a derived class) from clipseg text model configuration and clipseg vision
model configuration.`),as=g(),oe=s("h2"),ke=s("a"),cn=s("span"),y(Tt.$$.fragment),Gr=g(),mn=s("span"),Qr=i("CLIPSegTextConfig"),is=g(),k=s("div"),y(Pt.$$.fragment),Hr=g(),ne=s("p"),Yr=i("This is the configuration class to store the configuration of a "),Co=s("a"),Or=i("CLIPSegModel"),Kr=i(`. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
`),$t=s("a"),ea=i("CIDAS/clipseg-rd64"),ta=i(" architecture."),oa=g(),se=s("p"),na=i("Configuration objects inherit from "),wo=s("a"),sa=i("PretrainedConfig"),ra=i(` and can be used to control the model outputs. Read the
documentation from `),Mo=s("a"),aa=i("PretrainedConfig"),ia=i(" for more information."),la=g(),y(Ee.$$.fragment),ls=g(),re=s("h2"),Ze=s("a"),pn=s("span"),y(St.$$.fragment),da=g(),gn=s("span"),ca=i("CLIPSegVisionConfig"),ds=g(),E=s("div"),y(Lt.$$.fragment),ma=g(),ae=s("p"),pa=i("This is the configuration class to store the configuration of a "),To=s("a"),ga=i("CLIPSegModel"),fa=i(`. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
`),xt=s("a"),ha=i("CIDAS/clipseg-rd64"),ua=i(" architecture."),_a=g(),ie=s("p"),va=i("Configuration objects inherit from "),Po=s("a"),ba=i("PretrainedConfig"),ya=i(` and can be used to control the model outputs. Read the
documentation from `),$o=s("a"),Ia=i("PretrainedConfig"),Ca=i(" for more information."),wa=g(),y(Ue.$$.fragment),cs=g(),le=s("h2"),ze=s("a"),fn=s("span"),y(Jt.$$.fragment),Ma=g(),hn=s("span"),Ta=i("CLIPSegProcessor"),ms=g(),x=s("div"),y(jt.$$.fragment),Pa=g(),un=s("p"),$a=i("Constructs a CLIPSeg processor which wraps a CLIPSeg image processor and a CLIP tokenizer into a single processor."),Sa=g(),j=s("p"),So=s("a"),La=i("CLIPSegProcessor"),xa=i(" offers all the functionalities of "),Lo=s("a"),Ja=i("ViTImageProcessor"),ja=i(" and "),xo=s("a"),ka=i("CLIPTokenizerFast"),Ea=i(`. See the
`),_n=s("code"),Za=i("__call__()"),Ua=i(" and "),Jo=s("a"),za=i("decode()"),Wa=i(" for more information."),Ba=g(),We=s("div"),y(kt.$$.fragment),Na=g(),Et=s("p"),Va=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),jo=s("a"),Fa=i("batch_decode()"),Aa=i(`. Please
refer to the docstring of this method for more information.`),Da=g(),Be=s("div"),y(Zt.$$.fragment),qa=g(),Ut=s("p"),Ra=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),ko=s("a"),Xa=i("decode()"),Ga=i(`. Please refer to
the docstring of this method for more information.`),ps=g(),de=s("h2"),Ne=s("a"),vn=s("span"),y(zt.$$.fragment),Qa=g(),bn=s("span"),Ha=i("CLIPSegModel"),gs=g(),J=s("div"),y(Wt.$$.fragment),Ya=g(),Bt=s("p"),Oa=i("This model is a PyTorch "),Nt=s("a"),Ka=i("torch.nn.Module"),ei=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ti=g(),z=s("div"),y(Vt.$$.fragment),oi=g(),ce=s("p"),ni=i("The "),Eo=s("a"),si=i("CLIPSegModel"),ri=i(" forward method, overrides the "),yn=s("code"),ai=i("__call__"),ii=i(" special method."),li=g(),y(Ve.$$.fragment),di=g(),y(Fe.$$.fragment),ci=g(),W=s("div"),y(Ft.$$.fragment),mi=g(),me=s("p"),pi=i("The "),Zo=s("a"),gi=i("CLIPSegModel"),fi=i(" forward method, overrides the "),In=s("code"),hi=i("__call__"),ui=i(" special method."),_i=g(),y(Ae.$$.fragment),vi=g(),y(De.$$.fragment),bi=g(),B=s("div"),y(At.$$.fragment),yi=g(),pe=s("p"),Ii=i("The "),Uo=s("a"),Ci=i("CLIPSegModel"),wi=i(" forward method, overrides the "),Cn=s("code"),Mi=i("__call__"),Ti=i(" special method."),Pi=g(),y(qe.$$.fragment),$i=g(),y(Re.$$.fragment),fs=g(),ge=s("h2"),Xe=s("a"),wn=s("span"),y(Dt.$$.fragment),Si=g(),Mn=s("span"),Li=i("CLIPSegTextModel"),hs=g(),fe=s("div"),y(qt.$$.fragment),xi=g(),N=s("div"),y(Rt.$$.fragment),Ji=g(),he=s("p"),ji=i("The "),zo=s("a"),ki=i("CLIPSegTextModel"),Ei=i(" forward method, overrides the "),Tn=s("code"),Zi=i("__call__"),Ui=i(" special method."),zi=g(),y(Ge.$$.fragment),Wi=g(),y(Qe.$$.fragment),us=g(),ue=s("h2"),He=s("a"),Pn=s("span"),y(Xt.$$.fragment),Bi=g(),$n=s("span"),Ni=i("CLIPSegVisionModel"),_s=g(),_e=s("div"),y(Gt.$$.fragment),Vi=g(),V=s("div"),y(Qt.$$.fragment),Fi=g(),ve=s("p"),Ai=i("The "),Wo=s("a"),Di=i("CLIPSegVisionModel"),qi=i(" forward method, overrides the "),Sn=s("code"),Ri=i("__call__"),Xi=i(" special method."),Gi=g(),y(Ye.$$.fragment),Qi=g(),y(Oe.$$.fragment),vs=g(),be=s("h2"),Ke=s("a"),Ln=s("span"),y(Ht.$$.fragment),Hi=g(),xn=s("span"),Yi=i("CLIPSegForImageSegmentation"),bs=g(),Z=s("div"),y(Yt.$$.fragment),Oi=g(),Jn=s("p"),Ki=i("CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation."),el=g(),Ot=s("p"),tl=i("This model is a PyTorch "),Kt=s("a"),ol=i("torch.nn.Module"),nl=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),sl=g(),F=s("div"),y(eo.$$.fragment),rl=g(),ye=s("p"),al=i("The "),Bo=s("a"),il=i("CLIPSegForImageSegmentation"),ll=i(" forward method, overrides the "),jn=s("code"),dl=i("__call__"),cl=i(" special method."),ml=g(),y(et.$$.fragment),pl=g(),y(tt.$$.fragment),this.h()},l(t){const h=Vd('[data-svelte="svelte-1phssyn"]',document.head);d=r(h,"META",{name:!0,content:!0}),h.forEach(o),b=f(t),u=r(t,"H1",{class:!0});var to=a(u);p=r(to,"A",{id:!0,class:!0,href:!0});var kn=a(p);v=r(kn,"SPAN",{});var En=a(v);I(n.$$.fragment,En),En.forEach(o),kn.forEach(o),m=f(to),$=r(to,"SPAN",{});var Zn=a($);Fs=l(Zn,"CLIPSeg"),Zn.forEach(o),to.forEach(o),qn=f(t),O=r(t,"H2",{class:!0});var oo=a(O);Pe=r(oo,"A",{id:!0,class:!0,href:!0});var Un=a(Pe);Ko=r(Un,"SPAN",{});var zn=a(Ko);I(mt.$$.fragment,zn),zn.forEach(o),Un.forEach(o),As=f(oo),en=r(oo,"SPAN",{});var Wn=a(en);Ds=l(Wn,"Overview"),Wn.forEach(o),oo.forEach(o),Rn=f(t),q=r(t,"P",{});var Ie=a(q);qs=l(Ie,"The CLIPSeg model was proposed in "),pt=r(Ie,"A",{href:!0,rel:!0});var Bn=a(pt);Rs=l(Bn,"Image Segmentation Using Text and Image Prompts"),Bn.forEach(o),Xs=l(Ie,` by Timo L\xFCddecke
and Alexander Ecker. CLIPSeg adds a minimal decoder on top of a frozen `),ro=r(Ie,"A",{href:!0});var Nn=a(ro);Gs=l(Nn,"CLIP"),Nn.forEach(o),Qs=l(Ie," model for zero- and one-shot image segmentation."),Ie.forEach(o),Xn=f(t),ao=r(t,"P",{});var Vn=a(ao);Hs=l(Vn,"The abstract from the paper is the following:"),Vn.forEach(o),Gn=f(t),io=r(t,"P",{});var Fn=a(io);tn=r(Fn,"EM",{});var An=a(tn);Ys=l(An,`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`),An.forEach(o),Fn.forEach(o),Qn=f(t),lo=r(t,"P",{});var Dn=a(lo);Os=l(Dn,"Tips:"),Dn.forEach(o),Hn=f(t),$e=r(t,"UL",{});var Is=a($e);R=r(Is,"LI",{});var no=a(R);co=r(no,"A",{href:!0});var hl=a(co);Ks=l(hl,"CLIPSegForImageSegmentation"),hl.forEach(o),er=l(no," adds a decoder on top of "),mo=r(no,"A",{href:!0});var ul=a(mo);tr=l(ul,"CLIPSegModel"),ul.forEach(o),or=l(no,". The latter is identical to "),po=r(no,"A",{href:!0});var _l=a(po);nr=l(_l,"CLIPModel"),_l.forEach(o),sr=l(no,"."),no.forEach(o),rr=f(Is),U=r(Is,"LI",{});var Ce=a(U);go=r(Ce,"A",{href:!0});var vl=a(go);ar=l(vl,"CLIPSegForImageSegmentation"),vl.forEach(o),ir=l(Ce,` can generate image segmentations based on arbitrary prompts at test time. A prompt can be either a text
(provided to the model as `),on=r(Ce,"CODE",{});var bl=a(on);lr=l(bl,"input_ids"),bl.forEach(o),dr=l(Ce,") or an image (provided to the model as "),nn=r(Ce,"CODE",{});var yl=a(nn);cr=l(yl,"conditional_pixel_values"),yl.forEach(o),mr=l(Ce,`). One can also provide custom
conditional embeddings (provided to the model as `),sn=r(Ce,"CODE",{});var Il=a(sn);pr=l(Il,"conditional_embeddings"),Il.forEach(o),gr=l(Ce,")."),Ce.forEach(o),Is.forEach(o),Yn=f(t),Se=r(t,"IMG",{src:!0,alt:!0,width:!0}),On=f(t),gt=r(t,"SMALL",{});var gl=a(gt);fr=l(gl,"CLIPSeg overview. Taken from the "),fo=r(gl,"A",{href:!0});var Cl=a(fo);hr=l(Cl,"original paper."),Cl.forEach(o),gl.forEach(o),Kn=f(t),X=r(t,"P",{});var No=a(X);ur=l(No,"This model was contributed by "),ft=r(No,"A",{href:!0,rel:!0});var wl=a(ft);_r=l(wl,"nielsr"),wl.forEach(o),vr=l(No,`.
The original code can be found `),ht=r(No,"A",{href:!0,rel:!0});var Ml=a(ht);br=l(Ml,"here"),Ml.forEach(o),yr=l(No,"."),No.forEach(o),es=f(t),K=r(t,"H2",{class:!0});var Cs=a(K);Le=r(Cs,"A",{id:!0,class:!0,href:!0});var Tl=a(Le);rn=r(Tl,"SPAN",{});var Pl=a(rn);I(ut.$$.fragment,Pl),Pl.forEach(o),Tl.forEach(o),Ir=f(Cs),an=r(Cs,"SPAN",{});var $l=a(an);Cr=l($l,"Resources"),$l.forEach(o),Cs.forEach(o),ts=f(t),ho=r(t,"P",{});var Sl=a(ho);wr=l(Sl,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIPSeg. If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Sl.forEach(o),os=f(t),I(_t.$$.fragment,t),ns=f(t),uo=r(t,"UL",{});var Ll=a(uo);vt=r(Ll,"LI",{});var ws=a(vt);Mr=l(ws,"A notebook that illustrates "),bt=r(ws,"A",{href:!0,rel:!0});var xl=a(bt);Tr=l(xl,"zero-shot image segmentation with CLIPSeg"),xl.forEach(o),Pr=l(ws,"."),ws.forEach(o),Ll.forEach(o),ss=f(t),ee=r(t,"H2",{class:!0});var Ms=a(ee);xe=r(Ms,"A",{id:!0,class:!0,href:!0});var Jl=a(xe);ln=r(Jl,"SPAN",{});var jl=a(ln);I(yt.$$.fragment,jl),jl.forEach(o),Jl.forEach(o),$r=f(Ms),dn=r(Ms,"SPAN",{});var kl=a(dn);Sr=l(kl,"CLIPSegConfig"),kl.forEach(o),Ms.forEach(o),rs=f(t),L=r(t,"DIV",{class:!0});var Q=a(L);I(It.$$.fragment,Q),Lr=f(Q),G=r(Q,"P",{});var so=a(G);_o=r(so,"A",{href:!0});var El=a(_o);xr=l(El,"CLIPSegConfig"),El.forEach(o),Jr=l(so," is the configuration class to store the configuration of a "),vo=r(so,"A",{href:!0});var Zl=a(vo);jr=l(Zl,"CLIPSegModel"),Zl.forEach(o),kr=l(so,`. It is used to
instantiate a CLIPSeg model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the CLIPSeg
`),Ct=r(so,"A",{href:!0,rel:!0});var Ul=a(Ct);Er=l(Ul,"CIDAS/clipseg-rd64"),Ul.forEach(o),Zr=l(so," architecture."),so.forEach(o),Ur=f(Q),te=r(Q,"P",{});var Vo=a(te);zr=l(Vo,"Configuration objects inherit from "),bo=r(Vo,"A",{href:!0});var zl=a(bo);Wr=l(zl,"PretrainedConfig"),zl.forEach(o),Br=l(Vo,` and can be used to control the model outputs. Read the
documentation from `),yo=r(Vo,"A",{href:!0});var Wl=a(yo);Nr=l(Wl,"PretrainedConfig"),Wl.forEach(o),Vr=l(Vo," for more information."),Vo.forEach(o),Fr=f(Q),I(Je.$$.fragment,Q),Ar=f(Q),je=r(Q,"DIV",{class:!0});var Ts=a(je);I(wt.$$.fragment,Ts),Dr=f(Ts),Mt=r(Ts,"P",{});var Ps=a(Mt);qr=l(Ps,"Instantiate a "),Io=r(Ps,"A",{href:!0});var Bl=a(Io);Rr=l(Bl,"CLIPSegConfig"),Bl.forEach(o),Xr=l(Ps,` (or a derived class) from clipseg text model configuration and clipseg vision
model configuration.`),Ps.forEach(o),Ts.forEach(o),Q.forEach(o),as=f(t),oe=r(t,"H2",{class:!0});var $s=a(oe);ke=r($s,"A",{id:!0,class:!0,href:!0});var Nl=a(ke);cn=r(Nl,"SPAN",{});var Vl=a(cn);I(Tt.$$.fragment,Vl),Vl.forEach(o),Nl.forEach(o),Gr=f($s),mn=r($s,"SPAN",{});var Fl=a(mn);Qr=l(Fl,"CLIPSegTextConfig"),Fl.forEach(o),$s.forEach(o),is=f(t),k=r(t,"DIV",{class:!0});var ot=a(k);I(Pt.$$.fragment,ot),Hr=f(ot),ne=r(ot,"P",{});var Fo=a(ne);Yr=l(Fo,"This is the configuration class to store the configuration of a "),Co=r(Fo,"A",{href:!0});var Al=a(Co);Or=l(Al,"CLIPSegModel"),Al.forEach(o),Kr=l(Fo,`. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
`),$t=r(Fo,"A",{href:!0,rel:!0});var Dl=a($t);ea=l(Dl,"CIDAS/clipseg-rd64"),Dl.forEach(o),ta=l(Fo," architecture."),Fo.forEach(o),oa=f(ot),se=r(ot,"P",{});var Ao=a(se);na=l(Ao,"Configuration objects inherit from "),wo=r(Ao,"A",{href:!0});var ql=a(wo);sa=l(ql,"PretrainedConfig"),ql.forEach(o),ra=l(Ao,` and can be used to control the model outputs. Read the
documentation from `),Mo=r(Ao,"A",{href:!0});var Rl=a(Mo);aa=l(Rl,"PretrainedConfig"),Rl.forEach(o),ia=l(Ao," for more information."),Ao.forEach(o),la=f(ot),I(Ee.$$.fragment,ot),ot.forEach(o),ls=f(t),re=r(t,"H2",{class:!0});var Ss=a(re);Ze=r(Ss,"A",{id:!0,class:!0,href:!0});var Xl=a(Ze);pn=r(Xl,"SPAN",{});var Gl=a(pn);I(St.$$.fragment,Gl),Gl.forEach(o),Xl.forEach(o),da=f(Ss),gn=r(Ss,"SPAN",{});var Ql=a(gn);ca=l(Ql,"CLIPSegVisionConfig"),Ql.forEach(o),Ss.forEach(o),ds=f(t),E=r(t,"DIV",{class:!0});var nt=a(E);I(Lt.$$.fragment,nt),ma=f(nt),ae=r(nt,"P",{});var Do=a(ae);pa=l(Do,"This is the configuration class to store the configuration of a "),To=r(Do,"A",{href:!0});var Hl=a(To);ga=l(Hl,"CLIPSegModel"),Hl.forEach(o),fa=l(Do,`. It is used to instantiate an
CLIPSeg model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the CLIPSeg
`),xt=r(Do,"A",{href:!0,rel:!0});var Yl=a(xt);ha=l(Yl,"CIDAS/clipseg-rd64"),Yl.forEach(o),ua=l(Do," architecture."),Do.forEach(o),_a=f(nt),ie=r(nt,"P",{});var qo=a(ie);va=l(qo,"Configuration objects inherit from "),Po=r(qo,"A",{href:!0});var Ol=a(Po);ba=l(Ol,"PretrainedConfig"),Ol.forEach(o),ya=l(qo,` and can be used to control the model outputs. Read the
documentation from `),$o=r(qo,"A",{href:!0});var Kl=a($o);Ia=l(Kl,"PretrainedConfig"),Kl.forEach(o),Ca=l(qo," for more information."),qo.forEach(o),wa=f(nt),I(Ue.$$.fragment,nt),nt.forEach(o),cs=f(t),le=r(t,"H2",{class:!0});var Ls=a(le);ze=r(Ls,"A",{id:!0,class:!0,href:!0});var ed=a(ze);fn=r(ed,"SPAN",{});var td=a(fn);I(Jt.$$.fragment,td),td.forEach(o),ed.forEach(o),Ma=f(Ls),hn=r(Ls,"SPAN",{});var od=a(hn);Ta=l(od,"CLIPSegProcessor"),od.forEach(o),Ls.forEach(o),ms=f(t),x=r(t,"DIV",{class:!0});var H=a(x);I(jt.$$.fragment,H),Pa=f(H),un=r(H,"P",{});var nd=a(un);$a=l(nd,"Constructs a CLIPSeg processor which wraps a CLIPSeg image processor and a CLIP tokenizer into a single processor."),nd.forEach(o),Sa=f(H),j=r(H,"P",{});var A=a(j);So=r(A,"A",{href:!0});var sd=a(So);La=l(sd,"CLIPSegProcessor"),sd.forEach(o),xa=l(A," offers all the functionalities of "),Lo=r(A,"A",{href:!0});var rd=a(Lo);Ja=l(rd,"ViTImageProcessor"),rd.forEach(o),ja=l(A," and "),xo=r(A,"A",{href:!0});var ad=a(xo);ka=l(ad,"CLIPTokenizerFast"),ad.forEach(o),Ea=l(A,`. See the
`),_n=r(A,"CODE",{});var id=a(_n);Za=l(id,"__call__()"),id.forEach(o),Ua=l(A," and "),Jo=r(A,"A",{href:!0});var ld=a(Jo);za=l(ld,"decode()"),ld.forEach(o),Wa=l(A," for more information."),A.forEach(o),Ba=f(H),We=r(H,"DIV",{class:!0});var xs=a(We);I(kt.$$.fragment,xs),Na=f(xs),Et=r(xs,"P",{});var Js=a(Et);Va=l(Js,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),jo=r(Js,"A",{href:!0});var dd=a(jo);Fa=l(dd,"batch_decode()"),dd.forEach(o),Aa=l(Js,`. Please
refer to the docstring of this method for more information.`),Js.forEach(o),xs.forEach(o),Da=f(H),Be=r(H,"DIV",{class:!0});var js=a(Be);I(Zt.$$.fragment,js),qa=f(js),Ut=r(js,"P",{});var ks=a(Ut);Ra=l(ks,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),ko=r(ks,"A",{href:!0});var cd=a(ko);Xa=l(cd,"decode()"),cd.forEach(o),Ga=l(ks,`. Please refer to
the docstring of this method for more information.`),ks.forEach(o),js.forEach(o),H.forEach(o),ps=f(t),de=r(t,"H2",{class:!0});var Es=a(de);Ne=r(Es,"A",{id:!0,class:!0,href:!0});var md=a(Ne);vn=r(md,"SPAN",{});var pd=a(vn);I(zt.$$.fragment,pd),pd.forEach(o),md.forEach(o),Qa=f(Es),bn=r(Es,"SPAN",{});var gd=a(bn);Ha=l(gd,"CLIPSegModel"),gd.forEach(o),Es.forEach(o),gs=f(t),J=r(t,"DIV",{class:!0});var Y=a(J);I(Wt.$$.fragment,Y),Ya=f(Y),Bt=r(Y,"P",{});var Zs=a(Bt);Oa=l(Zs,"This model is a PyTorch "),Nt=r(Zs,"A",{href:!0,rel:!0});var fd=a(Nt);Ka=l(fd,"torch.nn.Module"),fd.forEach(o),ei=l(Zs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Zs.forEach(o),ti=f(Y),z=r(Y,"DIV",{class:!0});var st=a(z);I(Vt.$$.fragment,st),oi=f(st),ce=r(st,"P",{});var Ro=a(ce);ni=l(Ro,"The "),Eo=r(Ro,"A",{href:!0});var hd=a(Eo);si=l(hd,"CLIPSegModel"),hd.forEach(o),ri=l(Ro," forward method, overrides the "),yn=r(Ro,"CODE",{});var ud=a(yn);ai=l(ud,"__call__"),ud.forEach(o),ii=l(Ro," special method."),Ro.forEach(o),li=f(st),I(Ve.$$.fragment,st),di=f(st),I(Fe.$$.fragment,st),st.forEach(o),ci=f(Y),W=r(Y,"DIV",{class:!0});var rt=a(W);I(Ft.$$.fragment,rt),mi=f(rt),me=r(rt,"P",{});var Xo=a(me);pi=l(Xo,"The "),Zo=r(Xo,"A",{href:!0});var _d=a(Zo);gi=l(_d,"CLIPSegModel"),_d.forEach(o),fi=l(Xo," forward method, overrides the "),In=r(Xo,"CODE",{});var vd=a(In);hi=l(vd,"__call__"),vd.forEach(o),ui=l(Xo," special method."),Xo.forEach(o),_i=f(rt),I(Ae.$$.fragment,rt),vi=f(rt),I(De.$$.fragment,rt),rt.forEach(o),bi=f(Y),B=r(Y,"DIV",{class:!0});var at=a(B);I(At.$$.fragment,at),yi=f(at),pe=r(at,"P",{});var Go=a(pe);Ii=l(Go,"The "),Uo=r(Go,"A",{href:!0});var bd=a(Uo);Ci=l(bd,"CLIPSegModel"),bd.forEach(o),wi=l(Go," forward method, overrides the "),Cn=r(Go,"CODE",{});var yd=a(Cn);Mi=l(yd,"__call__"),yd.forEach(o),Ti=l(Go," special method."),Go.forEach(o),Pi=f(at),I(qe.$$.fragment,at),$i=f(at),I(Re.$$.fragment,at),at.forEach(o),Y.forEach(o),fs=f(t),ge=r(t,"H2",{class:!0});var Us=a(ge);Xe=r(Us,"A",{id:!0,class:!0,href:!0});var Id=a(Xe);wn=r(Id,"SPAN",{});var Cd=a(wn);I(Dt.$$.fragment,Cd),Cd.forEach(o),Id.forEach(o),Si=f(Us),Mn=r(Us,"SPAN",{});var wd=a(Mn);Li=l(wd,"CLIPSegTextModel"),wd.forEach(o),Us.forEach(o),hs=f(t),fe=r(t,"DIV",{class:!0});var zs=a(fe);I(qt.$$.fragment,zs),xi=f(zs),N=r(zs,"DIV",{class:!0});var it=a(N);I(Rt.$$.fragment,it),Ji=f(it),he=r(it,"P",{});var Qo=a(he);ji=l(Qo,"The "),zo=r(Qo,"A",{href:!0});var Md=a(zo);ki=l(Md,"CLIPSegTextModel"),Md.forEach(o),Ei=l(Qo," forward method, overrides the "),Tn=r(Qo,"CODE",{});var Td=a(Tn);Zi=l(Td,"__call__"),Td.forEach(o),Ui=l(Qo," special method."),Qo.forEach(o),zi=f(it),I(Ge.$$.fragment,it),Wi=f(it),I(Qe.$$.fragment,it),it.forEach(o),zs.forEach(o),us=f(t),ue=r(t,"H2",{class:!0});var Ws=a(ue);He=r(Ws,"A",{id:!0,class:!0,href:!0});var Pd=a(He);Pn=r(Pd,"SPAN",{});var $d=a(Pn);I(Xt.$$.fragment,$d),$d.forEach(o),Pd.forEach(o),Bi=f(Ws),$n=r(Ws,"SPAN",{});var Sd=a($n);Ni=l(Sd,"CLIPSegVisionModel"),Sd.forEach(o),Ws.forEach(o),_s=f(t),_e=r(t,"DIV",{class:!0});var Bs=a(_e);I(Gt.$$.fragment,Bs),Vi=f(Bs),V=r(Bs,"DIV",{class:!0});var lt=a(V);I(Qt.$$.fragment,lt),Fi=f(lt),ve=r(lt,"P",{});var Ho=a(ve);Ai=l(Ho,"The "),Wo=r(Ho,"A",{href:!0});var Ld=a(Wo);Di=l(Ld,"CLIPSegVisionModel"),Ld.forEach(o),qi=l(Ho," forward method, overrides the "),Sn=r(Ho,"CODE",{});var xd=a(Sn);Ri=l(xd,"__call__"),xd.forEach(o),Xi=l(Ho," special method."),Ho.forEach(o),Gi=f(lt),I(Ye.$$.fragment,lt),Qi=f(lt),I(Oe.$$.fragment,lt),lt.forEach(o),Bs.forEach(o),vs=f(t),be=r(t,"H2",{class:!0});var Ns=a(be);Ke=r(Ns,"A",{id:!0,class:!0,href:!0});var Jd=a(Ke);Ln=r(Jd,"SPAN",{});var jd=a(Ln);I(Ht.$$.fragment,jd),jd.forEach(o),Jd.forEach(o),Hi=f(Ns),xn=r(Ns,"SPAN",{});var kd=a(xn);Yi=l(kd,"CLIPSegForImageSegmentation"),kd.forEach(o),Ns.forEach(o),bs=f(t),Z=r(t,"DIV",{class:!0});var dt=a(Z);I(Yt.$$.fragment,dt),Oi=f(dt),Jn=r(dt,"P",{});var Ed=a(Jn);Ki=l(Ed,"CLIPSeg model with a Transformer-based decoder on top for zero-shot and one-shot image segmentation."),Ed.forEach(o),el=f(dt),Ot=r(dt,"P",{});var Vs=a(Ot);tl=l(Vs,"This model is a PyTorch "),Kt=r(Vs,"A",{href:!0,rel:!0});var Zd=a(Kt);ol=l(Zd,"torch.nn.Module"),Zd.forEach(o),nl=l(Vs,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Vs.forEach(o),sl=f(dt),F=r(dt,"DIV",{class:!0});var ct=a(F);I(eo.$$.fragment,ct),rl=f(ct),ye=r(ct,"P",{});var Yo=a(ye);al=l(Yo,"The "),Bo=r(Yo,"A",{href:!0});var Ud=a(Bo);il=l(Ud,"CLIPSegForImageSegmentation"),Ud.forEach(o),ll=l(Yo," forward method, overrides the "),jn=r(Yo,"CODE",{});var zd=a(jn);dl=l(zd,"__call__"),zd.forEach(o),cl=l(Yo," special method."),Yo.forEach(o),ml=f(ct),I(et.$$.fragment,ct),pl=f(ct),I(tt.$$.fragment,ct),ct.forEach(o),dt.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(ic)),c(p,"id","clipseg"),c(p,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(p,"href","#clipseg"),c(u,"class","relative group"),c(Pe,"id","overview"),c(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pe,"href","#overview"),c(O,"class","relative group"),c(pt,"href","https://arxiv.org/abs/2112.10003"),c(pt,"rel","nofollow"),c(ro,"href","clip"),c(co,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation"),c(mo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(po,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPModel"),c(go,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation"),Fd(Se.src,fl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/clipseg_architecture.png")||c(Se,"src",fl),c(Se,"alt","drawing"),c(Se,"width","600"),c(fo,"href","https://arxiv.org/abs/2112.10003"),c(ft,"href","https://huggingface.co/nielsr"),c(ft,"rel","nofollow"),c(ht,"href","https://github.com/timojl/clipseg"),c(ht,"rel","nofollow"),c(Le,"id","resources"),c(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Le,"href","#resources"),c(K,"class","relative group"),c(bt,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/CLIPSeg/Zero_shot_image_segmentation_with_CLIPSeg.ipynb"),c(bt,"rel","nofollow"),c(xe,"id","transformers.CLIPSegConfig"),c(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(xe,"href","#transformers.CLIPSegConfig"),c(ee,"class","relative group"),c(_o,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegConfig"),c(vo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(Ct,"href","https://huggingface.co/CIDAS/clipseg-rd64"),c(Ct,"rel","nofollow"),c(bo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(yo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Io,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegConfig"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ke,"id","transformers.CLIPSegTextConfig"),c(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ke,"href","#transformers.CLIPSegTextConfig"),c(oe,"class","relative group"),c(Co,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c($t,"href","https://huggingface.co/CIDAS/clipseg-rd64"),c($t,"rel","nofollow"),c(wo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Mo,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ze,"id","transformers.CLIPSegVisionConfig"),c(Ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ze,"href","#transformers.CLIPSegVisionConfig"),c(re,"class","relative group"),c(To,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(xt,"href","https://huggingface.co/CIDAS/clipseg-rd64"),c(xt,"rel","nofollow"),c(Po,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c($o,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ze,"id","transformers.CLIPSegProcessor"),c(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ze,"href","#transformers.CLIPSegProcessor"),c(le,"class","relative group"),c(So,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegProcessor"),c(Lo,"href","/docs/transformers/v4.32.0/en/model_doc/vit#transformers.ViTImageProcessor"),c(xo,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizerFast"),c(Jo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegProcessor.decode"),c(jo,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),c(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ko,"href","/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),c(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ne,"id","transformers.CLIPSegModel"),c(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ne,"href","#transformers.CLIPSegModel"),c(de,"class","relative group"),c(Nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Nt,"rel","nofollow"),c(Eo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Zo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Uo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Xe,"id","transformers.CLIPSegTextModel"),c(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Xe,"href","#transformers.CLIPSegTextModel"),c(ge,"class","relative group"),c(zo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(He,"id","transformers.CLIPSegVisionModel"),c(He,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(He,"href","#transformers.CLIPSegVisionModel"),c(ue,"class","relative group"),c(Wo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegVisionModel"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ke,"id","transformers.CLIPSegForImageSegmentation"),c(Ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ke,"href","#transformers.CLIPSegForImageSegmentation"),c(be,"class","relative group"),c(Kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Kt,"rel","nofollow"),c(Bo,"href","/docs/transformers/v4.32.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,d),_(t,b,h),_(t,u,h),e(u,p),e(p,v),C(n,v,null),e(u,m),e(u,$),e($,Fs),_(t,qn,h),_(t,O,h),e(O,Pe),e(Pe,Ko),C(mt,Ko,null),e(O,As),e(O,en),e(en,Ds),_(t,Rn,h),_(t,q,h),e(q,qs),e(q,pt),e(pt,Rs),e(q,Xs),e(q,ro),e(ro,Gs),e(q,Qs),_(t,Xn,h),_(t,ao,h),e(ao,Hs),_(t,Gn,h),_(t,io,h),e(io,tn),e(tn,Ys),_(t,Qn,h),_(t,lo,h),e(lo,Os),_(t,Hn,h),_(t,$e,h),e($e,R),e(R,co),e(co,Ks),e(R,er),e(R,mo),e(mo,tr),e(R,or),e(R,po),e(po,nr),e(R,sr),e($e,rr),e($e,U),e(U,go),e(go,ar),e(U,ir),e(U,on),e(on,lr),e(U,dr),e(U,nn),e(nn,cr),e(U,mr),e(U,sn),e(sn,pr),e(U,gr),_(t,Yn,h),_(t,Se,h),_(t,On,h),_(t,gt,h),e(gt,fr),e(gt,fo),e(fo,hr),_(t,Kn,h),_(t,X,h),e(X,ur),e(X,ft),e(ft,_r),e(X,vr),e(X,ht),e(ht,br),e(X,yr),_(t,es,h),_(t,K,h),e(K,Le),e(Le,rn),C(ut,rn,null),e(K,Ir),e(K,an),e(an,Cr),_(t,ts,h),_(t,ho,h),e(ho,wr),_(t,os,h),C(_t,t,h),_(t,ns,h),_(t,uo,h),e(uo,vt),e(vt,Mr),e(vt,bt),e(bt,Tr),e(vt,Pr),_(t,ss,h),_(t,ee,h),e(ee,xe),e(xe,ln),C(yt,ln,null),e(ee,$r),e(ee,dn),e(dn,Sr),_(t,rs,h),_(t,L,h),C(It,L,null),e(L,Lr),e(L,G),e(G,_o),e(_o,xr),e(G,Jr),e(G,vo),e(vo,jr),e(G,kr),e(G,Ct),e(Ct,Er),e(G,Zr),e(L,Ur),e(L,te),e(te,zr),e(te,bo),e(bo,Wr),e(te,Br),e(te,yo),e(yo,Nr),e(te,Vr),e(L,Fr),C(Je,L,null),e(L,Ar),e(L,je),C(wt,je,null),e(je,Dr),e(je,Mt),e(Mt,qr),e(Mt,Io),e(Io,Rr),e(Mt,Xr),_(t,as,h),_(t,oe,h),e(oe,ke),e(ke,cn),C(Tt,cn,null),e(oe,Gr),e(oe,mn),e(mn,Qr),_(t,is,h),_(t,k,h),C(Pt,k,null),e(k,Hr),e(k,ne),e(ne,Yr),e(ne,Co),e(Co,Or),e(ne,Kr),e(ne,$t),e($t,ea),e(ne,ta),e(k,oa),e(k,se),e(se,na),e(se,wo),e(wo,sa),e(se,ra),e(se,Mo),e(Mo,aa),e(se,ia),e(k,la),C(Ee,k,null),_(t,ls,h),_(t,re,h),e(re,Ze),e(Ze,pn),C(St,pn,null),e(re,da),e(re,gn),e(gn,ca),_(t,ds,h),_(t,E,h),C(Lt,E,null),e(E,ma),e(E,ae),e(ae,pa),e(ae,To),e(To,ga),e(ae,fa),e(ae,xt),e(xt,ha),e(ae,ua),e(E,_a),e(E,ie),e(ie,va),e(ie,Po),e(Po,ba),e(ie,ya),e(ie,$o),e($o,Ia),e(ie,Ca),e(E,wa),C(Ue,E,null),_(t,cs,h),_(t,le,h),e(le,ze),e(ze,fn),C(Jt,fn,null),e(le,Ma),e(le,hn),e(hn,Ta),_(t,ms,h),_(t,x,h),C(jt,x,null),e(x,Pa),e(x,un),e(un,$a),e(x,Sa),e(x,j),e(j,So),e(So,La),e(j,xa),e(j,Lo),e(Lo,Ja),e(j,ja),e(j,xo),e(xo,ka),e(j,Ea),e(j,_n),e(_n,Za),e(j,Ua),e(j,Jo),e(Jo,za),e(j,Wa),e(x,Ba),e(x,We),C(kt,We,null),e(We,Na),e(We,Et),e(Et,Va),e(Et,jo),e(jo,Fa),e(Et,Aa),e(x,Da),e(x,Be),C(Zt,Be,null),e(Be,qa),e(Be,Ut),e(Ut,Ra),e(Ut,ko),e(ko,Xa),e(Ut,Ga),_(t,ps,h),_(t,de,h),e(de,Ne),e(Ne,vn),C(zt,vn,null),e(de,Qa),e(de,bn),e(bn,Ha),_(t,gs,h),_(t,J,h),C(Wt,J,null),e(J,Ya),e(J,Bt),e(Bt,Oa),e(Bt,Nt),e(Nt,Ka),e(Bt,ei),e(J,ti),e(J,z),C(Vt,z,null),e(z,oi),e(z,ce),e(ce,ni),e(ce,Eo),e(Eo,si),e(ce,ri),e(ce,yn),e(yn,ai),e(ce,ii),e(z,li),C(Ve,z,null),e(z,di),C(Fe,z,null),e(J,ci),e(J,W),C(Ft,W,null),e(W,mi),e(W,me),e(me,pi),e(me,Zo),e(Zo,gi),e(me,fi),e(me,In),e(In,hi),e(me,ui),e(W,_i),C(Ae,W,null),e(W,vi),C(De,W,null),e(J,bi),e(J,B),C(At,B,null),e(B,yi),e(B,pe),e(pe,Ii),e(pe,Uo),e(Uo,Ci),e(pe,wi),e(pe,Cn),e(Cn,Mi),e(pe,Ti),e(B,Pi),C(qe,B,null),e(B,$i),C(Re,B,null),_(t,fs,h),_(t,ge,h),e(ge,Xe),e(Xe,wn),C(Dt,wn,null),e(ge,Si),e(ge,Mn),e(Mn,Li),_(t,hs,h),_(t,fe,h),C(qt,fe,null),e(fe,xi),e(fe,N),C(Rt,N,null),e(N,Ji),e(N,he),e(he,ji),e(he,zo),e(zo,ki),e(he,Ei),e(he,Tn),e(Tn,Zi),e(he,Ui),e(N,zi),C(Ge,N,null),e(N,Wi),C(Qe,N,null),_(t,us,h),_(t,ue,h),e(ue,He),e(He,Pn),C(Xt,Pn,null),e(ue,Bi),e(ue,$n),e($n,Ni),_(t,_s,h),_(t,_e,h),C(Gt,_e,null),e(_e,Vi),e(_e,V),C(Qt,V,null),e(V,Fi),e(V,ve),e(ve,Ai),e(ve,Wo),e(Wo,Di),e(ve,qi),e(ve,Sn),e(Sn,Ri),e(ve,Xi),e(V,Gi),C(Ye,V,null),e(V,Qi),C(Oe,V,null),_(t,vs,h),_(t,be,h),e(be,Ke),e(Ke,Ln),C(Ht,Ln,null),e(be,Hi),e(be,xn),e(xn,Yi),_(t,bs,h),_(t,Z,h),C(Yt,Z,null),e(Z,Oi),e(Z,Jn),e(Jn,Ki),e(Z,el),e(Z,Ot),e(Ot,tl),e(Ot,Kt),e(Kt,ol),e(Ot,nl),e(Z,sl),e(Z,F),C(eo,F,null),e(F,rl),e(F,ye),e(ye,al),e(ye,Bo),e(Bo,il),e(ye,ll),e(ye,jn),e(jn,dl),e(ye,cl),e(F,ml),C(et,F,null),e(F,pl),C(tt,F,null),ys=!0},p(t,[h]){const to={};h&2&&(to.$$scope={dirty:h,ctx:t}),Je.$set(to);const kn={};h&2&&(kn.$$scope={dirty:h,ctx:t}),Ee.$set(kn);const En={};h&2&&(En.$$scope={dirty:h,ctx:t}),Ue.$set(En);const Zn={};h&2&&(Zn.$$scope={dirty:h,ctx:t}),Ve.$set(Zn);const oo={};h&2&&(oo.$$scope={dirty:h,ctx:t}),Fe.$set(oo);const Un={};h&2&&(Un.$$scope={dirty:h,ctx:t}),Ae.$set(Un);const zn={};h&2&&(zn.$$scope={dirty:h,ctx:t}),De.$set(zn);const Wn={};h&2&&(Wn.$$scope={dirty:h,ctx:t}),qe.$set(Wn);const Ie={};h&2&&(Ie.$$scope={dirty:h,ctx:t}),Re.$set(Ie);const Bn={};h&2&&(Bn.$$scope={dirty:h,ctx:t}),Ge.$set(Bn);const Nn={};h&2&&(Nn.$$scope={dirty:h,ctx:t}),Qe.$set(Nn);const Vn={};h&2&&(Vn.$$scope={dirty:h,ctx:t}),Ye.$set(Vn);const Fn={};h&2&&(Fn.$$scope={dirty:h,ctx:t}),Oe.$set(Fn);const An={};h&2&&(An.$$scope={dirty:h,ctx:t}),et.$set(An);const Dn={};h&2&&(Dn.$$scope={dirty:h,ctx:t}),tt.$set(Dn)},i(t){ys||(w(n.$$.fragment,t),w(mt.$$.fragment,t),w(ut.$$.fragment,t),w(_t.$$.fragment,t),w(yt.$$.fragment,t),w(It.$$.fragment,t),w(Je.$$.fragment,t),w(wt.$$.fragment,t),w(Tt.$$.fragment,t),w(Pt.$$.fragment,t),w(Ee.$$.fragment,t),w(St.$$.fragment,t),w(Lt.$$.fragment,t),w(Ue.$$.fragment,t),w(Jt.$$.fragment,t),w(jt.$$.fragment,t),w(kt.$$.fragment,t),w(Zt.$$.fragment,t),w(zt.$$.fragment,t),w(Wt.$$.fragment,t),w(Vt.$$.fragment,t),w(Ve.$$.fragment,t),w(Fe.$$.fragment,t),w(Ft.$$.fragment,t),w(Ae.$$.fragment,t),w(De.$$.fragment,t),w(At.$$.fragment,t),w(qe.$$.fragment,t),w(Re.$$.fragment,t),w(Dt.$$.fragment,t),w(qt.$$.fragment,t),w(Rt.$$.fragment,t),w(Ge.$$.fragment,t),w(Qe.$$.fragment,t),w(Xt.$$.fragment,t),w(Gt.$$.fragment,t),w(Qt.$$.fragment,t),w(Ye.$$.fragment,t),w(Oe.$$.fragment,t),w(Ht.$$.fragment,t),w(Yt.$$.fragment,t),w(eo.$$.fragment,t),w(et.$$.fragment,t),w(tt.$$.fragment,t),ys=!0)},o(t){M(n.$$.fragment,t),M(mt.$$.fragment,t),M(ut.$$.fragment,t),M(_t.$$.fragment,t),M(yt.$$.fragment,t),M(It.$$.fragment,t),M(Je.$$.fragment,t),M(wt.$$.fragment,t),M(Tt.$$.fragment,t),M(Pt.$$.fragment,t),M(Ee.$$.fragment,t),M(St.$$.fragment,t),M(Lt.$$.fragment,t),M(Ue.$$.fragment,t),M(Jt.$$.fragment,t),M(jt.$$.fragment,t),M(kt.$$.fragment,t),M(Zt.$$.fragment,t),M(zt.$$.fragment,t),M(Wt.$$.fragment,t),M(Vt.$$.fragment,t),M(Ve.$$.fragment,t),M(Fe.$$.fragment,t),M(Ft.$$.fragment,t),M(Ae.$$.fragment,t),M(De.$$.fragment,t),M(At.$$.fragment,t),M(qe.$$.fragment,t),M(Re.$$.fragment,t),M(Dt.$$.fragment,t),M(qt.$$.fragment,t),M(Rt.$$.fragment,t),M(Ge.$$.fragment,t),M(Qe.$$.fragment,t),M(Xt.$$.fragment,t),M(Gt.$$.fragment,t),M(Qt.$$.fragment,t),M(Ye.$$.fragment,t),M(Oe.$$.fragment,t),M(Ht.$$.fragment,t),M(Yt.$$.fragment,t),M(eo.$$.fragment,t),M(et.$$.fragment,t),M(tt.$$.fragment,t),ys=!1},d(t){o(d),t&&o(b),t&&o(u),T(n),t&&o(qn),t&&o(O),T(mt),t&&o(Rn),t&&o(q),t&&o(Xn),t&&o(ao),t&&o(Gn),t&&o(io),t&&o(Qn),t&&o(lo),t&&o(Hn),t&&o($e),t&&o(Yn),t&&o(Se),t&&o(On),t&&o(gt),t&&o(Kn),t&&o(X),t&&o(es),t&&o(K),T(ut),t&&o(ts),t&&o(ho),t&&o(os),T(_t,t),t&&o(ns),t&&o(uo),t&&o(ss),t&&o(ee),T(yt),t&&o(rs),t&&o(L),T(It),T(Je),T(wt),t&&o(as),t&&o(oe),T(Tt),t&&o(is),t&&o(k),T(Pt),T(Ee),t&&o(ls),t&&o(re),T(St),t&&o(ds),t&&o(E),T(Lt),T(Ue),t&&o(cs),t&&o(le),T(Jt),t&&o(ms),t&&o(x),T(jt),T(kt),T(Zt),t&&o(ps),t&&o(de),T(zt),t&&o(gs),t&&o(J),T(Wt),T(Vt),T(Ve),T(Fe),T(Ft),T(Ae),T(De),T(At),T(qe),T(Re),t&&o(fs),t&&o(ge),T(Dt),t&&o(hs),t&&o(fe),T(qt),T(Rt),T(Ge),T(Qe),t&&o(us),t&&o(ue),T(Xt),t&&o(_s),t&&o(_e),T(Gt),T(Qt),T(Ye),T(Oe),t&&o(vs),t&&o(be),T(Ht),t&&o(bs),t&&o(Z),T(Yt),T(eo),T(et),T(tt)}}}const ic={local:"clipseg",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.CLIPSegConfig",title:"CLIPSegConfig"},{local:"transformers.CLIPSegTextConfig",title:"CLIPSegTextConfig"},{local:"transformers.CLIPSegVisionConfig",title:"CLIPSegVisionConfig"},{local:"transformers.CLIPSegProcessor",title:"CLIPSegProcessor"},{local:"transformers.CLIPSegModel",title:"CLIPSegModel"},{local:"transformers.CLIPSegTextModel",title:"CLIPSegTextModel"},{local:"transformers.CLIPSegVisionModel",title:"CLIPSegVisionModel"},{local:"transformers.CLIPSegForImageSegmentation",title:"CLIPSegForImageSegmentation"}],title:"CLIPSeg"};function lc(P){return Ad(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uc extends Wd{constructor(d){super();Bd(this,d,lc,ac,Nd,{})}}export{uc as default,ic as metadata};
