import{s as Ar,o as Yr,n as O}from"../chunks/scheduler.9bc65507.js";import{S as Sr,i as Kr,g as a,s as i,u,A as ei,h as r,f as o,c as l,j as g,v as f,y as v,k as h,o as t,a as m,w as _,d as w,t as T,x as b}from"../chunks/index.78c82d43.js";import{T as io}from"../chunks/Tip.87d55b76.js";import{D as x}from"../chunks/Docstring.4e7352e2.js";import{C as D}from"../chunks/CodeBlock.73e038be.js";import{I as W}from"../chunks/IconCopyLink.bedaa44d.js";import{E as le}from"../chunks/ExampleCodeBlock.872b014d.js";function ti(j){let n,M="Example:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME93bFZpVFRleHRDb25maWclMkMlMjBPd2xWaVRUZXh0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwT3dsVmlUVGV4dE1vZGVsJTIwd2l0aCUyMGdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwT3dsVmlUVGV4dENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME93bFZpVFRleHRDb25maWclMjBmcm9tJTIwdGhlJTIwZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwT3dsVmlUVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OwlViTTextConfig, OwlViTTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OwlViTTextModel with google/owlvit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OwlViTTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OwlViTTextConfig from the google/owlvit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTTextModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-11lpom8"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function oi(j){let n,M="Example:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME93bFZpVFZpc2lvbkNvbmZpZyUyQyUyME93bFZpVFZpc2lvbk1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME93bFZpVFZpc2lvbk1vZGVsJTIwd2l0aCUyMGdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwT3dsVmlUVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwT3dsVmlUVmlzaW9uTW9kZWwlMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBnb29nbGUlMkZvd2x2aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRWaXNpb25Nb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OwlViTVisionConfig, OwlViTVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OwlViTVisionModel with google/owlvit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OwlViTVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OwlViTVisionModel model from the google/owlvit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTVisionModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-11lpom8"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function si(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function ni(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyME93bFZpVE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZvd2x2aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRCU1QiU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUyMCUyMCUyMyUyMHRoaXMlMjBpcyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEFwcm9icyUyMCUzRCUyMGxvZ2l0c19wZXJfaW1hZ2Uuc29mdG1heChkaW0lM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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, OwlViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTModel.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&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(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>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function ai(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function ri(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBPd2xWaVRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwT3dsVmlUTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMCU1QiUyMnBob3RvJTIwb2YlMjBhJTIwYXN0cmFuYXV0JTIyJTVEJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEF0ZXh0X2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X3RleHRfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTModel.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<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>], [<span class="hljs-string">&quot;photo of a astranaut&quot;</span>]], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function ii(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function li(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyME93bFZpVE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZvd2x2aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",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, OwlViTModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTModel.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function ci(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function di(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBPd2xWaVRUZXh0TW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyME93bFZpVFRleHRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZvd2x2aXQtYmFzZS1wYXRjaDMyJTIyKSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwJTVCJTIycGhvdG8lMjBvZiUyMGElMjBhc3RyYW5hdXQlMjIlNUQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwKEVPUyUyMHRva2VuKSUyMHN0YXRlcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTTextModel.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<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>], [<span class="hljs-string">&quot;photo of a astranaut&quot;</span>]], return_tensors=<span class="hljs-string">&quot;pt&quot;</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>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function pi(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function mi(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyME93bFZpVFZpc2lvbk1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRWaXNpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZvd2x2aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",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, OwlViTVisionModel

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function hi(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function gi(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwT3dsVmlURm9yT2JqZWN0RGV0ZWN0aW9uJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFtb2RlbCUyMCUzRCUyME93bFZpVEZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dHMlMjAlM0QlMjAlNUIlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlNUQlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRHRleHRzJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEElMjMlMjBUYXJnZXQlMjBpbWFnZSUyMHNpemVzJTIwKGhlaWdodCUyQyUyMHdpZHRoKSUyMHRvJTIwcmVzY2FsZSUyMGJveCUyMHByZWRpY3Rpb25zJTIwJTVCYmF0Y2hfc2l6ZSUyQyUyMDIlNUQlMEF0YXJnZXRfc2l6ZXMlMjAlM0QlMjB0b3JjaC5UZW5zb3IoJTVCaW1hZ2Uuc2l6ZSU1QiUzQSUzQS0xJTVEJTVEKSUwQSUyMyUyMENvbnZlcnQlMjBvdXRwdXRzJTIwKGJvdW5kaW5nJTIwYm94ZXMlMjBhbmQlMjBjbGFzcyUyMGxvZ2l0cyklMjB0byUyMGZpbmFsJTIwYm91bmRpbmclMjBib3hlcyUyMGFuZCUyMHNjb3JlcyUwQXJlc3VsdHMlMjAlM0QlMjBwcm9jZXNzb3IucG9zdF9wcm9jZXNzX29iamVjdF9kZXRlY3Rpb24oJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUzRG91dHB1dHMlMkMlMjB0aHJlc2hvbGQlM0QwLjElMkMlMjB0YXJnZXRfc2l6ZXMlM0R0YXJnZXRfc2l6ZXMlMEEpJTBBJTBBaSUyMCUzRCUyMDAlMjAlMjAlMjMlMjBSZXRyaWV2ZSUyMHByZWRpY3Rpb25zJTIwZm9yJTIwdGhlJTIwZmlyc3QlMjBpbWFnZSUyMGZvciUyMHRoZSUyMGNvcnJlc3BvbmRpbmclMjB0ZXh0JTIwcXVlcmllcyUwQXRleHQlMjAlM0QlMjB0ZXh0cyU1QmklNUQlMEFib3hlcyUyQyUyMHNjb3JlcyUyQyUyMGxhYmVscyUyMCUzRCUyMHJlc3VsdHMlNUJpJTVEJTVCJTIyYm94ZXMlMjIlNUQlMkMlMjByZXN1bHRzJTVCaSU1RCU1QiUyMnNjb3JlcyUyMiU1RCUyQyUyMHJlc3VsdHMlNUJpJTVEJTVCJTIybGFiZWxzJTIyJTVEJTBBJTBBZm9yJTIwYm94JTJDJTIwc2NvcmUlMkMlMjBsYWJlbCUyMGluJTIwemlwKGJveGVzJTJDJTIwc2NvcmVzJTJDJTIwbGFiZWxzKSUzQSUwQSUyMCUyMCUyMCUyMGJveCUyMCUzRCUyMCU1QnJvdW5kKGklMkMlMjAyKSUyMGZvciUyMGklMjBpbiUyMGJveC50b2xpc3QoKSU1RCUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJEZXRlY3RlZCUyMCU3QnRleHQlNUJsYWJlbCU1RCU3RCUyMHdpdGglMjBjb25maWRlbmNlJTIwJTdCcm91bmQoc2NvcmUuaXRlbSgpJTJDJTIwMyklN0QlMjBhdCUyMGxvY2F0aW9uJTIwJTdCYm94JTdEJTIyKQ==",highlighted:`<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTForObjectDetection

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTForObjectDetection.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&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 photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, 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><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to final bounding boxes and scores</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process_object_detection(
<span class="hljs-meta">... </span>    outputs=outputs, threshold=<span class="hljs-number">0.1</span>, target_sizes=target_sizes
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">0</span>  <span class="hljs-comment"># Retrieve predictions for the first image for the corresponding text queries</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = texts[i]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes, scores, labels = results[i][<span class="hljs-string">&quot;boxes&quot;</span>], results[i][<span class="hljs-string">&quot;scores&quot;</span>], results[i][<span class="hljs-string">&quot;labels&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> box, score, label <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(boxes, scores, labels):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Detected <span class="hljs-subst">{text[label]}</span> with confidence <span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>)
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.707</span> at location [<span class="hljs-number">324.97</span>, <span class="hljs-number">20.44</span>, <span class="hljs-number">640.58</span>, <span class="hljs-number">373.29</span>]
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.717</span> at location [<span class="hljs-number">1.46</span>, <span class="hljs-number">55.26</span>, <span class="hljs-number">315.55</span>, <span class="hljs-number">472.17</span>]`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function ui(j){let n,M=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=a("p"),n.innerHTML=M},l(d){n=r(d,"P",{"data-svelte-h":!0}),v(n)!=="svelte-fincs2"&&(n.innerHTML=M)},m(d,p){m(d,n,p)},p:O,d(d){d&&o(n)}}}function fi(j){let n,M="Examples:",d,p,y;return p=new D({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwT3dsVmlURm9yT2JqZWN0RGV0ZWN0aW9uJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gxNiUyMiklMEFtb2RlbCUyMCUzRCUyME93bFZpVEZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gxNiUyMiklMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBcXVlcnlfdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDAxNjc1LmpwZyUyMiUwQXF1ZXJ5X2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQocXVlcnlfdXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHF1ZXJ5X2ltYWdlcyUzRHF1ZXJ5X2ltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmltYWdlX2d1aWRlZF9kZXRlY3Rpb24oKippbnB1dHMpJTBBJTIzJTIwVGFyZ2V0JTIwaW1hZ2UlMjBzaXplcyUyMChoZWlnaHQlMkMlMjB3aWR0aCklMjB0byUyMHJlc2NhbGUlMjBib3glMjBwcmVkaWN0aW9ucyUyMCU1QmJhdGNoX3NpemUlMkMlMjAyJTVEJTBBdGFyZ2V0X3NpemVzJTIwJTNEJTIwdG9yY2guVGVuc29yKCU1QmltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCU1RCklMEElMjMlMjBDb252ZXJ0JTIwb3V0cHV0cyUyMChib3VuZGluZyUyMGJveGVzJTIwYW5kJTIwY2xhc3MlMjBsb2dpdHMpJTIwdG8lMjBDT0NPJTIwQVBJJTBBcmVzdWx0cyUyMCUzRCUyMHByb2Nlc3Nvci5wb3N0X3Byb2Nlc3NfaW1hZ2VfZ3VpZGVkX2RldGVjdGlvbiglMEElMjAlMjAlMjAlMjBvdXRwdXRzJTNEb3V0cHV0cyUyQyUyMHRocmVzaG9sZCUzRDAuNiUyQyUyMG5tc190aHJlc2hvbGQlM0QwLjMlMkMlMjB0YXJnZXRfc2l6ZXMlM0R0YXJnZXRfc2l6ZXMlMEEpJTBBaSUyMCUzRCUyMDAlMjAlMjAlMjMlMjBSZXRyaWV2ZSUyMHByZWRpY3Rpb25zJTIwZm9yJTIwdGhlJTIwZmlyc3QlMjBpbWFnZSUwQWJveGVzJTJDJTIwc2NvcmVzJTIwJTNEJTIwcmVzdWx0cyU1QmklNUQlNUIlMjJib3hlcyUyMiU1RCUyQyUyMHJlc3VsdHMlNUJpJTVEJTVCJTIyc2NvcmVzJTIyJTVEJTBBZm9yJTIwYm94JTJDJTIwc2NvcmUlMjBpbiUyMHppcChib3hlcyUyQyUyMHNjb3JlcyklM0ElMEElMjAlMjAlMjAlMjBib3glMjAlM0QlMjAlNUJyb3VuZChpJTJDJTIwMiklMjBmb3IlMjBpJTIwaW4lMjBib3gudG9saXN0KCklNUQlMEElMjAlMjAlMjAlMjBwcmludChmJTIyRGV0ZWN0ZWQlMjBzaW1pbGFyJTIwb2JqZWN0JTIwd2l0aCUyMGNvbmZpZGVuY2UlMjAlN0Jyb3VuZChzY29yZS5pdGVtKCklMkMlMjAzKSU3RCUyMGF0JTIwbG9jYXRpb24lMjAlN0Jib3glN0QlMjIp",highlighted:`<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTForObjectDetection

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTForObjectDetection.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch16&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>query_url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000001675.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>query_image = Image.<span class="hljs-built_in">open</span>(requests.get(query_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, query_images=query_image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model.image_guided_detection(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process_image_guided_detection(
<span class="hljs-meta">... </span>    outputs=outputs, threshold=<span class="hljs-number">0.6</span>, nms_threshold=<span class="hljs-number">0.3</span>, target_sizes=target_sizes
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">0</span>  <span class="hljs-comment"># Retrieve predictions for the first image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes, scores = results[i][<span class="hljs-string">&quot;boxes&quot;</span>], results[i][<span class="hljs-string">&quot;scores&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> box, score <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(boxes, scores):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Detected similar object with confidence <span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>)
Detected similar <span class="hljs-built_in">object</span> <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.856</span> at location [<span class="hljs-number">10.94</span>, <span class="hljs-number">50.4</span>, <span class="hljs-number">315.8</span>, <span class="hljs-number">471.39</span>]
Detected similar <span class="hljs-built_in">object</span> <span class="hljs-keyword">with</span> confidence <span class="hljs-number">1.0</span> at location [<span class="hljs-number">334.84</span>, <span class="hljs-number">25.33</span>, <span class="hljs-number">636.16</span>, <span class="hljs-number">374.71</span>]`,wrap:!1}}),{c(){n=a("p"),n.textContent=M,d=i(),u(p.$$.fragment)},l(s){n=r(s,"P",{"data-svelte-h":!0}),v(n)!=="svelte-kvfsh7"&&(n.textContent=M),d=l(s),f(p.$$.fragment,s)},m(s,V){m(s,n,V),m(s,d,V),_(p,s,V),y=!0},p:O,i(s){y||(w(p.$$.fragment,s),y=!0)},o(s){T(p.$$.fragment,s),y=!1},d(s){s&&(o(n),o(d)),b(p,s)}}}function _i(j){let n,M,d,p,y,s,V,rt,wn,lo,Fa="OWL-ViT",Ts,L,ce,Yo,it,Tn,co,Ea="Overview",bs,lt,Pa='The OWL-ViT (short for Vision Transformer for Open-World Localization) was proposed in <a href="https://arxiv.org/abs/2205.06230" rel="nofollow">Simple Open-Vocabulary Object Detection with Vision Transformers</a> by Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh Mahendran, Anurag Arnab, Mostafa Dehghani, Zhuoran Shen, Xiao Wang, Xiaohua Zhai, Thomas Kipf, and Neil Houlsby. OWL-ViT is an open-vocabulary object detection network trained on a variety of (image, text) pairs. It can be used to query an image with one or multiple text queries to search for and detect target objects described in text.',vs,ct,Ha="The abstract from the paper is the following:",ys,dt,Ga="<em>Combining simple architectures with large-scale pre-training has led to massive improvements in image classification. For object detection, pre-training and scaling approaches are less well established, especially in the long-tailed and open-vocabulary setting, where training data is relatively scarce. In this paper, we propose a strong recipe for transferring image-text models to open-vocabulary object detection. We use a standard Vision Transformer architecture with minimal modifications, contrastive image-text pre-training, and end-to-end detection fine-tuning. Our analysis of the scaling properties of this setup shows that increasing image-level pre-training and model size yield consistent improvements on the downstream detection task. We provide the adaptation strategies and regularizations needed to attain very strong performance on zero-shot text-conditioned and one-shot image-conditioned object detection. Code and models are available on GitHub.</em>",Ms,Q,de,So,pt,bn,po,Xa="Usage",Vs,mt,qa='OWL-ViT is a zero-shot text-conditioned object detection model. OWL-ViT uses <a href="clip">CLIP</a> as its multi-modal backbone, with a ViT-like Transformer to get visual features and a causal language model to get the text features. To use CLIP for detection, OWL-ViT removes the final token pooling layer of the vision model and attaches a lightweight classification and box head to each transformer output token. Open-vocabulary classification is enabled by replacing the fixed classification layer weights with the class-name embeddings obtained from the text model. The authors first train CLIP from scratch and fine-tune it end-to-end with the classification and box heads on standard detection datasets using a bipartite matching loss. One or multiple text queries per image can be used to perform zero-shot text-conditioned object detection.',js,ht,Da='<a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> can be used to resize (or rescale) and normalize images for the model and <a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> is used to encode the text. <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> wraps <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> into a single instance to both encode the text and prepare the images. The following example shows how to perform object detection using <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a>.',xs,gt,$s,ut,La='This model was contributed by <a href="https://huggingface.co/adirik" rel="nofollow">adirik</a>. The original code can be found <a href="https://github.com/google-research/scenic/tree/main/scenic/projects/owl_vit" rel="nofollow">here</a>.',Js,A,pe,Ko,ft,vn,mo,Qa="OwlViTConfig",Os,I,_t,yn,ho,Aa=`<a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> is the configuration class to store the configuration of an <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a>. It is used to
instantiate an OWL-ViT 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 OWL-ViT
<a href="https://huggingface.co/google/owlvit-base-patch32" rel="nofollow">google/owlvit-base-patch32</a> architecture.`,Mn,go,Ya=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Vn,me,wt,jn,uo,Sa=`Instantiate a <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> (or a derived class) from owlvit text model configuration and owlvit vision
model configuration.`,zs,Y,he,es,Tt,xn,fo,Ka="OwlViTTextConfig",Is,U,bt,$n,_o,er=`This is the configuration class to store the configuration of an <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a>. It is used to instantiate an
OwlViT text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the OwlViT
<a href="https://huggingface.co/google/owlvit-base-patch32" rel="nofollow">google/owlvit-base-patch32</a> architecture.`,Jn,wo,tr=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,On,ge,Us,S,ue,ts,vt,zn,To,or="OwlViTVisionConfig",Cs,C,yt,In,bo,sr=`This is the configuration class to store the configuration of an <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel">OwlViTVisionModel</a>. It is used to instantiate
an OWL-ViT image encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the OWL-ViT
<a href="https://huggingface.co/google/owlvit-base-patch32" rel="nofollow">google/owlvit-base-patch32</a> architecture.`,Un,vo,nr=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Cn,fe,ks,K,_e,os,Mt,kn,yo,ar="OwlViTImageProcessor",Zs,J,Vt,Zn,Mo,rr="Constructs an OWL-ViT image processor.",Wn,Vo,ir=`This image processor inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/image_processor#transformers.ImageProcessingMixin">ImageProcessingMixin</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Bn,we,jt,Nn,jo,lr="Prepares an image or batch of images for the model.",Rn,Te,xt,Fn,xo,cr=`Converts the raw output of <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`,En,be,$t,Pn,$o,dr=`Converts the output of <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,Ws,ee,ve,ss,Jt,Hn,Jo,pr="OwlViTFeatureExtractor",Bs,k,Ot,Gn,ye,zt,Xn,Oo,mr="Preprocess an image or a batch of images.",qn,Me,It,Dn,zo,hr=`Converts the raw output of <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`,Ln,Ve,Ut,Qn,Io,gr=`Converts the output of <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,Ns,te,je,ns,Ct,An,Uo,ur="OwlViTProcessor",Rs,$,kt,Yn,Co,fr=`Constructs an OWL-ViT processor which wraps <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>/<a href="/docs/transformers/v4.34.0/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>
into a single processor that interits both the image processor and tokenizer functionalities. See the
<code>__call__()</code> and <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTProcessor.decode">decode()</a> for more information.`,Sn,xe,Zt,Kn,ko,_r=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ea,$e,Wt,ta,Zo,wr=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,oa,Je,Bt,sa,Wo,Tr=`This method forwards all its arguments to <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTFeatureExtractor.post_process">OwlViTImageProcessor.post_process()</a>. Please refer to the docstring
of this method for more information.`,na,Oe,Nt,aa,Bo,br=`This method forwards all its arguments to <code>OwlViTImageProcessor.post_process_one_shot_object_detection</code>.
Please refer to the docstring of this method for more information.`,ra,ze,Rt,ia,No,vr=`This method forwards all its arguments to <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection">OwlViTImageProcessor.post_process_object_detection()</a>. Please refer
to the docstring of this method for more information.`,Fs,oe,Ie,as,Ft,la,Ro,yr="OwlViTModel",Es,Z,Et,ca,B,Pt,da,Fo,Mr='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',pa,Ue,ma,Ce,ha,N,Ht,ga,Eo,Vr='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',ua,ke,fa,Ze,_a,R,Gt,wa,Po,jr='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',Ta,We,ba,Be,Ps,se,Ne,rs,Xt,va,Ho,xr="OwlViTTextModel",Hs,ne,qt,ya,F,Dt,Ma,Go,$r='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a> forward method, overrides the <code>__call__</code> special method.',Va,Re,ja,Fe,Gs,ae,Ee,is,Lt,xa,Xo,Jr="OwlViTVisionModel",Xs,re,Qt,$a,E,At,Ja,qo,Or='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel">OwlViTVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Oa,Pe,za,He,qs,ie,Ge,ls,Yt,Ia,Do,zr="OwlViTForObjectDetection",Ds,X,St,Ua,P,Kt,Ca,Lo,Ir='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',ka,Xe,Za,qe,Wa,H,eo,Ba,Qo,Ur='The <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',Na,De,Ra,Le,Ls,cs,Qs;return rt=new W({}),it=new W({}),pt=new W({}),gt=new D({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBPd2xWaVRQcm9jZXNzb3IlMkMlMjBPd2xWaVRGb3JPYmplY3REZXRlY3Rpb24lMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBPd2xWaVRQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRGb3JPYmplY3REZXRlY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHRzJTIwJTNEJTIwJTVCJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTVEJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0R0ZXh0cyUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwVGFyZ2V0JTIwaW1hZ2UlMjBzaXplcyUyMChoZWlnaHQlMkMlMjB3aWR0aCklMjB0byUyMHJlc2NhbGUlMjBib3glMjBwcmVkaWN0aW9ucyUyMCU1QmJhdGNoX3NpemUlMkMlMjAyJTVEJTBBdGFyZ2V0X3NpemVzJTIwJTNEJTIwdG9yY2guVGVuc29yKCU1QmltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCU1RCklMEElMjMlMjBDb252ZXJ0JTIwb3V0cHV0cyUyMChib3VuZGluZyUyMGJveGVzJTIwYW5kJTIwY2xhc3MlMjBsb2dpdHMpJTIwdG8lMjBDT0NPJTIwQVBJJTBBcmVzdWx0cyUyMCUzRCUyMHByb2Nlc3Nvci5wb3N0X3Byb2Nlc3Nfb2JqZWN0X2RldGVjdGlvbihvdXRwdXRzJTNEb3V0cHV0cyUyQyUyMHRhcmdldF9zaXplcyUzRHRhcmdldF9zaXplcyUyQyUyMHRocmVzaG9sZCUzRDAuMSklMEFpJTIwJTNEJTIwMCUyMCUyMCUyMyUyMFJldHJpZXZlJTIwcHJlZGljdGlvbnMlMjBmb3IlMjB0aGUlMjBmaXJzdCUyMGltYWdlJTIwZm9yJTIwdGhlJTIwY29ycmVzcG9uZGluZyUyMHRleHQlMjBxdWVyaWVzJTBBdGV4dCUyMCUzRCUyMHRleHRzJTVCaSU1RCUwQWJveGVzJTJDJTIwc2NvcmVzJTJDJTIwbGFiZWxzJTIwJTNEJTIwcmVzdWx0cyU1QmklNUQlNUIlMjJib3hlcyUyMiU1RCUyQyUyMHJlc3VsdHMlNUJpJTVEJTVCJTIyc2NvcmVzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QmklNUQlNUIlMjJsYWJlbHMlMjIlNUQlMEFmb3IlMjBib3glMkMlMjBzY29yZSUyQyUyMGxhYmVsJTIwaW4lMjB6aXAoYm94ZXMlMkMlMjBzY29yZXMlMkMlMjBsYWJlbHMpJTNBJTBBJTIwJTIwJTIwJTIwYm94JTIwJTNEJTIwJTVCcm91bmQoaSUyQyUyMDIpJTIwZm9yJTIwaSUyMGluJTIwYm94LnRvbGlzdCgpJTVEJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMkRldGVjdGVkJTIwJTdCdGV4dCU1QmxhYmVsJTVEJTdEJTIwd2l0aCUyMGNvbmZpZGVuY2UlMjAlN0Jyb3VuZChzY29yZS5pdGVtKCklMkMlMjAzKSU3RCUyMGF0JTIwbG9jYXRpb24lMjAlN0Jib3glN0QlMjIp",highlighted:`<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = OwlViTProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTForObjectDetection.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&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 photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, 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><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process_object_detection(outputs=outputs, target_sizes=target_sizes, threshold=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">0</span>  <span class="hljs-comment"># Retrieve predictions for the first image for the corresponding text queries</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = texts[i]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes, scores, labels = results[i][<span class="hljs-string">&quot;boxes&quot;</span>], results[i][<span class="hljs-string">&quot;scores&quot;</span>], results[i][<span class="hljs-string">&quot;labels&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> box, score, label <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(boxes, scores, labels):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Detected <span class="hljs-subst">{text[label]}</span> with confidence <span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>)
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.707</span> at location [<span class="hljs-number">324.97</span>, <span class="hljs-number">20.44</span>, <span class="hljs-number">640.58</span>, <span class="hljs-number">373.29</span>]
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.717</span> at location [<span class="hljs-number">1.46</span>, <span class="hljs-number">55.26</span>, <span class="hljs-number">315.55</span>, <span class="hljs-number">472.17</span>]`,wrap:!1}}),ft=new W({}),_t=new x({props:{name:"class transformers.OwlViTConfig",anchor:"transformers.OwlViTConfig",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:"return_dict",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextConfig">OwlViTTextConfig</a>.`,name:"text_config"},{anchor:"transformers.OwlViTConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionConfig">OwlViTVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.OwlViTConfig.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.OwlViTConfig.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> parameter. Default is used as per the original OWL-ViT
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.OwlViTConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/configuration_owlvit.py#L251"}}),wt=new x({props:{name:"from_text_vision_configs",anchor:"transformers.OwlViTConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": typing.Dict"},{name:"vision_config",val:": typing.Dict"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/configuration_owlvit.py#L318",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTConfig"
>OwlViTConfig</a></p>
`}}),Tt=new W({}),bt=new x({props:{name:"class transformers.OwlViTTextConfig",anchor:"transformers.OwlViTTextConfig",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:" = 16"},{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:" = 0"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the OWL-ViT text model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#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.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.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.OwlViTTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/configuration_owlvit.py#L40"}}),ge=new le({props:{anchor:"transformers.OwlViTTextConfig.example",$$slots:{default:[ti]},$$scope:{ctx:j}}}),vt=new W({}),yt=new x({props:{name:"class transformers.OwlViTVisionConfig",anchor:"transformers.OwlViTVisionConfig",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:" = 768"},{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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.OwlViTVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.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.OwlViTVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/configuration_owlvit.py#L146"}}),fe=new le({props:{anchor:"transformers.OwlViTVisionConfig.example",$$slots:{default:[oi]},$$scope:{ctx:j}}}),Mt=new W({}),Vt=new x({props:{name:"class transformers.OwlViTImageProcessor",anchor:"transformers.OwlViTImageProcessor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = None"},{name:"resample",val:" = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:" = False"},{name:"crop_size",val:" = None"},{name:"do_rescale",val:" = True"},{name:"rescale_factor",val:" = 0.00392156862745098"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the shorter edge of the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.OwlViTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 768, &#x201C;width&#x201D;: 768}):
The size to use for resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. If <code>size</code> is a
sequence like (h, w), output size will be matched to this. If <code>size</code> is an int, then image will be resized
to (size, size).`,name:"size"},{anchor:"transformers.OwlViTImageProcessor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BICUBIC</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.OwlViTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to crop the input at the center. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped.`,name:"do_center_crop"},{anchor:"transformers.OwlViTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>int</code>, <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 768, &#x201C;width&#x201D;: 768}):
The size to use for center cropping the image. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.OwlViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input by a certain factor.`,name:"do_rescale"},{anchor:"transformers.OwlViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
The factor to use for rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.OwlViTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input with <code>image_mean</code> and <code>image_std</code>. Desired output size when applying
center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"do_normalize"},{anchor:"transformers.OwlViTImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images.`,name:"image_mean"},{anchor:"transformers.OwlViTImageProcessor.image_std",description:`<strong>image_std</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L91"}}),jt=new x({props:{name:"preprocess",anchor:"transformers.OwlViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
The image or batch of images to be prepared. Expects a single or batch of images with pixel values
ranging from 0 to 255. If passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether or not to resize the input. If <code>True</code>, will resize the input to the size specified by <code>size</code>.`,name:"do_resize"},{anchor:"transformers.OwlViTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
The size to resize the input to. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"size"},{anchor:"transformers.OwlViTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
The resampling filter to use when resizing the input. Only has an effect if <code>do_resize</code> is set to
<code>True</code>.`,name:"resample"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether or not to center crop the input. If <code>True</code>, will center crop the input to the size specified by
<code>crop_size</code>.`,name:"do_center_crop"},{anchor:"transformers.OwlViTImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
The size to center crop the input to. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether or not to rescale the input. If <code>True</code>, will rescale the input by dividing it by
<code>rescale_factor</code>.`,name:"do_rescale"},{anchor:"transformers.OwlViTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
The factor to rescale the input by. Only has an effect if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether or not to normalize the input. If <code>True</code>, will normalize the input by subtracting <code>image_mean</code>
and dividing by <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.OwlViTImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, List[float]]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
The mean to subtract from the input when normalizing. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_mean"},{anchor:"transformers.OwlViTImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>Union[float, List[float]]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
The standard deviation to divide the input by when normalizing. Only has an effect if <code>do_normalize</code> is
set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.OwlViTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.OwlViTImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.OwlViTImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L269"}}),xt=new x({props:{name:"post_process_object_detection",anchor:"transformers.OwlViTImageProcessor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.1"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> or <code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size
<code>(height, width)</code> of each image in the batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L458",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),$t=new x({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:" = 0.0"},{name:"nms_threshold",val:" = 0.3"},{name:"target_sizes",val:" = None"}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTImageGuidedObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Minimum confidence threshold to use to filter out predicted boxes.`,name:"threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.nms_threshold",description:`<strong>nms_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
IoU threshold for non-maximum suppression of overlapping boxes.`,name:"nms_threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Tensor of shape (batch_size, 2) where each entry is the (height, width) of the corresponding image in
the batch. If set, predicted normalized bounding boxes are rescaled to the target sizes. If left to
None, predictions will not be unnormalized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L514",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model. All labels are set to None as
<code>OwlViTForObjectDetection.image_guided_detection</code> perform one-shot object detection.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Jt=new W({}),Ot=new x({props:{name:"class transformers.OwlViTFeatureExtractor",anchor:"transformers.OwlViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/feature_extraction_owlvit.py#L26"}}),zt=new x({props:{name:"__call__",anchor:"transformers.OwlViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/image_processing_utils.py#L544"}}),It=new x({props:{name:"post_process",anchor:"transformers.OwlViTFeatureExtractor.post_process",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:""}],parametersDescription:[{anchor:"transformers.OwlViTFeatureExtractor.post_process.outputs",description:`<strong>outputs</strong> (<code>OwlViTObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTFeatureExtractor.post_process.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the size (h, w) of each image of the batch. For evaluation, this must be the original
image size (before any data augmentation). For visualization, this should be the image size after data
augment, but before padding.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L412",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Ut=new x({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:" = 0.0"},{name:"nms_threshold",val:" = 0.3"},{name:"target_sizes",val:" = None"}],parametersDescription:[{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTImageGuidedObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Minimum confidence threshold to use to filter out predicted boxes.`,name:"threshold"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.nms_threshold",description:`<strong>nms_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
IoU threshold for non-maximum suppression of overlapping boxes.`,name:"nms_threshold"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Tensor of shape (batch_size, 2) where each entry is the (height, width) of the corresponding image in
the batch. If set, predicted normalized bounding boxes are rescaled to the target sizes. If left to
None, predictions will not be unnormalized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/image_processing_owlvit.py#L514",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model. All labels are set to None as
<code>OwlViTForObjectDetection.image_guided_detection</code> perform one-shot object detection.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Ct=new W({}),kt=new x({props:{name:"class transformers.OwlViTProcessor",anchor:"transformers.OwlViTProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.OwlViTProcessor.tokenizer",description:`<strong>tokenizer</strong> ([<code>CLIPTokenizer</code>, <code>CLIPTokenizerFast</code>]) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L29"}}),Zt=new x({props:{name:"batch_decode",anchor:"transformers.OwlViTProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L196"}}),Wt=new x({props:{name:"decode",anchor:"transformers.OwlViTProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L203"}}),Bt=new x({props:{name:"post_process",anchor:"transformers.OwlViTProcessor.post_process",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L175"}}),Nt=new x({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTProcessor.post_process_image_guided_detection",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L189"}}),Rt=new x({props:{name:"post_process_object_detection",anchor:"transformers.OwlViTProcessor.post_process_object_detection",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/processing_owlvit.py#L182"}}),Ft=new W({}),Et=new x({props:{name:"class transformers.OwlViTModel",anchor:"transformers.OwlViTModel",parameters:[{name:"config",val:": OwlViTConfig"}],parametersDescription:[{anchor:"transformers.OwlViTModel.This",description:`<strong>This</strong> model is a PyTorch [torch.nn.Module](https &#x2014;
//pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it`,name:"This"},{anchor:"transformers.OwlViTModel.as",description:`<strong>as</strong> a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and &#x2014;
behavior. &#x2014;
config (<a href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a>): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"as"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1038"}}),Pt=new x({props:{name:"forward",anchor:"transformers.OwlViTModel.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:"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_base_image_embeds",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTModel.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. Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.OwlViTModel.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>:<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OwlViTModel.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.`,name:"pixel_values"},{anchor:"transformers.OwlViTModel.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.OwlViTModel.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.OwlViTModel.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.OwlViTModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1153",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTOutput</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.owlvit.configuration_owlvit.OwlViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image</strong> (<code>torch.FloatTensor</code> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_max_text_queries, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
<li><strong>text_model_output</strong> (Tuple<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new io({props:{$$slots:{default:[si]},$$scope:{ctx:j}}}),Ce=new le({props:{anchor:"transformers.OwlViTModel.forward.example",$$slots:{default:[ni]},$$scope:{ctx:j}}}),Ht=new x({props:{name:"get_text_features",anchor:"transformers.OwlViTModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",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.OwlViTModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.OwlViTModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_max_text_queries, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OwlViTModel.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.OwlViTModel.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.OwlViTModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1073",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),ke=new io({props:{$$slots:{default:[ai]},$$scope:{ctx:j}}}),Ze=new le({props:{anchor:"transformers.OwlViTModel.get_text_features.example",$$slots:{default:[ri]},$$scope:{ctx:j}}}),Gt=new x({props:{name:"get_image_features",anchor:"transformers.OwlViTModel.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.OwlViTModel.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.`,name:"pixel_values"},{anchor:"transformers.OwlViTModel.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.OwlViTModel.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.OwlViTModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1108",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),We=new io({props:{$$slots:{default:[ii]},$$scope:{ctx:j}}}),Be=new le({props:{anchor:"transformers.OwlViTModel.get_image_features.example",$$slots:{default:[li]},$$scope:{ctx:j}}}),Xt=new W({}),qt=new x({props:{name:"class transformers.OwlViTTextModel",anchor:"transformers.OwlViTTextModel",parameters:[{name:"config",val:": OwlViTTextConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L877"}}),Dt=new x({props:{name:"forward",anchor:"transformers.OwlViTTextModel.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",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.OwlViTTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>`,name:"input_ids"},{anchor:"transformers.OwlViTTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_max_text_queries, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OwlViTTextModel.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.OwlViTTextModel.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.OwlViTTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L892",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Re=new io({props:{$$slots:{default:[ci]},$$scope:{ctx:j}}}),Fe=new le({props:{anchor:"transformers.OwlViTTextModel.forward.example",$$slots:{default:[di]},$$scope:{ctx:j}}}),Lt=new W({}),Qt=new x({props:{name:"class transformers.OwlViTVisionModel",anchor:"transformers.OwlViTVisionModel",parameters:[{name:"config",val:": OwlViTVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L987"}}),At=new x({props:{name:"forward",anchor:"transformers.OwlViTVisionModel.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.OwlViTVisionModel.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.`,name:"pixel_values"},{anchor:"transformers.OwlViTVisionModel.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.OwlViTVisionModel.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.OwlViTVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new io({props:{$$slots:{default:[pi]},$$scope:{ctx:j}}}),He=new le({props:{anchor:"transformers.OwlViTVisionModel.forward.example",$$slots:{default:[mi]},$$scope:{ctx:j}}}),Yt=new W({}),St=new x({props:{name:"class transformers.OwlViTForObjectDetection",anchor:"transformers.OwlViTForObjectDetection",parameters:[{name:"config",val:": OwlViTConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1320"}}),Kt=new x({props:{name:"forward",anchor:"transformers.OwlViTForObjectDetection.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"pixel_values",val:": FloatTensor"},{name:"attention_mask",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.OwlViTForObjectDetection.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.`,name:"pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input
IDs?</a>.`,name:"input_ids"},{anchor:"transformers.OwlViTForObjectDetection.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_max_text_queries, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OwlViTForObjectDetection.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the last hidden state. See <code>text_model_last_hidden_state</code> and
<code>vision_model_last_hidden_state</code> under returned tensors for more detail.`,name:"output_hidden_states"},{anchor:"transformers.OwlViTForObjectDetection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1622",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTObjectDetectionOutput</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.owlvit.configuration_owlvit.OwlViTConfig'&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>labels</code> are provided)) — Total loss as a linear combination of a negative log-likehood (cross-entropy) for class prediction and a
bounding box loss. The latter is defined as a linear combination of the L1 loss and the generalized
scale-invariant IoU loss.</li>
<li><strong>loss_dict</strong> (<code>Dict</code>, <em>optional</em>) — A dictionary containing the individual losses. Useful for logging.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, num_queries)</code>) — Classification logits (including no-object) for all queries.</li>
<li><strong>pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, 4)</code>) — Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_max_text_queries, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) — Pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>class_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>) — Class embeddings of all image patches. OWL-ViT represents images as a set of image patches where the total
number of patches is (image_size / patch_size)**2.</li>
<li><strong>text_model_output</strong> (Tuple<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xe=new io({props:{$$slots:{default:[hi]},$$scope:{ctx:j}}}),qe=new le({props:{anchor:"transformers.OwlViTForObjectDetection.forward.example",$$slots:{default:[gi]},$$scope:{ctx:j}}}),eo=new x({props:{name:"image_guided_detection",anchor:"transformers.OwlViTForObjectDetection.image_guided_detection",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"query_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.OwlViTForObjectDetection.image_guided_detection.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values.`,name:"pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.query_pixel_values",description:`<strong>query_pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values of query image(s) to be detected. Pass in one query image per target image.`,name:"query_pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.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.OwlViTForObjectDetection.image_guided_detection.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.OwlViTForObjectDetection.image_guided_detection.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/owlvit/modeling_owlvit.py#L1527",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTImageGuidedObjectDetectionOutput</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.owlvit.configuration_owlvit.OwlViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, num_queries)</code>) — Classification logits (including no-object) for all queries.</li>
<li><strong>target_pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, 4)</code>) — Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual target image in the batch
(disregarding possible padding). You can use <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to
retrieve the unnormalized bounding boxes.</li>
<li><strong>query_pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, 4)</code>) — Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual query image in the batch
(disregarding possible padding). You can use <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to
retrieve the unnormalized bounding boxes.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) — Pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>query_image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) — Pooled output of <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>class_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>) — Class embeddings of all image patches. OWL-ViT represents images as a set of image patches where the total
number of patches is (image_size / patch_size)**2.</li>
<li><strong>text_model_output</strong> (Tuple<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTImageGuidedObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new io({props:{$$slots:{default:[ui]},$$scope:{ctx:j}}}),Le=new le({props:{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.example",$$slots:{default:[fi]},$$scope:{ctx:j}}}),{c(){n=a("meta"),M=i(),d=a("p"),p=i(),y=a("h1"),s=a("a"),V=a("span"),u(rt.$$.fragment),wn=i(),lo=a("span"),lo.textContent=Fa,Ts=i(),L=a("h2"),ce=a("a"),Yo=a("span"),u(it.$$.fragment),Tn=i(),co=a("span"),co.textContent=Ea,bs=i(),lt=a("p"),lt.innerHTML=Pa,vs=i(),ct=a("p"),ct.textContent=Ha,ys=i(),dt=a("p"),dt.innerHTML=Ga,Ms=i(),Q=a("h2"),de=a("a"),So=a("span"),u(pt.$$.fragment),bn=i(),po=a("span"),po.textContent=Xa,Vs=i(),mt=a("p"),mt.innerHTML=qa,js=i(),ht=a("p"),ht.innerHTML=Da,xs=i(),u(gt.$$.fragment),$s=i(),ut=a("p"),ut.innerHTML=La,Js=i(),A=a("h2"),pe=a("a"),Ko=a("span"),u(ft.$$.fragment),vn=i(),mo=a("span"),mo.textContent=Qa,Os=i(),I=a("div"),u(_t.$$.fragment),yn=i(),ho=a("p"),ho.innerHTML=Aa,Mn=i(),go=a("p"),go.innerHTML=Ya,Vn=i(),me=a("div"),u(wt.$$.fragment),jn=i(),uo=a("p"),uo.innerHTML=Sa,zs=i(),Y=a("h2"),he=a("a"),es=a("span"),u(Tt.$$.fragment),xn=i(),fo=a("span"),fo.textContent=Ka,Is=i(),U=a("div"),u(bt.$$.fragment),$n=i(),_o=a("p"),_o.innerHTML=er,Jn=i(),wo=a("p"),wo.innerHTML=tr,On=i(),u(ge.$$.fragment),Us=i(),S=a("h2"),ue=a("a"),ts=a("span"),u(vt.$$.fragment),zn=i(),To=a("span"),To.textContent=or,Cs=i(),C=a("div"),u(yt.$$.fragment),In=i(),bo=a("p"),bo.innerHTML=sr,Un=i(),vo=a("p"),vo.innerHTML=nr,Cn=i(),u(fe.$$.fragment),ks=i(),K=a("h2"),_e=a("a"),os=a("span"),u(Mt.$$.fragment),kn=i(),yo=a("span"),yo.textContent=ar,Zs=i(),J=a("div"),u(Vt.$$.fragment),Zn=i(),Mo=a("p"),Mo.textContent=rr,Wn=i(),Vo=a("p"),Vo.innerHTML=ir,Bn=i(),we=a("div"),u(jt.$$.fragment),Nn=i(),jo=a("p"),jo.textContent=lr,Rn=i(),Te=a("div"),u(xt.$$.fragment),Fn=i(),xo=a("p"),xo.innerHTML=cr,En=i(),be=a("div"),u($t.$$.fragment),Pn=i(),$o=a("p"),$o.innerHTML=dr,Ws=i(),ee=a("h2"),ve=a("a"),ss=a("span"),u(Jt.$$.fragment),Hn=i(),Jo=a("span"),Jo.textContent=pr,Bs=i(),k=a("div"),u(Ot.$$.fragment),Gn=i(),ye=a("div"),u(zt.$$.fragment),Xn=i(),Oo=a("p"),Oo.textContent=mr,qn=i(),Me=a("div"),u(It.$$.fragment),Dn=i(),zo=a("p"),zo.innerHTML=hr,Ln=i(),Ve=a("div"),u(Ut.$$.fragment),Qn=i(),Io=a("p"),Io.innerHTML=gr,Ns=i(),te=a("h2"),je=a("a"),ns=a("span"),u(Ct.$$.fragment),An=i(),Uo=a("span"),Uo.textContent=ur,Rs=i(),$=a("div"),u(kt.$$.fragment),Yn=i(),Co=a("p"),Co.innerHTML=fr,Sn=i(),xe=a("div"),u(Zt.$$.fragment),Kn=i(),ko=a("p"),ko.innerHTML=_r,ea=i(),$e=a("div"),u(Wt.$$.fragment),ta=i(),Zo=a("p"),Zo.innerHTML=wr,oa=i(),Je=a("div"),u(Bt.$$.fragment),sa=i(),Wo=a("p"),Wo.innerHTML=Tr,na=i(),Oe=a("div"),u(Nt.$$.fragment),aa=i(),Bo=a("p"),Bo.innerHTML=br,ra=i(),ze=a("div"),u(Rt.$$.fragment),ia=i(),No=a("p"),No.innerHTML=vr,Fs=i(),oe=a("h2"),Ie=a("a"),as=a("span"),u(Ft.$$.fragment),la=i(),Ro=a("span"),Ro.textContent=yr,Es=i(),Z=a("div"),u(Et.$$.fragment),ca=i(),B=a("div"),u(Pt.$$.fragment),da=i(),Fo=a("p"),Fo.innerHTML=Mr,pa=i(),u(Ue.$$.fragment),ma=i(),u(Ce.$$.fragment),ha=i(),N=a("div"),u(Ht.$$.fragment),ga=i(),Eo=a("p"),Eo.innerHTML=Vr,ua=i(),u(ke.$$.fragment),fa=i(),u(Ze.$$.fragment),_a=i(),R=a("div"),u(Gt.$$.fragment),wa=i(),Po=a("p"),Po.innerHTML=jr,Ta=i(),u(We.$$.fragment),ba=i(),u(Be.$$.fragment),Ps=i(),se=a("h2"),Ne=a("a"),rs=a("span"),u(Xt.$$.fragment),va=i(),Ho=a("span"),Ho.textContent=xr,Hs=i(),ne=a("div"),u(qt.$$.fragment),ya=i(),F=a("div"),u(Dt.$$.fragment),Ma=i(),Go=a("p"),Go.innerHTML=$r,Va=i(),u(Re.$$.fragment),ja=i(),u(Fe.$$.fragment),Gs=i(),ae=a("h2"),Ee=a("a"),is=a("span"),u(Lt.$$.fragment),xa=i(),Xo=a("span"),Xo.textContent=Jr,Xs=i(),re=a("div"),u(Qt.$$.fragment),$a=i(),E=a("div"),u(At.$$.fragment),Ja=i(),qo=a("p"),qo.innerHTML=Or,Oa=i(),u(Pe.$$.fragment),za=i(),u(He.$$.fragment),qs=i(),ie=a("h2"),Ge=a("a"),ls=a("span"),u(Yt.$$.fragment),Ia=i(),Do=a("span"),Do.textContent=zr,Ds=i(),X=a("div"),u(St.$$.fragment),Ua=i(),P=a("div"),u(Kt.$$.fragment),Ca=i(),Lo=a("p"),Lo.innerHTML=Ir,ka=i(),u(Xe.$$.fragment),Za=i(),u(qe.$$.fragment),Wa=i(),H=a("div"),u(eo.$$.fragment),Ba=i(),Qo=a("p"),Qo.innerHTML=Ur,Na=i(),u(De.$$.fragment),Ra=i(),u(Le.$$.fragment),Ls=i(),cs=a("p"),this.h()},l(e){const c=ei("svelte-1phssyn",document.head);n=r(c,"META",{name:!0,content:!0}),c.forEach(o),M=l(e),d=r(e,"P",{}),g(d).forEach(o),p=l(e),y=r(e,"H1",{class:!0});var to=g(y);s=r(to,"A",{id:!0,class:!0,href:!0});var ds=g(s);V=r(ds,"SPAN",{});var ps=g(V);f(rt.$$.fragment,ps),ps.forEach(o),ds.forEach(o),wn=l(to),lo=r(to,"SPAN",{"data-svelte-h":!0}),v(lo)!=="svelte-1d5l72r"&&(lo.textContent=Fa),to.forEach(o),Ts=l(e),L=r(e,"H2",{class:!0});var oo=g(L);ce=r(oo,"A",{id:!0,class:!0,href:!0});var ms=g(ce);Yo=r(ms,"SPAN",{});var hs=g(Yo);f(it.$$.fragment,hs),hs.forEach(o),ms.forEach(o),Tn=l(oo),co=r(oo,"SPAN",{"data-svelte-h":!0}),v(co)!=="svelte-1jsw1pg"&&(co.textContent=Ea),oo.forEach(o),bs=l(e),lt=r(e,"P",{"data-svelte-h":!0}),v(lt)!=="svelte-hzu5op"&&(lt.innerHTML=Pa),vs=l(e),ct=r(e,"P",{"data-svelte-h":!0}),v(ct)!=="svelte-vfdo9a"&&(ct.textContent=Ha),ys=l(e),dt=r(e,"P",{"data-svelte-h":!0}),v(dt)!=="svelte-1scvdlr"&&(dt.innerHTML=Ga),Ms=l(e),Q=r(e,"H2",{class:!0});var so=g(Q);de=r(so,"A",{id:!0,class:!0,href:!0});var gs=g(de);So=r(gs,"SPAN",{});var us=g(So);f(pt.$$.fragment,us),us.forEach(o),gs.forEach(o),bn=l(so),po=r(so,"SPAN",{"data-svelte-h":!0}),v(po)!=="svelte-jwh4bg"&&(po.textContent=Xa),so.forEach(o),Vs=l(e),mt=r(e,"P",{"data-svelte-h":!0}),v(mt)!=="svelte-4h82a2"&&(mt.innerHTML=qa),js=l(e),ht=r(e,"P",{"data-svelte-h":!0}),v(ht)!=="svelte-1l8f7gw"&&(ht.innerHTML=Da),xs=l(e),f(gt.$$.fragment,e),$s=l(e),ut=r(e,"P",{"data-svelte-h":!0}),v(ut)!=="svelte-1xerg4a"&&(ut.innerHTML=La),Js=l(e),A=r(e,"H2",{class:!0});var no=g(A);pe=r(no,"A",{id:!0,class:!0,href:!0});var fs=g(pe);Ko=r(fs,"SPAN",{});var _s=g(Ko);f(ft.$$.fragment,_s),_s.forEach(o),fs.forEach(o),vn=l(no),mo=r(no,"SPAN",{"data-svelte-h":!0}),v(mo)!=="svelte-1f2axlc"&&(mo.textContent=Qa),no.forEach(o),Os=l(e),I=r(e,"DIV",{class:!0});var q=g(I);f(_t.$$.fragment,q),yn=l(q),ho=r(q,"P",{"data-svelte-h":!0}),v(ho)!=="svelte-1payc11"&&(ho.innerHTML=Aa),Mn=l(q),go=r(q,"P",{"data-svelte-h":!0}),v(go)!=="svelte-10kqkkl"&&(go.innerHTML=Ya),Vn=l(q),me=r(q,"DIV",{class:!0});var ao=g(me);f(wt.$$.fragment,ao),jn=l(ao),uo=r(ao,"P",{"data-svelte-h":!0}),v(uo)!=="svelte-16wte7j"&&(uo.innerHTML=Sa),ao.forEach(o),q.forEach(o),zs=l(e),Y=r(e,"H2",{class:!0});var ro=g(Y);he=r(ro,"A",{id:!0,class:!0,href:!0});var ws=g(he);es=r(ws,"SPAN",{});var Cr=g(es);f(Tt.$$.fragment,Cr),Cr.forEach(o),ws.forEach(o),xn=l(ro),fo=r(ro,"SPAN",{"data-svelte-h":!0}),v(fo)!=="svelte-1uqp4wt"&&(fo.textContent=Ka),ro.forEach(o),Is=l(e),U=r(e,"DIV",{class:!0});var Qe=g(U);f(bt.$$.fragment,Qe),$n=l(Qe),_o=r(Qe,"P",{"data-svelte-h":!0}),v(_o)!=="svelte-9wv534"&&(_o.innerHTML=er),Jn=l(Qe),wo=r(Qe,"P",{"data-svelte-h":!0}),v(wo)!=="svelte-10kqkkl"&&(wo.innerHTML=tr),On=l(Qe),f(ge.$$.fragment,Qe),Qe.forEach(o),Us=l(e),S=r(e,"H2",{class:!0});var As=g(S);ue=r(As,"A",{id:!0,class:!0,href:!0});var kr=g(ue);ts=r(kr,"SPAN",{});var Zr=g(ts);f(vt.$$.fragment,Zr),Zr.forEach(o),kr.forEach(o),zn=l(As),To=r(As,"SPAN",{"data-svelte-h":!0}),v(To)!=="svelte-49i7fg"&&(To.textContent=or),As.forEach(o),Cs=l(e),C=r(e,"DIV",{class:!0});var Ae=g(C);f(yt.$$.fragment,Ae),In=l(Ae),bo=r(Ae,"P",{"data-svelte-h":!0}),v(bo)!=="svelte-1wbxjr4"&&(bo.innerHTML=sr),Un=l(Ae),vo=r(Ae,"P",{"data-svelte-h":!0}),v(vo)!=="svelte-10kqkkl"&&(vo.innerHTML=nr),Cn=l(Ae),f(fe.$$.fragment,Ae),Ae.forEach(o),ks=l(e),K=r(e,"H2",{class:!0});var Ys=g(K);_e=r(Ys,"A",{id:!0,class:!0,href:!0});var Wr=g(_e);os=r(Wr,"SPAN",{});var Br=g(os);f(Mt.$$.fragment,Br),Br.forEach(o),Wr.forEach(o),kn=l(Ys),yo=r(Ys,"SPAN",{"data-svelte-h":!0}),v(yo)!=="svelte-15y3klv"&&(yo.textContent=ar),Ys.forEach(o),Zs=l(e),J=r(e,"DIV",{class:!0});var G=g(J);f(Vt.$$.fragment,G),Zn=l(G),Mo=r(G,"P",{"data-svelte-h":!0}),v(Mo)!=="svelte-16zd1vi"&&(Mo.textContent=rr),Wn=l(G),Vo=r(G,"P",{"data-svelte-h":!0}),v(Vo)!=="svelte-1wpzfjl"&&(Vo.innerHTML=ir),Bn=l(G),we=r(G,"DIV",{class:!0});var Ss=g(we);f(jt.$$.fragment,Ss),Nn=l(Ss),jo=r(Ss,"P",{"data-svelte-h":!0}),v(jo)!=="svelte-1doxhpf"&&(jo.textContent=lr),Ss.forEach(o),Rn=l(G),Te=r(G,"DIV",{class:!0});var Ks=g(Te);f(xt.$$.fragment,Ks),Fn=l(Ks),xo=r(Ks,"P",{"data-svelte-h":!0}),v(xo)!=="svelte-h91rmz"&&(xo.innerHTML=cr),Ks.forEach(o),En=l(G),be=r(G,"DIV",{class:!0});var en=g(be);f($t.$$.fragment,en),Pn=l(en),$o=r(en,"P",{"data-svelte-h":!0}),v($o)!=="svelte-101tf0o"&&($o.innerHTML=dr),en.forEach(o),G.forEach(o),Ws=l(e),ee=r(e,"H2",{class:!0});var tn=g(ee);ve=r(tn,"A",{id:!0,class:!0,href:!0});var Nr=g(ve);ss=r(Nr,"SPAN",{});var Rr=g(ss);f(Jt.$$.fragment,Rr),Rr.forEach(o),Nr.forEach(o),Hn=l(tn),Jo=r(tn,"SPAN",{"data-svelte-h":!0}),v(Jo)!=="svelte-1xref7o"&&(Jo.textContent=pr),tn.forEach(o),Bs=l(e),k=r(e,"DIV",{class:!0});var Ye=g(k);f(Ot.$$.fragment,Ye),Gn=l(Ye),ye=r(Ye,"DIV",{class:!0});var on=g(ye);f(zt.$$.fragment,on),Xn=l(on),Oo=r(on,"P",{"data-svelte-h":!0}),v(Oo)!=="svelte-khengj"&&(Oo.textContent=mr),on.forEach(o),qn=l(Ye),Me=r(Ye,"DIV",{class:!0});var sn=g(Me);f(It.$$.fragment,sn),Dn=l(sn),zo=r(sn,"P",{"data-svelte-h":!0}),v(zo)!=="svelte-h91rmz"&&(zo.innerHTML=hr),sn.forEach(o),Ln=l(Ye),Ve=r(Ye,"DIV",{class:!0});var nn=g(Ve);f(Ut.$$.fragment,nn),Qn=l(nn),Io=r(nn,"P",{"data-svelte-h":!0}),v(Io)!=="svelte-101tf0o"&&(Io.innerHTML=gr),nn.forEach(o),Ye.forEach(o),Ns=l(e),te=r(e,"H2",{class:!0});var an=g(te);je=r(an,"A",{id:!0,class:!0,href:!0});var Fr=g(je);ns=r(Fr,"SPAN",{});var Er=g(ns);f(Ct.$$.fragment,Er),Er.forEach(o),Fr.forEach(o),An=l(an),Uo=r(an,"SPAN",{"data-svelte-h":!0}),v(Uo)!=="svelte-4duegs"&&(Uo.textContent=ur),an.forEach(o),Rs=l(e),$=r(e,"DIV",{class:!0});var z=g($);f(kt.$$.fragment,z),Yn=l(z),Co=r(z,"P",{"data-svelte-h":!0}),v(Co)!=="svelte-flca3e"&&(Co.innerHTML=fr),Sn=l(z),xe=r(z,"DIV",{class:!0});var rn=g(xe);f(Zt.$$.fragment,rn),Kn=l(rn),ko=r(rn,"P",{"data-svelte-h":!0}),v(ko)!=="svelte-13zh1xk"&&(ko.innerHTML=_r),rn.forEach(o),ea=l(z),$e=r(z,"DIV",{class:!0});var ln=g($e);f(Wt.$$.fragment,ln),ta=l(ln),Zo=r(ln,"P",{"data-svelte-h":!0}),v(Zo)!=="svelte-1qa4qlq"&&(Zo.innerHTML=wr),ln.forEach(o),oa=l(z),Je=r(z,"DIV",{class:!0});var cn=g(Je);f(Bt.$$.fragment,cn),sa=l(cn),Wo=r(cn,"P",{"data-svelte-h":!0}),v(Wo)!=="svelte-s38osq"&&(Wo.innerHTML=Tr),cn.forEach(o),na=l(z),Oe=r(z,"DIV",{class:!0});var dn=g(Oe);f(Nt.$$.fragment,dn),aa=l(dn),Bo=r(dn,"P",{"data-svelte-h":!0}),v(Bo)!=="svelte-13us65f"&&(Bo.innerHTML=br),dn.forEach(o),ra=l(z),ze=r(z,"DIV",{class:!0});var pn=g(ze);f(Rt.$$.fragment,pn),ia=l(pn),No=r(pn,"P",{"data-svelte-h":!0}),v(No)!=="svelte-1fdok5f"&&(No.innerHTML=vr),pn.forEach(o),z.forEach(o),Fs=l(e),oe=r(e,"H2",{class:!0});var mn=g(oe);Ie=r(mn,"A",{id:!0,class:!0,href:!0});var Pr=g(Ie);as=r(Pr,"SPAN",{});var Hr=g(as);f(Ft.$$.fragment,Hr),Hr.forEach(o),Pr.forEach(o),la=l(mn),Ro=r(mn,"SPAN",{"data-svelte-h":!0}),v(Ro)!=="svelte-daz5z9"&&(Ro.textContent=yr),mn.forEach(o),Es=l(e),Z=r(e,"DIV",{class:!0});var Se=g(Z);f(Et.$$.fragment,Se),ca=l(Se),B=r(Se,"DIV",{class:!0});var Ke=g(B);f(Pt.$$.fragment,Ke),da=l(Ke),Fo=r(Ke,"P",{"data-svelte-h":!0}),v(Fo)!=="svelte-1skqrw"&&(Fo.innerHTML=Mr),pa=l(Ke),f(Ue.$$.fragment,Ke),ma=l(Ke),f(Ce.$$.fragment,Ke),Ke.forEach(o),ha=l(Se),N=r(Se,"DIV",{class:!0});var et=g(N);f(Ht.$$.fragment,et),ga=l(et),Eo=r(et,"P",{"data-svelte-h":!0}),v(Eo)!=="svelte-1skqrw"&&(Eo.innerHTML=Vr),ua=l(et),f(ke.$$.fragment,et),fa=l(et),f(Ze.$$.fragment,et),et.forEach(o),_a=l(Se),R=r(Se,"DIV",{class:!0});var tt=g(R);f(Gt.$$.fragment,tt),wa=l(tt),Po=r(tt,"P",{"data-svelte-h":!0}),v(Po)!=="svelte-1skqrw"&&(Po.innerHTML=jr),Ta=l(tt),f(We.$$.fragment,tt),ba=l(tt),f(Be.$$.fragment,tt),tt.forEach(o),Se.forEach(o),Ps=l(e),se=r(e,"H2",{class:!0});var hn=g(se);Ne=r(hn,"A",{id:!0,class:!0,href:!0});var Gr=g(Ne);rs=r(Gr,"SPAN",{});var Xr=g(rs);f(Xt.$$.fragment,Xr),Xr.forEach(o),Gr.forEach(o),va=l(hn),Ho=r(hn,"SPAN",{"data-svelte-h":!0}),v(Ho)!=="svelte-1jhnw8g"&&(Ho.textContent=xr),hn.forEach(o),Hs=l(e),ne=r(e,"DIV",{class:!0});var gn=g(ne);f(qt.$$.fragment,gn),ya=l(gn),F=r(gn,"DIV",{class:!0});var ot=g(F);f(Dt.$$.fragment,ot),Ma=l(ot),Go=r(ot,"P",{"data-svelte-h":!0}),v(Go)!=="svelte-5s9c4o"&&(Go.innerHTML=$r),Va=l(ot),f(Re.$$.fragment,ot),ja=l(ot),f(Fe.$$.fragment,ot),ot.forEach(o),gn.forEach(o),Gs=l(e),ae=r(e,"H2",{class:!0});var un=g(ae);Ee=r(un,"A",{id:!0,class:!0,href:!0});var qr=g(Ee);is=r(qr,"SPAN",{});var Dr=g(is);f(Lt.$$.fragment,Dr),Dr.forEach(o),qr.forEach(o),xa=l(un),Xo=r(un,"SPAN",{"data-svelte-h":!0}),v(Xo)!=="svelte-pi1i3h"&&(Xo.textContent=Jr),un.forEach(o),Xs=l(e),re=r(e,"DIV",{class:!0});var fn=g(re);f(Qt.$$.fragment,fn),$a=l(fn),E=r(fn,"DIV",{class:!0});var st=g(E);f(At.$$.fragment,st),Ja=l(st),qo=r(st,"P",{"data-svelte-h":!0}),v(qo)!=="svelte-g7kz3w"&&(qo.innerHTML=Or),Oa=l(st),f(Pe.$$.fragment,st),za=l(st),f(He.$$.fragment,st),st.forEach(o),fn.forEach(o),qs=l(e),ie=r(e,"H2",{class:!0});var _n=g(ie);Ge=r(_n,"A",{id:!0,class:!0,href:!0});var Lr=g(Ge);ls=r(Lr,"SPAN",{});var Qr=g(ls);f(Yt.$$.fragment,Qr),Qr.forEach(o),Lr.forEach(o),Ia=l(_n),Do=r(_n,"SPAN",{"data-svelte-h":!0}),v(Do)!=="svelte-kg1utf"&&(Do.textContent=zr),_n.forEach(o),Ds=l(e),X=r(e,"DIV",{class:!0});var Ao=g(X);f(St.$$.fragment,Ao),Ua=l(Ao),P=r(Ao,"DIV",{class:!0});var nt=g(P);f(Kt.$$.fragment,nt),Ca=l(nt),Lo=r(nt,"P",{"data-svelte-h":!0}),v(Lo)!=="svelte-bja310"&&(Lo.innerHTML=Ir),ka=l(nt),f(Xe.$$.fragment,nt),Za=l(nt),f(qe.$$.fragment,nt),nt.forEach(o),Wa=l(Ao),H=r(Ao,"DIV",{class:!0});var at=g(H);f(eo.$$.fragment,at),Ba=l(at),Qo=r(at,"P",{"data-svelte-h":!0}),v(Qo)!=="svelte-bja310"&&(Qo.innerHTML=Ur),Na=l(at),f(De.$$.fragment,at),Ra=l(at),f(Le.$$.fragment,at),at.forEach(o),Ao.forEach(o),Ls=l(e),cs=r(e,"P",{}),g(cs).forEach(o),this.h()},h(){h(n,"name","hf:doc:metadata"),h(n,"content",JSON.stringify(wi)),h(s,"id","owlvit"),h(s,"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"),h(s,"href","#owlvit"),h(y,"class","relative group"),h(ce,"id","overview"),h(ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ce,"href","#overview"),h(L,"class","relative group"),h(de,"id","usage"),h(de,"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"),h(de,"href","#usage"),h(Q,"class","relative group"),h(pe,"id","transformers.OwlViTConfig"),h(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"),h(pe,"href","#transformers.OwlViTConfig"),h(A,"class","relative group"),h(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(he,"id","transformers.OwlViTTextConfig"),h(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"),h(he,"href","#transformers.OwlViTTextConfig"),h(Y,"class","relative group"),h(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ue,"id","transformers.OwlViTVisionConfig"),h(ue,"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"),h(ue,"href","#transformers.OwlViTVisionConfig"),h(S,"class","relative group"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(_e,"id","transformers.OwlViTImageProcessor"),h(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(_e,"href","#transformers.OwlViTImageProcessor"),h(K,"class","relative group"),h(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ve,"id","transformers.OwlViTFeatureExtractor"),h(ve,"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"),h(ve,"href","#transformers.OwlViTFeatureExtractor"),h(ee,"class","relative group"),h(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(je,"id","transformers.OwlViTProcessor"),h(je,"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"),h(je,"href","#transformers.OwlViTProcessor"),h(te,"class","relative group"),h(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ie,"id","transformers.OwlViTModel"),h(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ie,"href","#transformers.OwlViTModel"),h(oe,"class","relative group"),h(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ne,"id","transformers.OwlViTTextModel"),h(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(Ne,"href","#transformers.OwlViTTextModel"),h(se,"class","relative group"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ee,"id","transformers.OwlViTVisionModel"),h(Ee,"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"),h(Ee,"href","#transformers.OwlViTVisionModel"),h(ae,"class","relative group"),h(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(Ge,"id","transformers.OwlViTForObjectDetection"),h(Ge,"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"),h(Ge,"href","#transformers.OwlViTForObjectDetection"),h(ie,"class","relative group"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){t(document.head,n),m(e,M,c),m(e,d,c),m(e,p,c),m(e,y,c),t(y,s),t(s,V),_(rt,V,null),t(y,wn),t(y,lo),m(e,Ts,c),m(e,L,c),t(L,ce),t(ce,Yo),_(it,Yo,null),t(L,Tn),t(L,co),m(e,bs,c),m(e,lt,c),m(e,vs,c),m(e,ct,c),m(e,ys,c),m(e,dt,c),m(e,Ms,c),m(e,Q,c),t(Q,de),t(de,So),_(pt,So,null),t(Q,bn),t(Q,po),m(e,Vs,c),m(e,mt,c),m(e,js,c),m(e,ht,c),m(e,xs,c),_(gt,e,c),m(e,$s,c),m(e,ut,c),m(e,Js,c),m(e,A,c),t(A,pe),t(pe,Ko),_(ft,Ko,null),t(A,vn),t(A,mo),m(e,Os,c),m(e,I,c),_(_t,I,null),t(I,yn),t(I,ho),t(I,Mn),t(I,go),t(I,Vn),t(I,me),_(wt,me,null),t(me,jn),t(me,uo),m(e,zs,c),m(e,Y,c),t(Y,he),t(he,es),_(Tt,es,null),t(Y,xn),t(Y,fo),m(e,Is,c),m(e,U,c),_(bt,U,null),t(U,$n),t(U,_o),t(U,Jn),t(U,wo),t(U,On),_(ge,U,null),m(e,Us,c),m(e,S,c),t(S,ue),t(ue,ts),_(vt,ts,null),t(S,zn),t(S,To),m(e,Cs,c),m(e,C,c),_(yt,C,null),t(C,In),t(C,bo),t(C,Un),t(C,vo),t(C,Cn),_(fe,C,null),m(e,ks,c),m(e,K,c),t(K,_e),t(_e,os),_(Mt,os,null),t(K,kn),t(K,yo),m(e,Zs,c),m(e,J,c),_(Vt,J,null),t(J,Zn),t(J,Mo),t(J,Wn),t(J,Vo),t(J,Bn),t(J,we),_(jt,we,null),t(we,Nn),t(we,jo),t(J,Rn),t(J,Te),_(xt,Te,null),t(Te,Fn),t(Te,xo),t(J,En),t(J,be),_($t,be,null),t(be,Pn),t(be,$o),m(e,Ws,c),m(e,ee,c),t(ee,ve),t(ve,ss),_(Jt,ss,null),t(ee,Hn),t(ee,Jo),m(e,Bs,c),m(e,k,c),_(Ot,k,null),t(k,Gn),t(k,ye),_(zt,ye,null),t(ye,Xn),t(ye,Oo),t(k,qn),t(k,Me),_(It,Me,null),t(Me,Dn),t(Me,zo),t(k,Ln),t(k,Ve),_(Ut,Ve,null),t(Ve,Qn),t(Ve,Io),m(e,Ns,c),m(e,te,c),t(te,je),t(je,ns),_(Ct,ns,null),t(te,An),t(te,Uo),m(e,Rs,c),m(e,$,c),_(kt,$,null),t($,Yn),t($,Co),t($,Sn),t($,xe),_(Zt,xe,null),t(xe,Kn),t(xe,ko),t($,ea),t($,$e),_(Wt,$e,null),t($e,ta),t($e,Zo),t($,oa),t($,Je),_(Bt,Je,null),t(Je,sa),t(Je,Wo),t($,na),t($,Oe),_(Nt,Oe,null),t(Oe,aa),t(Oe,Bo),t($,ra),t($,ze),_(Rt,ze,null),t(ze,ia),t(ze,No),m(e,Fs,c),m(e,oe,c),t(oe,Ie),t(Ie,as),_(Ft,as,null),t(oe,la),t(oe,Ro),m(e,Es,c),m(e,Z,c),_(Et,Z,null),t(Z,ca),t(Z,B),_(Pt,B,null),t(B,da),t(B,Fo),t(B,pa),_(Ue,B,null),t(B,ma),_(Ce,B,null),t(Z,ha),t(Z,N),_(Ht,N,null),t(N,ga),t(N,Eo),t(N,ua),_(ke,N,null),t(N,fa),_(Ze,N,null),t(Z,_a),t(Z,R),_(Gt,R,null),t(R,wa),t(R,Po),t(R,Ta),_(We,R,null),t(R,ba),_(Be,R,null),m(e,Ps,c),m(e,se,c),t(se,Ne),t(Ne,rs),_(Xt,rs,null),t(se,va),t(se,Ho),m(e,Hs,c),m(e,ne,c),_(qt,ne,null),t(ne,ya),t(ne,F),_(Dt,F,null),t(F,Ma),t(F,Go),t(F,Va),_(Re,F,null),t(F,ja),_(Fe,F,null),m(e,Gs,c),m(e,ae,c),t(ae,Ee),t(Ee,is),_(Lt,is,null),t(ae,xa),t(ae,Xo),m(e,Xs,c),m(e,re,c),_(Qt,re,null),t(re,$a),t(re,E),_(At,E,null),t(E,Ja),t(E,qo),t(E,Oa),_(Pe,E,null),t(E,za),_(He,E,null),m(e,qs,c),m(e,ie,c),t(ie,Ge),t(Ge,ls),_(Yt,ls,null),t(ie,Ia),t(ie,Do),m(e,Ds,c),m(e,X,c),_(St,X,null),t(X,Ua),t(X,P),_(Kt,P,null),t(P,Ca),t(P,Lo),t(P,ka),_(Xe,P,null),t(P,Za),_(qe,P,null),t(X,Wa),t(X,H),_(eo,H,null),t(H,Ba),t(H,Qo),t(H,Na),_(De,H,null),t(H,Ra),_(Le,H,null),m(e,Ls,c),m(e,cs,c),Qs=!0},p(e,[c]){const to={};c&2&&(to.$$scope={dirty:c,ctx:e}),ge.$set(to);const ds={};c&2&&(ds.$$scope={dirty:c,ctx:e}),fe.$set(ds);const ps={};c&2&&(ps.$$scope={dirty:c,ctx:e}),Ue.$set(ps);const oo={};c&2&&(oo.$$scope={dirty:c,ctx:e}),Ce.$set(oo);const ms={};c&2&&(ms.$$scope={dirty:c,ctx:e}),ke.$set(ms);const hs={};c&2&&(hs.$$scope={dirty:c,ctx:e}),Ze.$set(hs);const so={};c&2&&(so.$$scope={dirty:c,ctx:e}),We.$set(so);const gs={};c&2&&(gs.$$scope={dirty:c,ctx:e}),Be.$set(gs);const us={};c&2&&(us.$$scope={dirty:c,ctx:e}),Re.$set(us);const no={};c&2&&(no.$$scope={dirty:c,ctx:e}),Fe.$set(no);const fs={};c&2&&(fs.$$scope={dirty:c,ctx:e}),Pe.$set(fs);const _s={};c&2&&(_s.$$scope={dirty:c,ctx:e}),He.$set(_s);const q={};c&2&&(q.$$scope={dirty:c,ctx:e}),Xe.$set(q);const ao={};c&2&&(ao.$$scope={dirty:c,ctx:e}),qe.$set(ao);const ro={};c&2&&(ro.$$scope={dirty:c,ctx:e}),De.$set(ro);const ws={};c&2&&(ws.$$scope={dirty:c,ctx:e}),Le.$set(ws)},i(e){Qs||(w(rt.$$.fragment,e),w(it.$$.fragment,e),w(pt.$$.fragment,e),w(gt.$$.fragment,e),w(ft.$$.fragment,e),w(_t.$$.fragment,e),w(wt.$$.fragment,e),w(Tt.$$.fragment,e),w(bt.$$.fragment,e),w(ge.$$.fragment,e),w(vt.$$.fragment,e),w(yt.$$.fragment,e),w(fe.$$.fragment,e),w(Mt.$$.fragment,e),w(Vt.$$.fragment,e),w(jt.$$.fragment,e),w(xt.$$.fragment,e),w($t.$$.fragment,e),w(Jt.$$.fragment,e),w(Ot.$$.fragment,e),w(zt.$$.fragment,e),w(It.$$.fragment,e),w(Ut.$$.fragment,e),w(Ct.$$.fragment,e),w(kt.$$.fragment,e),w(Zt.$$.fragment,e),w(Wt.$$.fragment,e),w(Bt.$$.fragment,e),w(Nt.$$.fragment,e),w(Rt.$$.fragment,e),w(Ft.$$.fragment,e),w(Et.$$.fragment,e),w(Pt.$$.fragment,e),w(Ue.$$.fragment,e),w(Ce.$$.fragment,e),w(Ht.$$.fragment,e),w(ke.$$.fragment,e),w(Ze.$$.fragment,e),w(Gt.$$.fragment,e),w(We.$$.fragment,e),w(Be.$$.fragment,e),w(Xt.$$.fragment,e),w(qt.$$.fragment,e),w(Dt.$$.fragment,e),w(Re.$$.fragment,e),w(Fe.$$.fragment,e),w(Lt.$$.fragment,e),w(Qt.$$.fragment,e),w(At.$$.fragment,e),w(Pe.$$.fragment,e),w(He.$$.fragment,e),w(Yt.$$.fragment,e),w(St.$$.fragment,e),w(Kt.$$.fragment,e),w(Xe.$$.fragment,e),w(qe.$$.fragment,e),w(eo.$$.fragment,e),w(De.$$.fragment,e),w(Le.$$.fragment,e),Qs=!0)},o(e){T(rt.$$.fragment,e),T(it.$$.fragment,e),T(pt.$$.fragment,e),T(gt.$$.fragment,e),T(ft.$$.fragment,e),T(_t.$$.fragment,e),T(wt.$$.fragment,e),T(Tt.$$.fragment,e),T(bt.$$.fragment,e),T(ge.$$.fragment,e),T(vt.$$.fragment,e),T(yt.$$.fragment,e),T(fe.$$.fragment,e),T(Mt.$$.fragment,e),T(Vt.$$.fragment,e),T(jt.$$.fragment,e),T(xt.$$.fragment,e),T($t.$$.fragment,e),T(Jt.$$.fragment,e),T(Ot.$$.fragment,e),T(zt.$$.fragment,e),T(It.$$.fragment,e),T(Ut.$$.fragment,e),T(Ct.$$.fragment,e),T(kt.$$.fragment,e),T(Zt.$$.fragment,e),T(Wt.$$.fragment,e),T(Bt.$$.fragment,e),T(Nt.$$.fragment,e),T(Rt.$$.fragment,e),T(Ft.$$.fragment,e),T(Et.$$.fragment,e),T(Pt.$$.fragment,e),T(Ue.$$.fragment,e),T(Ce.$$.fragment,e),T(Ht.$$.fragment,e),T(ke.$$.fragment,e),T(Ze.$$.fragment,e),T(Gt.$$.fragment,e),T(We.$$.fragment,e),T(Be.$$.fragment,e),T(Xt.$$.fragment,e),T(qt.$$.fragment,e),T(Dt.$$.fragment,e),T(Re.$$.fragment,e),T(Fe.$$.fragment,e),T(Lt.$$.fragment,e),T(Qt.$$.fragment,e),T(At.$$.fragment,e),T(Pe.$$.fragment,e),T(He.$$.fragment,e),T(Yt.$$.fragment,e),T(St.$$.fragment,e),T(Kt.$$.fragment,e),T(Xe.$$.fragment,e),T(qe.$$.fragment,e),T(eo.$$.fragment,e),T(De.$$.fragment,e),T(Le.$$.fragment,e),Qs=!1},d(e){e&&(o(M),o(d),o(p),o(y),o(Ts),o(L),o(bs),o(lt),o(vs),o(ct),o(ys),o(dt),o(Ms),o(Q),o(Vs),o(mt),o(js),o(ht),o(xs),o($s),o(ut),o(Js),o(A),o(Os),o(I),o(zs),o(Y),o(Is),o(U),o(Us),o(S),o(Cs),o(C),o(ks),o(K),o(Zs),o(J),o(Ws),o(ee),o(Bs),o(k),o(Ns),o(te),o(Rs),o($),o(Fs),o(oe),o(Es),o(Z),o(Ps),o(se),o(Hs),o(ne),o(Gs),o(ae),o(Xs),o(re),o(qs),o(ie),o(Ds),o(X),o(Ls),o(cs)),o(n),b(rt),b(it),b(pt),b(gt,e),b(ft),b(_t),b(wt),b(Tt),b(bt),b(ge),b(vt),b(yt),b(fe),b(Mt),b(Vt),b(jt),b(xt),b($t),b(Jt),b(Ot),b(zt),b(It),b(Ut),b(Ct),b(kt),b(Zt),b(Wt),b(Bt),b(Nt),b(Rt),b(Ft),b(Et),b(Pt),b(Ue),b(Ce),b(Ht),b(ke),b(Ze),b(Gt),b(We),b(Be),b(Xt),b(qt),b(Dt),b(Re),b(Fe),b(Lt),b(Qt),b(At),b(Pe),b(He),b(Yt),b(St),b(Kt),b(Xe),b(qe),b(eo),b(De),b(Le)}}}const wi={local:"owlvit",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"transformers.OwlViTConfig",title:"OwlViTConfig"},{local:"transformers.OwlViTTextConfig",title:"OwlViTTextConfig"},{local:"transformers.OwlViTVisionConfig",title:"OwlViTVisionConfig"},{local:"transformers.OwlViTImageProcessor",title:"OwlViTImageProcessor"},{local:"transformers.OwlViTFeatureExtractor",title:"OwlViTFeatureExtractor"},{local:"transformers.OwlViTProcessor",title:"OwlViTProcessor"},{local:"transformers.OwlViTModel",title:"OwlViTModel"},{local:"transformers.OwlViTTextModel",title:"OwlViTTextModel"},{local:"transformers.OwlViTVisionModel",title:"OwlViTVisionModel"},{local:"transformers.OwlViTForObjectDetection",title:"OwlViTForObjectDetection"}],title:"OWL-ViT"};function Ti(j){return Yr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $i extends Sr{constructor(n){super(),Kr(this,n,Ti,_i,Ar,{})}}export{$i as component};
