import{S as Wd,i as Nd,s as Bd,e as s,k as g,w as b,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 $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Te}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as we}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as qd}from"../../chunks/PipelineTag-hf-doc-builder.js";function Dd(P){let d,y,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"),y=i("Example:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,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"),y=i("Example:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,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"),y=i("Example:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Example:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function Qd(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function Yd(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function Kd(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function tc(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function nc(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v;return{c(){d=s("p"),y=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);y=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(m,"CODE",{});var S=a(u);p=l(S,"Module"),S.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,y),e(d,u),e(u,p),e(d,v)},d(n){n&&o(d)}}}function rc(P){let d,y,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"),y=i("Examples:"),u=g(),b(p.$$.fragment)},l(n){d=r(n,"P",{});var m=a(d);y=l(m,"Examples:"),m.forEach(o),u=f(n),I(p.$$.fragment,n)},m(n,m){_(n,d,m),e(d,y),_(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,y,u,p,v,n,m,S,Fs,Dn,O,Pe,Ko,mt,As,en,qs,Rn,D,Ds,pt,Rs,Xs,ro,Gs,Qs,Xn,ao,Hs,Gn,io,tn,Ys,Qn,lo,Os,Hn,Se,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,$e,fl,On,gt,fr,fo,hr,Kn,X,ur,ft,_r,vr,ht,yr,br,es,K,Le,rn,ut,Ir,an,Cr,ts,ho,wr,os,_t,ns,uo,vt,Mr,yt,Tr,Pr,ss,ee,xe,ln,bt,Sr,dn,$r,rs,L,It,Lr,G,_o,xr,Jr,vo,jr,kr,Ct,Er,Zr,Ur,te,zr,yo,Wr,Nr,bo,Br,Vr,Fr,Je,Ar,je,wt,qr,Mt,Dr,Io,Rr,Xr,as,oe,ke,cn,Tt,Gr,mn,Qr,is,k,Pt,Hr,ne,Yr,Co,Or,Kr,St,ea,ta,oa,se,na,wo,sa,ra,Mo,aa,ia,la,Ee,ls,re,Ze,pn,$t,da,gn,ca,ds,E,Lt,ma,ae,pa,To,ga,fa,xt,ha,ua,_a,ie,va,Po,ya,ba,So,Ia,Ca,wa,Ue,cs,le,ze,fn,Jt,Ma,hn,Ta,ms,x,jt,Pa,un,Sa,$a,j,$o,La,xa,Lo,Ja,ja,xo,ka,Ea,_n,Za,Ua,Jo,za,Wa,Na,We,kt,Ba,Et,Va,jo,Fa,Aa,qa,Ne,Zt,Da,Ut,Ra,ko,Xa,Ga,ps,de,Be,vn,zt,Qa,yn,Ha,gs,J,Wt,Ya,Nt,Oa,Bt,Ka,ei,ti,z,Vt,oi,ce,ni,Eo,si,ri,bn,ai,ii,li,Ve,di,Fe,ci,W,Ft,mi,me,pi,Zo,gi,fi,In,hi,ui,_i,Ae,vi,qe,yi,N,At,bi,pe,Ii,Uo,Ci,wi,Cn,Mi,Ti,Pi,De,Si,Re,fs,ge,Xe,wn,qt,$i,Mn,Li,hs,fe,Dt,xi,B,Rt,Ji,he,ji,zo,ki,Ei,Tn,Zi,Ui,zi,Ge,Wi,Qe,us,ue,He,Pn,Xt,Ni,Sn,Bi,_s,_e,Gt,Vi,V,Qt,Fi,ve,Ai,Wo,qi,Di,$n,Ri,Xi,Gi,Ye,Qi,Oe,vs,ye,Ke,Ln,Ht,Hi,xn,Yi,ys,Z,Yt,Oi,Jn,Ki,el,Ot,tl,Kt,ol,nl,sl,F,eo,rl,be,al,No,il,ll,jn,dl,cl,ml,et,pl,tt,bs;return n=new q({}),mt=new q({}),ut=new q({}),_t=new qd({props:{pipeline:"image-segmentation"}}),bt=new q({}),It=new $({props:{name:"class transformers.CLIPSegConfig",anchor:"transformers.CLIPSegConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"extract_layers",val:" = [3, 6, 9]"},{name:"reduce_dim",val:" = 64"},{name:"decoder_num_attention_heads",val:" = 4"},{name:"decoder_attention_dropout",val:" = 0.0"},{name:"decoder_hidden_act",val:" = 'quick_gelu'"},{name:"decoder_intermediate_size",val:" = 2048"},{name:"conditional_layer",val:" = 0"},{name:"use_complex_transposed_convolution",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.30.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.30.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.30.0/src/transformers/models/clipseg/configuration_clipseg.py#L236"}}),Je=new we({props:{anchor:"transformers.CLIPSegConfig.example",$$slots:{default:[Dd]},$$scope:{ctx:P}}}),wt=new $({props:{name:"from_text_vision_configs",anchor:"transformers.CLIPSegConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": CLIPSegTextConfig"},{name:"vision_config",val:": CLIPSegVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/configuration_clipseg.py#L412",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegConfig"
>CLIPSegConfig</a></p>
`}}),Tt=new q({}),Pt=new $({props:{name:"class transformers.CLIPSegTextConfig",anchor:"transformers.CLIPSegTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{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.30.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.30.0/src/transformers/models/clipseg/configuration_clipseg.py#L32"}}),Ee=new we({props:{anchor:"transformers.CLIPSegTextConfig.example",$$slots:{default:[Rd]},$$scope:{ctx:P}}}),$t=new q({}),Lt=new $({props:{name:"class transformers.CLIPSegVisionConfig",anchor:"transformers.CLIPSegVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPSegVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPSegVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPSegVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPSegVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.CLIPSegVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.CLIPSegVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPSegVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPSegVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPSegVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.CLIPSegVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/configuration_clipseg.py#L135"}}),Ue=new we({props:{anchor:"transformers.CLIPSegVisionConfig.example",$$slots:{default:[Xd]},$$scope:{ctx:P}}}),Jt=new q({}),jt=new $({props:{name:"class transformers.CLIPSegProcessor",anchor:"transformers.CLIPSegProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPSegProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.30.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.30.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.30.0/src/transformers/models/clipseg/processing_clipseg.py#L25"}}),kt=new $({props:{name:"batch_decode",anchor:"transformers.CLIPSegProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/processing_clipseg.py#L132"}}),Zt=new $({props:{name:"decode",anchor:"transformers.CLIPSegProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/processing_clipseg.py#L139"}}),zt=new q({}),Wt=new $({props:{name:"class transformers.CLIPSegModel",anchor:"transformers.CLIPSegModel",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L951"}}),Vt=new $({props:{name:"forward",anchor:"transformers.CLIPSegModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L1082",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.30.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.30.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.30.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.30.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 $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L986",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.30.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}}}),qe=new we({props:{anchor:"transformers.CLIPSegModel.get_text_features.example",$$slots:{default:[Yd]},$$scope:{ctx:P}}}),At=new $({props:{name:"get_image_features",anchor:"transformers.CLIPSegModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L1033",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.30.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>
`}}),De=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}}}),qt=new q({}),Dt=new $({props:{name:"class transformers.CLIPSegTextModel",anchor:"transformers.CLIPSegTextModel",parameters:[{name:"config",val:": CLIPSegTextConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L783"}}),Rt=new $({props:{name:"forward",anchor:"transformers.CLIPSegTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L800",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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 q({}),Gt=new $({props:{name:"class transformers.CLIPSegVisionModel",anchor:"transformers.CLIPSegVisionModel",parameters:[{name:"config",val:": CLIPSegVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L898"}}),Qt=new $({props:{name:"forward",anchor:"transformers.CLIPSegVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L911",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.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.30.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 q({}),Yt=new $({props:{name:"class transformers.CLIPSegForImageSegmentation",anchor:"transformers.CLIPSegForImageSegmentation",parameters:[{name:"config",val:": CLIPSegConfig"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.30.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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L1339"}}),eo=new $({props:{name:"forward",anchor:"transformers.CLIPSegForImageSegmentation.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"conditional_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.CLIPSegForImageSegmentation.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.30.0/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__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.30.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.30.0/src/transformers/models/clipseg/modeling_clipseg.py#L1384",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.30.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"),y=g(),u=s("h1"),p=s("a"),v=s("span"),b(n.$$.fragment),m=g(),S=s("span"),Fs=i("CLIPSeg"),Dn=g(),O=s("h2"),Pe=s("a"),Ko=s("span"),b(mt.$$.fragment),As=g(),en=s("span"),qs=i("Overview"),Rn=g(),D=s("p"),Ds=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(),Se=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(),$e=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"),yr=i("here"),br=i("."),es=g(),K=s("h2"),Le=s("a"),rn=s("span"),b(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(),b(_t.$$.fragment),ns=g(),uo=s("ul"),vt=s("li"),Mr=i("A notebook that illustrates "),yt=s("a"),Tr=i("zero-shot image segmentation with CLIPSeg"),Pr=i("."),ss=g(),ee=s("h2"),xe=s("a"),ln=s("span"),b(bt.$$.fragment),Sr=g(),dn=s("span"),$r=i("CLIPSegConfig"),rs=g(),L=s("div"),b(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 "),yo=s("a"),Wr=i("PretrainedConfig"),Nr=i(` and can be used to control the model outputs. Read the
documentation from `),bo=s("a"),Br=i("PretrainedConfig"),Vr=i(" for more information."),Fr=g(),b(Je.$$.fragment),Ar=g(),je=s("div"),b(wt.$$.fragment),qr=g(),Mt=s("p"),Dr=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"),b(Tt.$$.fragment),Gr=g(),mn=s("span"),Qr=i("CLIPSegTextConfig"),is=g(),k=s("div"),b(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
`),St=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(),b(Ee.$$.fragment),ls=g(),re=s("h2"),Ze=s("a"),pn=s("span"),b($t.$$.fragment),da=g(),gn=s("span"),ca=i("CLIPSegVisionConfig"),ds=g(),E=s("div"),b(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"),ya=i("PretrainedConfig"),ba=i(` and can be used to control the model outputs. Read the
documentation from `),So=s("a"),Ia=i("PretrainedConfig"),Ca=i(" for more information."),wa=g(),b(Ue.$$.fragment),cs=g(),le=s("h2"),ze=s("a"),fn=s("span"),b(Jt.$$.fragment),Ma=g(),hn=s("span"),Ta=i("CLIPSegProcessor"),ms=g(),x=s("div"),b(jt.$$.fragment),Pa=g(),un=s("p"),Sa=i("Constructs a CLIPSeg processor which wraps a CLIPSeg image processor and a CLIP tokenizer into a single processor."),$a=g(),j=s("p"),$o=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."),Na=g(),We=s("div"),b(kt.$$.fragment),Ba=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.`),qa=g(),Ne=s("div"),b(Zt.$$.fragment),Da=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"),Be=s("a"),vn=s("span"),b(zt.$$.fragment),Qa=g(),yn=s("span"),Ha=i("CLIPSegModel"),gs=g(),J=s("div"),b(Wt.$$.fragment),Ya=g(),Nt=s("p"),Oa=i("This model is a PyTorch "),Bt=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"),b(Vt.$$.fragment),oi=g(),ce=s("p"),ni=i("The "),Eo=s("a"),si=i("CLIPSegModel"),ri=i(" forward method, overrides the "),bn=s("code"),ai=i("__call__"),ii=i(" special method."),li=g(),b(Ve.$$.fragment),di=g(),b(Fe.$$.fragment),ci=g(),W=s("div"),b(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(),b(Ae.$$.fragment),vi=g(),b(qe.$$.fragment),yi=g(),N=s("div"),b(At.$$.fragment),bi=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(),b(De.$$.fragment),Si=g(),b(Re.$$.fragment),fs=g(),ge=s("h2"),Xe=s("a"),wn=s("span"),b(qt.$$.fragment),$i=g(),Mn=s("span"),Li=i("CLIPSegTextModel"),hs=g(),fe=s("div"),b(Dt.$$.fragment),xi=g(),B=s("div"),b(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(),b(Ge.$$.fragment),Wi=g(),b(Qe.$$.fragment),us=g(),ue=s("h2"),He=s("a"),Pn=s("span"),b(Xt.$$.fragment),Ni=g(),Sn=s("span"),Bi=i("CLIPSegVisionModel"),_s=g(),_e=s("div"),b(Gt.$$.fragment),Vi=g(),V=s("div"),b(Qt.$$.fragment),Fi=g(),ve=s("p"),Ai=i("The "),Wo=s("a"),qi=i("CLIPSegVisionModel"),Di=i(" forward method, overrides the "),$n=s("code"),Ri=i("__call__"),Xi=i(" special method."),Gi=g(),b(Ye.$$.fragment),Qi=g(),b(Oe.$$.fragment),vs=g(),ye=s("h2"),Ke=s("a"),Ln=s("span"),b(Ht.$$.fragment),Hi=g(),xn=s("span"),Yi=i("CLIPSegForImageSegmentation"),ys=g(),Z=s("div"),b(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"),b(eo.$$.fragment),rl=g(),be=s("p"),al=i("The "),No=s("a"),il=i("CLIPSegForImageSegmentation"),ll=i(" forward method, overrides the "),jn=s("code"),dl=i("__call__"),cl=i(" special method."),ml=g(),b(et.$$.fragment),pl=g(),b(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),y=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),S=r(to,"SPAN",{});var Zn=a(S);Fs=l(Zn,"CLIPSeg"),Zn.forEach(o),to.forEach(o),Dn=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);qs=l(Wn,"Overview"),Wn.forEach(o),oo.forEach(o),Rn=f(t),D=r(t,"P",{});var Ie=a(D);Ds=l(Ie,"The CLIPSeg model was proposed in "),pt=r(Ie,"A",{href:!0,rel:!0});var Nn=a(pt);Rs=l(Nn,"Image Segmentation Using Text and Image Prompts"),Nn.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 Bn=a(ro);Gs=l(Bn,"CLIP"),Bn.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 qn=a(lo);Os=l(qn,"Tips:"),qn.forEach(o),Hn=f(t),Se=r(t,"UL",{});var Is=a(Se);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 yl=a(on);lr=l(yl,"input_ids"),yl.forEach(o),dr=l(Ce,") or an image (provided to the model as "),nn=r(Ce,"CODE",{});var bl=a(nn);cr=l(bl,"conditional_pixel_values"),bl.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),$e=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 Bo=a(X);ur=l(Bo,"This model was contributed by "),ft=r(Bo,"A",{href:!0,rel:!0});var wl=a(ft);_r=l(wl,"nielsr"),wl.forEach(o),vr=l(Bo,`.
The original code can be found `),ht=r(Bo,"A",{href:!0,rel:!0});var Ml=a(ht);yr=l(Ml,"here"),Ml.forEach(o),br=l(Bo,"."),Bo.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 Sl=a(an);Cr=l(Sl,"Resources"),Sl.forEach(o),Cs.forEach(o),ts=f(t),ho=r(t,"P",{});var $l=a(ho);wr=l($l,"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."),$l.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 "),yt=r(ws,"A",{href:!0,rel:!0});var xl=a(yt);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(bt.$$.fragment,jl),jl.forEach(o),Jl.forEach(o),Sr=f(Ms),dn=r(Ms,"SPAN",{});var kl=a(dn);$r=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 "),yo=r(Vo,"A",{href:!0});var zl=a(yo);Wr=l(zl,"PretrainedConfig"),zl.forEach(o),Nr=l(Vo,` and can be used to control the model outputs. Read the
documentation from `),bo=r(Vo,"A",{href:!0});var Wl=a(bo);Br=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),qr=f(Ts),Mt=r(Ts,"P",{});var Ps=a(Mt);Dr=l(Ps,"Instantiate a "),Io=r(Ps,"A",{href:!0});var Nl=a(Io);Rr=l(Nl,"CLIPSegConfig"),Nl.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 Ss=a(oe);ke=r(Ss,"A",{id:!0,class:!0,href:!0});var Bl=a(ke);cn=r(Bl,"SPAN",{});var Vl=a(cn);I(Tt.$$.fragment,Vl),Vl.forEach(o),Bl.forEach(o),Gr=f(Ss),mn=r(Ss,"SPAN",{});var Fl=a(mn);Qr=l(Fl,"CLIPSegTextConfig"),Fl.forEach(o),Ss.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
`),St=r(Fo,"A",{href:!0,rel:!0});var ql=a(St);ea=l(ql,"CIDAS/clipseg-rd64"),ql.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 Dl=a(wo);sa=l(Dl,"PretrainedConfig"),Dl.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 $s=a(re);Ze=r($s,"A",{id:!0,class:!0,href:!0});var Xl=a(Ze);pn=r(Xl,"SPAN",{});var Gl=a(pn);I($t.$$.fragment,Gl),Gl.forEach(o),Xl.forEach(o),da=f($s),gn=r($s,"SPAN",{});var Ql=a(gn);ca=l(Ql,"CLIPSegVisionConfig"),Ql.forEach(o),$s.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 qo=a(ae);pa=l(qo,"This is the configuration class to store the configuration of a "),To=r(qo,"A",{href:!0});var Hl=a(To);ga=l(Hl,"CLIPSegModel"),Hl.forEach(o),fa=l(qo,`. 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(qo,"A",{href:!0,rel:!0});var Yl=a(xt);ha=l(Yl,"CIDAS/clipseg-rd64"),Yl.forEach(o),ua=l(qo," architecture."),qo.forEach(o),_a=f(nt),ie=r(nt,"P",{});var Do=a(ie);va=l(Do,"Configuration objects inherit from "),Po=r(Do,"A",{href:!0});var Ol=a(Po);ya=l(Ol,"PretrainedConfig"),Ol.forEach(o),ba=l(Do,` and can be used to control the model outputs. Read the
documentation from `),So=r(Do,"A",{href:!0});var Kl=a(So);Ia=l(Kl,"PretrainedConfig"),Kl.forEach(o),Ca=l(Do," for more information."),Do.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);Sa=l(nd,"Constructs a CLIPSeg processor which wraps a CLIPSeg image processor and a CLIP tokenizer into a single processor."),nd.forEach(o),$a=f(H),j=r(H,"P",{});var A=a(j);$o=r(A,"A",{href:!0});var sd=a($o);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),Na=f(H),We=r(H,"DIV",{class:!0});var xs=a(We);I(kt.$$.fragment,xs),Ba=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),qa=f(H),Ne=r(H,"DIV",{class:!0});var js=a(Ne);I(Zt.$$.fragment,js),Da=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);Be=r(Es,"A",{id:!0,class:!0,href:!0});var md=a(Be);vn=r(md,"SPAN",{});var pd=a(vn);I(zt.$$.fragment,pd),pd.forEach(o),md.forEach(o),Qa=f(Es),yn=r(Es,"SPAN",{});var gd=a(yn);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),Nt=r(Y,"P",{});var Zs=a(Nt);Oa=l(Zs,"This model is a PyTorch "),Bt=r(Zs,"A",{href:!0,rel:!0});var fd=a(Bt);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 "),bn=r(Ro,"CODE",{});var ud=a(bn);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(qe.$$.fragment,rt),rt.forEach(o),yi=f(Y),N=r(Y,"DIV",{class:!0});var at=a(N);I(At.$$.fragment,at),bi=f(at),pe=r(at,"P",{});var Go=a(pe);Ii=l(Go,"The "),Uo=r(Go,"A",{href:!0});var yd=a(Uo);Ci=l(yd,"CLIPSegModel"),yd.forEach(o),wi=l(Go," forward method, overrides the "),Cn=r(Go,"CODE",{});var bd=a(Cn);Mi=l(bd,"__call__"),bd.forEach(o),Ti=l(Go," special method."),Go.forEach(o),Pi=f(at),I(De.$$.fragment,at),Si=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(qt.$$.fragment,Cd),Cd.forEach(o),Id.forEach(o),$i=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(Dt.$$.fragment,zs),xi=f(zs),B=r(zs,"DIV",{class:!0});var it=a(B);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 Sd=a(Pn);I(Xt.$$.fragment,Sd),Sd.forEach(o),Pd.forEach(o),Ni=f(Ws),Sn=r(Ws,"SPAN",{});var $d=a(Sn);Bi=l($d,"CLIPSegVisionModel"),$d.forEach(o),Ws.forEach(o),_s=f(t),_e=r(t,"DIV",{class:!0});var Ns=a(_e);I(Gt.$$.fragment,Ns),Vi=f(Ns),V=r(Ns,"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);qi=l(Ld,"CLIPSegVisionModel"),Ld.forEach(o),Di=l(Ho," forward method, overrides the "),$n=r(Ho,"CODE",{});var xd=a($n);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),Ns.forEach(o),vs=f(t),ye=r(t,"H2",{class:!0});var Bs=a(ye);Ke=r(Bs,"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(Bs),xn=r(Bs,"SPAN",{});var kd=a(xn);Yi=l(kd,"CLIPSegForImageSegmentation"),kd.forEach(o),Bs.forEach(o),ys=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),be=r(ct,"P",{});var Yo=a(be);al=l(Yo,"The "),No=r(Yo,"A",{href:!0});var Ud=a(No);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.30.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation"),c(mo,"href","/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(po,"href","/docs/transformers/v4.30.0/en/model_doc/clip#transformers.CLIPModel"),c(go,"href","/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegForImageSegmentation"),Fd($e.src,fl="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/clipseg_architecture.png")||c($e,"src",fl),c($e,"alt","drawing"),c($e,"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(yt,"href","https://github.com/NielsRogge/Transformers-Tutorials/blob/master/CLIPSeg/Zero_shot_image_segmentation_with_CLIPSeg.ipynb"),c(yt,"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.30.0/en/model_doc/clipseg#transformers.CLIPSegConfig"),c(vo,"href","/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(Ct,"href","https://huggingface.co/CIDAS/clipseg-rd64"),c(Ct,"rel","nofollow"),c(yo,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(bo,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Io,"href","/docs/transformers/v4.30.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.30.0/en/model_doc/clipseg#transformers.CLIPSegModel"),c(St,"href","https://huggingface.co/CIDAS/clipseg-rd64"),c(St,"rel","nofollow"),c(wo,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Mo,"href","/docs/transformers/v4.30.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.30.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.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(So,"href","/docs/transformers/v4.30.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($o,"href","/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegProcessor"),c(Lo,"href","/docs/transformers/v4.30.0/en/model_doc/vit#transformers.ViTImageProcessor"),c(xo,"href","/docs/transformers/v4.30.0/en/model_doc/clip#transformers.CLIPTokenizerFast"),c(Jo,"href","/docs/transformers/v4.30.0/en/model_doc/clipseg#transformers.CLIPSegProcessor.decode"),c(jo,"href","/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.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.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode"),c(Ne,"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(Be,"id","transformers.CLIPSegModel"),c(Be,"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(Be,"href","#transformers.CLIPSegModel"),c(de,"class","relative group"),c(Bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Bt,"rel","nofollow"),c(Eo,"href","/docs/transformers/v4.30.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.30.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.30.0/en/model_doc/clipseg#transformers.CLIPSegModel"),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(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.30.0/en/model_doc/clipseg#transformers.CLIPSegTextModel"),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(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.30.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(ye,"class","relative group"),c(Kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Kt,"rel","nofollow"),c(No,"href","/docs/transformers/v4.30.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,y,h),_(t,u,h),e(u,p),e(p,v),C(n,v,null),e(u,m),e(u,S),e(S,Fs),_(t,Dn,h),_(t,O,h),e(O,Pe),e(Pe,Ko),C(mt,Ko,null),e(O,As),e(O,en),e(en,qs),_(t,Rn,h),_(t,D,h),e(D,Ds),e(D,pt),e(pt,Rs),e(D,Xs),e(D,ro),e(ro,Gs),e(D,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,Se,h),e(Se,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(Se,rr),e(Se,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,$e,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,yr),e(X,br),_(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,yt),e(yt,Tr),e(vt,Pr),_(t,ss,h),_(t,ee,h),e(ee,xe),e(xe,ln),C(bt,ln,null),e(ee,Sr),e(ee,dn),e(dn,$r),_(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,yo),e(yo,Wr),e(te,Nr),e(te,bo),e(bo,Br),e(te,Vr),e(L,Fr),C(Je,L,null),e(L,Ar),e(L,je),C(wt,je,null),e(je,qr),e(je,Mt),e(Mt,Dr),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,St),e(St,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($t,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,ya),e(ie,ba),e(ie,So),e(So,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,Sa),e(x,$a),e(x,j),e(j,$o),e($o,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,Na),e(x,We),C(kt,We,null),e(We,Ba),e(We,Et),e(Et,Va),e(Et,jo),e(jo,Fa),e(Et,Aa),e(x,qa),e(x,Ne),C(Zt,Ne,null),e(Ne,Da),e(Ne,Ut),e(Ut,Ra),e(Ut,ko),e(ko,Xa),e(Ut,Ga),_(t,ps,h),_(t,de,h),e(de,Be),e(Be,vn),C(zt,vn,null),e(de,Qa),e(de,yn),e(yn,Ha),_(t,gs,h),_(t,J,h),C(Wt,J,null),e(J,Ya),e(J,Nt),e(Nt,Oa),e(Nt,Bt),e(Bt,Ka),e(Nt,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,bn),e(bn,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(qe,W,null),e(J,yi),e(J,N),C(At,N,null),e(N,bi),e(N,pe),e(pe,Ii),e(pe,Uo),e(Uo,Ci),e(pe,wi),e(pe,Cn),e(Cn,Mi),e(pe,Ti),e(N,Pi),C(De,N,null),e(N,Si),C(Re,N,null),_(t,fs,h),_(t,ge,h),e(ge,Xe),e(Xe,wn),C(qt,wn,null),e(ge,$i),e(ge,Mn),e(Mn,Li),_(t,hs,h),_(t,fe,h),C(Dt,fe,null),e(fe,xi),e(fe,B),C(Rt,B,null),e(B,Ji),e(B,he),e(he,ji),e(he,zo),e(zo,ki),e(he,Ei),e(he,Tn),e(Tn,Zi),e(he,Ui),e(B,zi),C(Ge,B,null),e(B,Wi),C(Qe,B,null),_(t,us,h),_(t,ue,h),e(ue,He),e(He,Pn),C(Xt,Pn,null),e(ue,Ni),e(ue,Sn),e(Sn,Bi),_(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,qi),e(ve,Di),e(ve,$n),e($n,Ri),e(ve,Xi),e(V,Gi),C(Ye,V,null),e(V,Qi),C(Oe,V,null),_(t,vs,h),_(t,ye,h),e(ye,Ke),e(Ke,Ln),C(Ht,Ln,null),e(ye,Hi),e(ye,xn),e(xn,Yi),_(t,ys,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,be),e(be,al),e(be,No),e(No,il),e(be,ll),e(be,jn),e(jn,dl),e(be,cl),e(F,ml),C(et,F,null),e(F,pl),C(tt,F,null),bs=!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}),qe.$set(zn);const Wn={};h&2&&(Wn.$$scope={dirty:h,ctx:t}),De.$set(Wn);const Ie={};h&2&&(Ie.$$scope={dirty:h,ctx:t}),Re.$set(Ie);const Nn={};h&2&&(Nn.$$scope={dirty:h,ctx:t}),Ge.$set(Nn);const Bn={};h&2&&(Bn.$$scope={dirty:h,ctx:t}),Qe.$set(Bn);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 qn={};h&2&&(qn.$$scope={dirty:h,ctx:t}),tt.$set(qn)},i(t){bs||(w(n.$$.fragment,t),w(mt.$$.fragment,t),w(ut.$$.fragment,t),w(_t.$$.fragment,t),w(bt.$$.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($t.$$.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(qe.$$.fragment,t),w(At.$$.fragment,t),w(De.$$.fragment,t),w(Re.$$.fragment,t),w(qt.$$.fragment,t),w(Dt.$$.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),bs=!0)},o(t){M(n.$$.fragment,t),M(mt.$$.fragment,t),M(ut.$$.fragment,t),M(_t.$$.fragment,t),M(bt.$$.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($t.$$.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(qe.$$.fragment,t),M(At.$$.fragment,t),M(De.$$.fragment,t),M(Re.$$.fragment,t),M(qt.$$.fragment,t),M(Dt.$$.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),bs=!1},d(t){o(d),t&&o(y),t&&o(u),T(n),t&&o(Dn),t&&o(O),T(mt),t&&o(Rn),t&&o(D),t&&o(Xn),t&&o(ao),t&&o(Gn),t&&o(io),t&&o(Qn),t&&o(lo),t&&o(Hn),t&&o(Se),t&&o(Yn),t&&o($e),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(bt),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($t),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(qe),T(At),T(De),T(Re),t&&o(fs),t&&o(ge),T(qt),t&&o(hs),t&&o(fe),T(Dt),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(ye),T(Ht),t&&o(ys),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();Nd(this,d,lc,ac,Bd,{})}}export{uc as default,ic as metadata};
