import{s as na,f as aa,o as ra,n as O}from"../chunks/scheduler.9bc65507.js";import{S as ia,i as la,g as d,s as a,r as g,A as ca,h as m,f as n,c as r,j as V,u as h,x as w,k as j,y as s,a as p,v as u,d as f,t as _,w as T}from"../chunks/index.707bf1b6.js";import{T as Xt}from"../chunks/Tip.c2ecdbf4.js";import{D as x}from"../chunks/Docstring.17db21ae.js";import{C as S}from"../chunks/CodeBlock.54a9f38d.js";import{E as ee}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as C}from"../chunks/Heading.342b1fa6.js";function da(v){let o,b="Example:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function ma(v){let o,b="Example:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function pa(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function ga(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function ha(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function ua(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function fa(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function _a(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function Ta(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function wa(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function ba(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function Ma(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function ya(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function va(v){let o,b="Examples:",l,c,M;return c=new S({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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function ja(v){let o,b=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=d("p"),o.innerHTML=b},l(l){o=m(l,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=b)},m(l,c){p(l,o,c)},p:O,d(l){l&&n(o)}}}function Va(v){let o,b="Examples:",l,c,M;return c=new S({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwT3dsVmlURm9yT2JqZWN0RGV0ZWN0aW9uJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gxNiUyMiklMEFtb2RlbCUyMCUzRCUyME93bFZpVEZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gxNiUyMiklMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBcXVlcnlfdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDAxNjc1LmpwZyUyMiUwQXF1ZXJ5X2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQocXVlcnlfdXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHF1ZXJ5X2ltYWdlcyUzRHF1ZXJ5X2ltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsLmltYWdlX2d1aWRlZF9kZXRlY3Rpb24oKippbnB1dHMpJTBBJTIzJTIwVGFyZ2V0JTIwaW1hZ2UlMjBzaXplcyUyMChoZWlnaHQlMkMlMjB3aWR0aCklMjB0byUyMHJlc2NhbGUlMjBib3glMjBwcmVkaWN0aW9ucyUyMCU1QmJhdGNoX3NpemUlMkMlMjAyJTVEJTBBdGFyZ2V0X3NpemVzJTIwJTNEJTIwdG9yY2guVGVuc29yKCU1QmltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCU1RCklMEElMjMlMjBDb252ZXJ0JTIwb3V0cHV0cyUyMChib3VuZGluZyUyMGJveGVzJTIwYW5kJTIwY2xhc3MlMjBsb2dpdHMpJTIwdG8lMjBQYXNjYWwlMjBWT0MlMjBmb3JtYXQlMjAoeG1pbiUyQyUyMHltaW4lMkMlMjB4bWF4JTJDJTIweW1heCklMEFyZXN1bHRzJTIwJTNEJTIwcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19pbWFnZV9ndWlkZWRfZGV0ZWN0aW9uKCUwQSUyMCUyMCUyMCUyMG91dHB1dHMlM0RvdXRwdXRzJTJDJTIwdGhyZXNob2xkJTNEMC42JTJDJTIwbm1zX3RocmVzaG9sZCUzRDAuMyUyQyUyMHRhcmdldF9zaXplcyUzRHRhcmdldF9zaXplcyUwQSklMEFpJTIwJTNEJTIwMCUyMCUyMCUyMyUyMFJldHJpZXZlJTIwcHJlZGljdGlvbnMlMjBmb3IlMjB0aGUlMjBmaXJzdCUyMGltYWdlJTBBYm94ZXMlMkMlMjBzY29yZXMlMjAlM0QlMjByZXN1bHRzJTVCaSU1RCU1QiUyMmJveGVzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QmklNUQlNUIlMjJzY29yZXMlMjIlNUQlMEFmb3IlMjBib3glMkMlMjBzY29yZSUyMGluJTIwemlwKGJveGVzJTJDJTIwc2NvcmVzKSUzQSUwQSUyMCUyMCUyMCUyMGJveCUyMCUzRCUyMCU1QnJvdW5kKGklMkMlMjAyKSUyMGZvciUyMGklMjBpbiUyMGJveC50b2xpc3QoKSU1RCUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJEZXRlY3RlZCUyMHNpbWlsYXIlMjBvYmplY3QlMjB3aXRoJTIwY29uZmlkZW5jZSUyMCU3QnJvdW5kKHNjb3JlLml0ZW0oKSUyQyUyMDMpJTdEJTIwYXQlMjBsb2NhdGlvbiUyMCU3QmJveCU3RCUyMik=",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 Pascal VOC format (xmin, ymin, xmax, ymax)</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(){o=d("p"),o.textContent=b,l=a(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=r(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:O,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(n(o),n(l)),T(c,t)}}}function xa(v){let o,b,l,c,M,t,y,vo,Be,wn='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.',jo,Fe,bn="The abstract from the paper is the following:",Vo,Re,Mn="<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>",xo,te,yn,$o,Ne,vn='OWL-ViT architecture. Taken from the <a href="https://arxiv.org/abs/2205.06230">original paper</a>.',Jo,He,jn='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>.',Uo,Ge,zo,Xe,Vn='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.',Oo,Pe,xn='<a href="/docs/transformers/main/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/main/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> is used to encode the text. <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> wraps <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/main/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/main/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> and <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a>.',Io,Ee,Co,Le,ko,qe,$n='A demo notebook on using OWL-ViT for zero- and one-shot (image-guided) object detection can be found <a href="https://github.com/huggingface/notebooks/blob/main/examples/zeroshot_object_detection_with_owlvit.ipynb" rel="nofollow">here</a>.',Zo,De,Wo,k,Qe,is,Pt,Jn=`<a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> is the configuration class to store the configuration of an <a href="/docs/transformers/main/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.`,ls,Et,Un=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,cs,oe,Ye,ds,Lt,zn=`Instantiate a <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> (or a derived class) from owlvit text model configuration and owlvit vision
model configuration.`,Bo,Se,Fo,Z,Ae,ms,qt,On=`This is the configuration class to store the configuration of an <a href="/docs/transformers/main/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.`,ps,Dt,In=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,gs,se,Ro,Ke,No,W,et,hs,Qt,Cn=`This is the configuration class to store the configuration of an <a href="/docs/transformers/main/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.`,us,Yt,kn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,fs,ne,Ho,tt,Go,J,ot,_s,St,Zn="Constructs an OWL-ViT image processor.",Ts,At,Wn=`This image processor inherits from <a href="/docs/transformers/main/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.`,ws,ae,st,bs,Kt,Bn="Prepares an image or batch of images for the model.",Ms,re,nt,ys,eo,Fn=`Converts the raw output of <a href="/docs/transformers/main/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.`,vs,ie,at,js,to,Rn=`Converts the output of <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,Xo,rt,Po,B,it,Vs,le,lt,xs,oo,Nn="Preprocess an image or a batch of images.",$s,ce,ct,Js,so,Hn=`Converts the raw output of <a href="/docs/transformers/main/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.`,Us,de,dt,zs,no,Gn=`Converts the output of <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,Eo,mt,Lo,$,pt,Os,ao,Xn=`Constructs an OWL-ViT processor which wraps <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>/<a href="/docs/transformers/main/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/main/en/model_doc/owlvit#transformers.OwlViTProcessor.decode">decode()</a> for more information.`,Is,me,gt,Cs,ro,Pn=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ks,pe,ht,Zs,io,En=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/main/en/model_doc/speech_to_text_2#transformers.Speech2Text2Tokenizer.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,Ws,ge,ut,Bs,lo,Ln=`This method forwards all its arguments to <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTFeatureExtractor.post_process">OwlViTImageProcessor.post_process()</a>. Please refer to the docstring
of this method for more information.`,Fs,he,ft,Rs,co,qn=`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.`,Ns,ue,_t,Hs,mo,Dn=`This method forwards all its arguments to <a href="/docs/transformers/main/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.`,qo,Tt,Do,U,wt,Gs,po,Qn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Xs,go,Yn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ps,F,bt,Es,ho,Sn='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',Ls,fe,qs,_e,Ds,R,Mt,Qs,uo,An='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',Ys,Te,Ss,we,As,N,yt,Ks,fo,Kn='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',en,be,tn,Me,Qo,vt,Yo,A,jt,on,H,Vt,sn,_o,ea='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a> forward method, overrides the <code>__call__</code> special method.',nn,ye,an,ve,So,xt,Ao,K,$t,rn,G,Jt,ln,To,ta='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel">OwlViTVisionModel</a> forward method, overrides the <code>__call__</code> special method.',cn,je,dn,Ve,Ko,Ut,es,L,zt,mn,X,Ot,pn,wo,oa='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',gn,xe,hn,$e,un,P,It,fn,bo,sa='The <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',_n,Je,Tn,Ue,ts,yo,os;return M=new C({props:{title:"OWL-ViT",local:"owl-vit",headingTag:"h1"}}),y=new C({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Ge=new C({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),Ee=new S({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBPd2xWaVRQcm9jZXNzb3IlMkMlMjBPd2xWaVRGb3JPYmplY3REZXRlY3Rpb24lMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBPd2xWaVRQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBbW9kZWwlMjAlM0QlMjBPd2xWaVRGb3JPYmplY3REZXRlY3Rpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRm93bHZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQXRleHRzJTIwJTNEJTIwJTVCJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTVEJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0R0ZXh0cyUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwVGFyZ2V0JTIwaW1hZ2UlMjBzaXplcyUyMChoZWlnaHQlMkMlMjB3aWR0aCklMjB0byUyMHJlc2NhbGUlMjBib3glMjBwcmVkaWN0aW9ucyUyMCU1QmJhdGNoX3NpemUlMkMlMjAyJTVEJTBBdGFyZ2V0X3NpemVzJTIwJTNEJTIwdG9yY2guVGVuc29yKCU1QmltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCU1RCklMEElMjMlMjBDb252ZXJ0JTIwb3V0cHV0cyUyMChib3VuZGluZyUyMGJveGVzJTIwYW5kJTIwY2xhc3MlMjBsb2dpdHMpJTIwdG8lMjBQYXNjYWwlMjBWT0MlMjBmb3JtYXQlMjAoeG1pbiUyQyUyMHltaW4lMkMlMjB4bWF4JTJDJTIweW1heCklMEFyZXN1bHRzJTIwJTNEJTIwcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19vYmplY3RfZGV0ZWN0aW9uKG91dHB1dHMlM0RvdXRwdXRzJTJDJTIwdGFyZ2V0X3NpemVzJTNEdGFyZ2V0X3NpemVzJTJDJTIwdGhyZXNob2xkJTNEMC4xKSUwQWklMjAlM0QlMjAwJTIwJTIwJTIzJTIwUmV0cmlldmUlMjBwcmVkaWN0aW9ucyUyMGZvciUyMHRoZSUyMGZpcnN0JTIwaW1hZ2UlMjBmb3IlMjB0aGUlMjBjb3JyZXNwb25kaW5nJTIwdGV4dCUyMHF1ZXJpZXMlMEF0ZXh0JTIwJTNEJTIwdGV4dHMlNUJpJTVEJTBBYm94ZXMlMkMlMjBzY29yZXMlMkMlMjBsYWJlbHMlMjAlM0QlMjByZXN1bHRzJTVCaSU1RCU1QiUyMmJveGVzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QmklNUQlNUIlMjJzY29yZXMlMjIlNUQlMkMlMjByZXN1bHRzJTVCaSU1RCU1QiUyMmxhYmVscyUyMiU1RCUwQWZvciUyMGJveCUyQyUyMHNjb3JlJTJDJTIwbGFiZWwlMjBpbiUyMHppcChib3hlcyUyQyUyMHNjb3JlcyUyQyUyMGxhYmVscyklM0ElMEElMjAlMjAlMjAlMjBib3glMjAlM0QlMjAlNUJyb3VuZChpJTJDJTIwMiklMjBmb3IlMjBpJTIwaW4lMjBib3gudG9saXN0KCklNUQlMEElMjAlMjAlMjAlMjBwcmludChmJTIyRGV0ZWN0ZWQlMjAlN0J0ZXh0JTVCbGFiZWwlNUQlN0QlMjB3aXRoJTIwY29uZmlkZW5jZSUyMCU3QnJvdW5kKHNjb3JlLml0ZW0oKSUyQyUyMDMpJTdEJTIwYXQlMjBsb2NhdGlvbiUyMCU3QmJveCU3RCUyMik=",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 Pascal VOC format (xmin, ymin, xmax, ymax)</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}}),Le=new C({props:{title:"Resources",local:"resources",headingTag:"h2"}}),De=new C({props:{title:"OwlViTConfig",local:"transformers.OwlViTConfig",headingTag:"h2"}}),Qe=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/main/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/main/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.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return a dictionary. If <code>False</code>, returns a tuple.`,name:"return_dict"},{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/main/src/transformers/models/owlvit/configuration_owlvit.py#L258"}}),Ye=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/main/src/transformers/models/owlvit/configuration_owlvit.py#L327",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An instance of a configuration object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig"
>OwlViTConfig</a></p>
`}}),Se=new C({props:{title:"OwlViTTextConfig",local:"transformers.OwlViTTextConfig",headingTag:"h2"}}),Ae=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/main/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-05) &#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.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.OwlViTTextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the padding token in the input sequences.`,name:"pad_token_id"},{anchor:"transformers.OwlViTTextConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49406) &#x2014;
The id of the beginning-of-sequence token in the input sequences.`,name:"bos_token_id"},{anchor:"transformers.OwlViTTextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49407) &#x2014;
The id of the end-of-sequence token in the input sequences.`,name:"eos_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/configuration_owlvit.py#L40"}}),se=new ee({props:{anchor:"transformers.OwlViTTextConfig.example",$$slots:{default:[da]},$$scope:{ctx:v}}}),Ke=new C({props:{title:"OwlViTVisionConfig",local:"transformers.OwlViTVisionConfig",headingTag:"h2"}}),et=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-05) &#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> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#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/main/src/transformers/models/owlvit/configuration_owlvit.py#L153"}}),ne=new ee({props:{anchor:"transformers.OwlViTVisionConfig.example",$$slots:{default:[ma]},$$scope:{ctx:v}}}),tt=new C({props:{title:"OwlViTImageProcessor",local:"transformers.OwlViTImageProcessor",headingTag:"h2"}}),ot=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>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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L91"}}),st=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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L270"}}),nt=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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L459",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[Dict]</code></p>
`}}),at=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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L515",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[Dict]</code></p>
`}}),rt=new C({props:{title:"OwlViTFeatureExtractor",local:"transformers.OwlViTFeatureExtractor",headingTag:"h2"}}),it=new x({props:{name:"class transformers.OwlViTFeatureExtractor",anchor:"transformers.OwlViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/feature_extraction_owlvit.py#L26"}}),lt=new x({props:{name:"__call__",anchor:"transformers.OwlViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L550"}}),ct=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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L413",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[Dict]</code></p>
`}}),dt=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/main/src/transformers/models/owlvit/image_processing_owlvit.py#L515",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[Dict]</code></p>
`}}),mt=new C({props:{title:"OwlViTProcessor",local:"transformers.OwlViTProcessor",headingTag:"h2"}}),pt=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/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a>, <em>optional</em>) &#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>], <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L29"}}),gt=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/main/src/transformers/models/owlvit/processing_owlvit.py#L197"}}),ht=new x({props:{name:"decode",anchor:"transformers.OwlViTProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L204"}}),ut=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/main/src/transformers/models/owlvit/processing_owlvit.py#L176"}}),ft=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/main/src/transformers/models/owlvit/processing_owlvit.py#L190"}}),_t=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/main/src/transformers/models/owlvit/processing_owlvit.py#L183"}}),Tt=new C({props:{title:"OwlViTModel",local:"transformers.OwlViTModel",headingTag:"h2"}}),wt=new x({props:{name:"class transformers.OwlViTModel",anchor:"transformers.OwlViTModel",parameters:[{name:"config",val:": OwlViTConfig"}],parametersDescription:[{anchor:"transformers.OwlViTModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1000"}}),bt=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1115",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/main/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/main/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/main/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/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new Xt({props:{$$slots:{default:[pa]},$$scope:{ctx:v}}}),_e=new ee({props:{anchor:"transformers.OwlViTModel.forward.example",$$slots:{default:[ga]},$$scope:{ctx:v}}}),Mt=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1035",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Te=new Xt({props:{$$slots:{default:[ha]},$$scope:{ctx:v}}}),we=new ee({props:{anchor:"transformers.OwlViTModel.get_text_features.example",$$slots:{default:[ua]},$$scope:{ctx:v}}}),yt=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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1070",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),be=new Xt({props:{$$slots:{default:[fa]},$$scope:{ctx:v}}}),Me=new ee({props:{anchor:"transformers.OwlViTModel.get_image_features.example",$$slots:{default:[_a]},$$scope:{ctx:v}}}),vt=new C({props:{title:"OwlViTTextModel",local:"transformers.OwlViTTextModel",headingTag:"h2"}}),jt=new x({props:{name:"class transformers.OwlViTTextModel",anchor:"transformers.OwlViTTextModel",parameters:[{name:"config",val:": OwlViTTextConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L839"}}),Vt=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L854",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ye=new Xt({props:{$$slots:{default:[Ta]},$$scope:{ctx:v}}}),ve=new ee({props:{anchor:"transformers.OwlViTTextModel.forward.example",$$slots:{default:[wa]},$$scope:{ctx:v}}}),xt=new C({props:{title:"OwlViTVisionModel",local:"transformers.OwlViTVisionModel",headingTag:"h2"}}),$t=new x({props:{name:"class transformers.OwlViTVisionModel",anchor:"transformers.OwlViTVisionModel",parameters:[{name:"config",val:": OwlViTVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L949"}}),Jt=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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L962",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new Xt({props:{$$slots:{default:[ba]},$$scope:{ctx:v}}}),Ve=new ee({props:{anchor:"transformers.OwlViTVisionModel.forward.example",$$slots:{default:[Ma]},$$scope:{ctx:v}}}),Ut=new C({props:{title:"OwlViTForObjectDetection",local:"transformers.OwlViTForObjectDetection",headingTag:"h2"}}),zt=new x({props:{name:"class transformers.OwlViTForObjectDetection",anchor:"transformers.OwlViTForObjectDetection",parameters:[{name:"config",val:": OwlViTConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1282"}}),Ot=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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/en/model_doc/fastspeech2_conformer#transformers.FastSpeech2ConformerTokenizer.__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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1584",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/main/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/main/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/main/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/main/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/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new Xt({props:{$$slots:{default:[ya]},$$scope:{ctx:v}}}),$e=new ee({props:{anchor:"transformers.OwlViTForObjectDetection.forward.example",$$slots:{default:[va]},$$scope:{ctx:v}}}),It=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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1489",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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/main/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/main/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/main/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/main/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/main/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/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTImageGuidedObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new Xt({props:{$$slots:{default:[ja]},$$scope:{ctx:v}}}),Ue=new ee({props:{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.example",$$slots:{default:[Va]},$$scope:{ctx:v}}}),{c(){o=d("meta"),b=a(),l=d("p"),c=a(),g(M.$$.fragment),t=a(),g(y.$$.fragment),vo=a(),Be=d("p"),Be.innerHTML=wn,jo=a(),Fe=d("p"),Fe.textContent=bn,Vo=a(),Re=d("p"),Re.innerHTML=Mn,xo=a(),te=d("img"),$o=a(),Ne=d("small"),Ne.innerHTML=vn,Jo=a(),He=d("p"),He.innerHTML=jn,Uo=a(),g(Ge.$$.fragment),zo=a(),Xe=d("p"),Xe.innerHTML=Vn,Oo=a(),Pe=d("p"),Pe.innerHTML=xn,Io=a(),g(Ee.$$.fragment),Co=a(),g(Le.$$.fragment),ko=a(),qe=d("p"),qe.innerHTML=$n,Zo=a(),g(De.$$.fragment),Wo=a(),k=d("div"),g(Qe.$$.fragment),is=a(),Pt=d("p"),Pt.innerHTML=Jn,ls=a(),Et=d("p"),Et.innerHTML=Un,cs=a(),oe=d("div"),g(Ye.$$.fragment),ds=a(),Lt=d("p"),Lt.innerHTML=zn,Bo=a(),g(Se.$$.fragment),Fo=a(),Z=d("div"),g(Ae.$$.fragment),ms=a(),qt=d("p"),qt.innerHTML=On,ps=a(),Dt=d("p"),Dt.innerHTML=In,gs=a(),g(se.$$.fragment),Ro=a(),g(Ke.$$.fragment),No=a(),W=d("div"),g(et.$$.fragment),hs=a(),Qt=d("p"),Qt.innerHTML=Cn,us=a(),Yt=d("p"),Yt.innerHTML=kn,fs=a(),g(ne.$$.fragment),Ho=a(),g(tt.$$.fragment),Go=a(),J=d("div"),g(ot.$$.fragment),_s=a(),St=d("p"),St.textContent=Zn,Ts=a(),At=d("p"),At.innerHTML=Wn,ws=a(),ae=d("div"),g(st.$$.fragment),bs=a(),Kt=d("p"),Kt.textContent=Bn,Ms=a(),re=d("div"),g(nt.$$.fragment),ys=a(),eo=d("p"),eo.innerHTML=Fn,vs=a(),ie=d("div"),g(at.$$.fragment),js=a(),to=d("p"),to.innerHTML=Rn,Xo=a(),g(rt.$$.fragment),Po=a(),B=d("div"),g(it.$$.fragment),Vs=a(),le=d("div"),g(lt.$$.fragment),xs=a(),oo=d("p"),oo.textContent=Nn,$s=a(),ce=d("div"),g(ct.$$.fragment),Js=a(),so=d("p"),so.innerHTML=Hn,Us=a(),de=d("div"),g(dt.$$.fragment),zs=a(),no=d("p"),no.innerHTML=Gn,Eo=a(),g(mt.$$.fragment),Lo=a(),$=d("div"),g(pt.$$.fragment),Os=a(),ao=d("p"),ao.innerHTML=Xn,Is=a(),me=d("div"),g(gt.$$.fragment),Cs=a(),ro=d("p"),ro.innerHTML=Pn,ks=a(),pe=d("div"),g(ht.$$.fragment),Zs=a(),io=d("p"),io.innerHTML=En,Ws=a(),ge=d("div"),g(ut.$$.fragment),Bs=a(),lo=d("p"),lo.innerHTML=Ln,Fs=a(),he=d("div"),g(ft.$$.fragment),Rs=a(),co=d("p"),co.innerHTML=qn,Ns=a(),ue=d("div"),g(_t.$$.fragment),Hs=a(),mo=d("p"),mo.innerHTML=Dn,qo=a(),g(Tt.$$.fragment),Do=a(),U=d("div"),g(wt.$$.fragment),Gs=a(),po=d("p"),po.innerHTML=Qn,Xs=a(),go=d("p"),go.innerHTML=Yn,Ps=a(),F=d("div"),g(bt.$$.fragment),Es=a(),ho=d("p"),ho.innerHTML=Sn,Ls=a(),g(fe.$$.fragment),qs=a(),g(_e.$$.fragment),Ds=a(),R=d("div"),g(Mt.$$.fragment),Qs=a(),uo=d("p"),uo.innerHTML=An,Ys=a(),g(Te.$$.fragment),Ss=a(),g(we.$$.fragment),As=a(),N=d("div"),g(yt.$$.fragment),Ks=a(),fo=d("p"),fo.innerHTML=Kn,en=a(),g(be.$$.fragment),tn=a(),g(Me.$$.fragment),Qo=a(),g(vt.$$.fragment),Yo=a(),A=d("div"),g(jt.$$.fragment),on=a(),H=d("div"),g(Vt.$$.fragment),sn=a(),_o=d("p"),_o.innerHTML=ea,nn=a(),g(ye.$$.fragment),an=a(),g(ve.$$.fragment),So=a(),g(xt.$$.fragment),Ao=a(),K=d("div"),g($t.$$.fragment),rn=a(),G=d("div"),g(Jt.$$.fragment),ln=a(),To=d("p"),To.innerHTML=ta,cn=a(),g(je.$$.fragment),dn=a(),g(Ve.$$.fragment),Ko=a(),g(Ut.$$.fragment),es=a(),L=d("div"),g(zt.$$.fragment),mn=a(),X=d("div"),g(Ot.$$.fragment),pn=a(),wo=d("p"),wo.innerHTML=oa,gn=a(),g(xe.$$.fragment),hn=a(),g($e.$$.fragment),un=a(),P=d("div"),g(It.$$.fragment),fn=a(),bo=d("p"),bo.innerHTML=sa,_n=a(),g(Je.$$.fragment),Tn=a(),g(Ue.$$.fragment),ts=a(),yo=d("p"),this.h()},l(e){const i=ca("svelte-u9bgzb",document.head);o=m(i,"META",{name:!0,content:!0}),i.forEach(n),b=r(e),l=m(e,"P",{}),V(l).forEach(n),c=r(e),h(M.$$.fragment,e),t=r(e),h(y.$$.fragment,e),vo=r(e),Be=m(e,"P",{"data-svelte-h":!0}),w(Be)!=="svelte-hzu5op"&&(Be.innerHTML=wn),jo=r(e),Fe=m(e,"P",{"data-svelte-h":!0}),w(Fe)!=="svelte-vfdo9a"&&(Fe.textContent=bn),Vo=r(e),Re=m(e,"P",{"data-svelte-h":!0}),w(Re)!=="svelte-1scvdlr"&&(Re.innerHTML=Mn),xo=r(e),te=m(e,"IMG",{src:!0,alt:!0,width:!0}),$o=r(e),Ne=m(e,"SMALL",{"data-svelte-h":!0}),w(Ne)!=="svelte-8x9gvw"&&(Ne.innerHTML=vn),Jo=r(e),He=m(e,"P",{"data-svelte-h":!0}),w(He)!=="svelte-1xerg4a"&&(He.innerHTML=jn),Uo=r(e),h(Ge.$$.fragment,e),zo=r(e),Xe=m(e,"P",{"data-svelte-h":!0}),w(Xe)!=="svelte-4h82a2"&&(Xe.innerHTML=Vn),Oo=r(e),Pe=m(e,"P",{"data-svelte-h":!0}),w(Pe)!=="svelte-3nx12k"&&(Pe.innerHTML=xn),Io=r(e),h(Ee.$$.fragment,e),Co=r(e),h(Le.$$.fragment,e),ko=r(e),qe=m(e,"P",{"data-svelte-h":!0}),w(qe)!=="svelte-vmrc34"&&(qe.innerHTML=$n),Zo=r(e),h(De.$$.fragment,e),Wo=r(e),k=m(e,"DIV",{class:!0});var q=V(k);h(Qe.$$.fragment,q),is=r(q),Pt=m(q,"P",{"data-svelte-h":!0}),w(Pt)!=="svelte-zw1v4l"&&(Pt.innerHTML=Jn),ls=r(q),Et=m(q,"P",{"data-svelte-h":!0}),w(Et)!=="svelte-o55m63"&&(Et.innerHTML=Un),cs=r(q),oe=m(q,"DIV",{class:!0});var Ct=V(oe);h(Ye.$$.fragment,Ct),ds=r(Ct),Lt=m(Ct,"P",{"data-svelte-h":!0}),w(Lt)!=="svelte-1d5tuu9"&&(Lt.innerHTML=zn),Ct.forEach(n),q.forEach(n),Bo=r(e),h(Se.$$.fragment,e),Fo=r(e),Z=m(e,"DIV",{class:!0});var D=V(Z);h(Ae.$$.fragment,D),ms=r(D),qt=m(D,"P",{"data-svelte-h":!0}),w(qt)!=="svelte-cnujne"&&(qt.innerHTML=On),ps=r(D),Dt=m(D,"P",{"data-svelte-h":!0}),w(Dt)!=="svelte-o55m63"&&(Dt.innerHTML=In),gs=r(D),h(se.$$.fragment,D),D.forEach(n),Ro=r(e),h(Ke.$$.fragment,e),No=r(e),W=m(e,"DIV",{class:!0});var Q=V(W);h(et.$$.fragment,Q),hs=r(Q),Qt=m(Q,"P",{"data-svelte-h":!0}),w(Qt)!=="svelte-12iweka"&&(Qt.innerHTML=Cn),us=r(Q),Yt=m(Q,"P",{"data-svelte-h":!0}),w(Yt)!=="svelte-o55m63"&&(Yt.innerHTML=kn),fs=r(Q),h(ne.$$.fragment,Q),Q.forEach(n),Ho=r(e),h(tt.$$.fragment,e),Go=r(e),J=m(e,"DIV",{class:!0});var I=V(J);h(ot.$$.fragment,I),_s=r(I),St=m(I,"P",{"data-svelte-h":!0}),w(St)!=="svelte-16zd1vi"&&(St.textContent=Zn),Ts=r(I),At=m(I,"P",{"data-svelte-h":!0}),w(At)!=="svelte-1rx94ef"&&(At.innerHTML=Wn),ws=r(I),ae=m(I,"DIV",{class:!0});var kt=V(ae);h(st.$$.fragment,kt),bs=r(kt),Kt=m(kt,"P",{"data-svelte-h":!0}),w(Kt)!=="svelte-1doxhpf"&&(Kt.textContent=Bn),kt.forEach(n),Ms=r(I),re=m(I,"DIV",{class:!0});var Zt=V(re);h(nt.$$.fragment,Zt),ys=r(Zt),eo=m(Zt,"P",{"data-svelte-h":!0}),w(eo)!=="svelte-1dv4izl"&&(eo.innerHTML=Fn),Zt.forEach(n),vs=r(I),ie=m(I,"DIV",{class:!0});var Wt=V(ie);h(at.$$.fragment,Wt),js=r(Wt),to=m(Wt,"P",{"data-svelte-h":!0}),w(to)!=="svelte-dhbo7w"&&(to.innerHTML=Rn),Wt.forEach(n),I.forEach(n),Xo=r(e),h(rt.$$.fragment,e),Po=r(e),B=m(e,"DIV",{class:!0});var Y=V(B);h(it.$$.fragment,Y),Vs=r(Y),le=m(Y,"DIV",{class:!0});var Bt=V(le);h(lt.$$.fragment,Bt),xs=r(Bt),oo=m(Bt,"P",{"data-svelte-h":!0}),w(oo)!=="svelte-khengj"&&(oo.textContent=Nn),Bt.forEach(n),$s=r(Y),ce=m(Y,"DIV",{class:!0});var Ft=V(ce);h(ct.$$.fragment,Ft),Js=r(Ft),so=m(Ft,"P",{"data-svelte-h":!0}),w(so)!=="svelte-1dv4izl"&&(so.innerHTML=Hn),Ft.forEach(n),Us=r(Y),de=m(Y,"DIV",{class:!0});var Rt=V(de);h(dt.$$.fragment,Rt),zs=r(Rt),no=m(Rt,"P",{"data-svelte-h":!0}),w(no)!=="svelte-dhbo7w"&&(no.innerHTML=Gn),Rt.forEach(n),Y.forEach(n),Eo=r(e),h(mt.$$.fragment,e),Lo=r(e),$=m(e,"DIV",{class:!0});var z=V($);h(pt.$$.fragment,z),Os=r(z),ao=m(z,"P",{"data-svelte-h":!0}),w(ao)!=="svelte-1090q6g"&&(ao.innerHTML=Xn),Is=r(z),me=m(z,"DIV",{class:!0});var Nt=V(me);h(gt.$$.fragment,Nt),Cs=r(Nt),ro=m(Nt,"P",{"data-svelte-h":!0}),w(ro)!=="svelte-gvo1bo"&&(ro.innerHTML=Pn),Nt.forEach(n),ks=r(z),pe=m(z,"DIV",{class:!0});var Ht=V(pe);h(ht.$$.fragment,Ht),Zs=r(Ht),io=m(Ht,"P",{"data-svelte-h":!0}),w(io)!=="svelte-dil32"&&(io.innerHTML=En),Ht.forEach(n),Ws=r(z),ge=m(z,"DIV",{class:!0});var Gt=V(ge);h(ut.$$.fragment,Gt),Bs=r(Gt),lo=m(Gt,"P",{"data-svelte-h":!0}),w(lo)!=="svelte-j8npcm"&&(lo.innerHTML=Ln),Gt.forEach(n),Fs=r(z),he=m(z,"DIV",{class:!0});var ss=V(he);h(ft.$$.fragment,ss),Rs=r(ss),co=m(ss,"P",{"data-svelte-h":!0}),w(co)!=="svelte-13us65f"&&(co.innerHTML=qn),ss.forEach(n),Ns=r(z),ue=m(z,"DIV",{class:!0});var ns=V(ue);h(_t.$$.fragment,ns),Hs=r(ns),mo=m(ns,"P",{"data-svelte-h":!0}),w(mo)!=="svelte-1a63lc1"&&(mo.innerHTML=Dn),ns.forEach(n),z.forEach(n),qo=r(e),h(Tt.$$.fragment,e),Do=r(e),U=m(e,"DIV",{class:!0});var E=V(U);h(wt.$$.fragment,E),Gs=r(E),po=m(E,"P",{"data-svelte-h":!0}),w(po)!=="svelte-6pahdo"&&(po.innerHTML=Qn),Xs=r(E),go=m(E,"P",{"data-svelte-h":!0}),w(go)!=="svelte-hswkmf"&&(go.innerHTML=Yn),Ps=r(E),F=m(E,"DIV",{class:!0});var ze=V(F);h(bt.$$.fragment,ze),Es=r(ze),ho=m(ze,"P",{"data-svelte-h":!0}),w(ho)!=="svelte-yh54lc"&&(ho.innerHTML=Sn),Ls=r(ze),h(fe.$$.fragment,ze),qs=r(ze),h(_e.$$.fragment,ze),ze.forEach(n),Ds=r(E),R=m(E,"DIV",{class:!0});var Oe=V(R);h(Mt.$$.fragment,Oe),Qs=r(Oe),uo=m(Oe,"P",{"data-svelte-h":!0}),w(uo)!=="svelte-yh54lc"&&(uo.innerHTML=An),Ys=r(Oe),h(Te.$$.fragment,Oe),Ss=r(Oe),h(we.$$.fragment,Oe),Oe.forEach(n),As=r(E),N=m(E,"DIV",{class:!0});var Ie=V(N);h(yt.$$.fragment,Ie),Ks=r(Ie),fo=m(Ie,"P",{"data-svelte-h":!0}),w(fo)!=="svelte-yh54lc"&&(fo.innerHTML=Kn),en=r(Ie),h(be.$$.fragment,Ie),tn=r(Ie),h(Me.$$.fragment,Ie),Ie.forEach(n),E.forEach(n),Qo=r(e),h(vt.$$.fragment,e),Yo=r(e),A=m(e,"DIV",{class:!0});var as=V(A);h(jt.$$.fragment,as),on=r(as),H=m(as,"DIV",{class:!0});var Ce=V(H);h(Vt.$$.fragment,Ce),sn=r(Ce),_o=m(Ce,"P",{"data-svelte-h":!0}),w(_o)!=="svelte-1gx978s"&&(_o.innerHTML=ea),nn=r(Ce),h(ye.$$.fragment,Ce),an=r(Ce),h(ve.$$.fragment,Ce),Ce.forEach(n),as.forEach(n),So=r(e),h(xt.$$.fragment,e),Ao=r(e),K=m(e,"DIV",{class:!0});var rs=V(K);h($t.$$.fragment,rs),rn=r(rs),G=m(rs,"DIV",{class:!0});var ke=V(G);h(Jt.$$.fragment,ke),ln=r(ke),To=m(ke,"P",{"data-svelte-h":!0}),w(To)!=="svelte-oxkgog"&&(To.innerHTML=ta),cn=r(ke),h(je.$$.fragment,ke),dn=r(ke),h(Ve.$$.fragment,ke),ke.forEach(n),rs.forEach(n),Ko=r(e),h(Ut.$$.fragment,e),es=r(e),L=m(e,"DIV",{class:!0});var Mo=V(L);h(zt.$$.fragment,Mo),mn=r(Mo),X=m(Mo,"DIV",{class:!0});var Ze=V(X);h(Ot.$$.fragment,Ze),pn=r(Ze),wo=m(Ze,"P",{"data-svelte-h":!0}),w(wo)!=="svelte-1rxcgvc"&&(wo.innerHTML=oa),gn=r(Ze),h(xe.$$.fragment,Ze),hn=r(Ze),h($e.$$.fragment,Ze),Ze.forEach(n),un=r(Mo),P=m(Mo,"DIV",{class:!0});var We=V(P);h(It.$$.fragment,We),fn=r(We),bo=m(We,"P",{"data-svelte-h":!0}),w(bo)!=="svelte-1rxcgvc"&&(bo.innerHTML=sa),_n=r(We),h(Je.$$.fragment,We),Tn=r(We),h(Ue.$$.fragment,We),We.forEach(n),Mo.forEach(n),ts=r(e),yo=m(e,"P",{}),V(yo).forEach(n),this.h()},h(){j(o,"name","hf:doc:metadata"),j(o,"content",$a),aa(te.src,yn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/owlvit_architecture.jpg")||j(te,"src",yn),j(te,"alt","drawing"),j(te,"width","600"),j(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){s(document.head,o),p(e,b,i),p(e,l,i),p(e,c,i),u(M,e,i),p(e,t,i),u(y,e,i),p(e,vo,i),p(e,Be,i),p(e,jo,i),p(e,Fe,i),p(e,Vo,i),p(e,Re,i),p(e,xo,i),p(e,te,i),p(e,$o,i),p(e,Ne,i),p(e,Jo,i),p(e,He,i),p(e,Uo,i),u(Ge,e,i),p(e,zo,i),p(e,Xe,i),p(e,Oo,i),p(e,Pe,i),p(e,Io,i),u(Ee,e,i),p(e,Co,i),u(Le,e,i),p(e,ko,i),p(e,qe,i),p(e,Zo,i),u(De,e,i),p(e,Wo,i),p(e,k,i),u(Qe,k,null),s(k,is),s(k,Pt),s(k,ls),s(k,Et),s(k,cs),s(k,oe),u(Ye,oe,null),s(oe,ds),s(oe,Lt),p(e,Bo,i),u(Se,e,i),p(e,Fo,i),p(e,Z,i),u(Ae,Z,null),s(Z,ms),s(Z,qt),s(Z,ps),s(Z,Dt),s(Z,gs),u(se,Z,null),p(e,Ro,i),u(Ke,e,i),p(e,No,i),p(e,W,i),u(et,W,null),s(W,hs),s(W,Qt),s(W,us),s(W,Yt),s(W,fs),u(ne,W,null),p(e,Ho,i),u(tt,e,i),p(e,Go,i),p(e,J,i),u(ot,J,null),s(J,_s),s(J,St),s(J,Ts),s(J,At),s(J,ws),s(J,ae),u(st,ae,null),s(ae,bs),s(ae,Kt),s(J,Ms),s(J,re),u(nt,re,null),s(re,ys),s(re,eo),s(J,vs),s(J,ie),u(at,ie,null),s(ie,js),s(ie,to),p(e,Xo,i),u(rt,e,i),p(e,Po,i),p(e,B,i),u(it,B,null),s(B,Vs),s(B,le),u(lt,le,null),s(le,xs),s(le,oo),s(B,$s),s(B,ce),u(ct,ce,null),s(ce,Js),s(ce,so),s(B,Us),s(B,de),u(dt,de,null),s(de,zs),s(de,no),p(e,Eo,i),u(mt,e,i),p(e,Lo,i),p(e,$,i),u(pt,$,null),s($,Os),s($,ao),s($,Is),s($,me),u(gt,me,null),s(me,Cs),s(me,ro),s($,ks),s($,pe),u(ht,pe,null),s(pe,Zs),s(pe,io),s($,Ws),s($,ge),u(ut,ge,null),s(ge,Bs),s(ge,lo),s($,Fs),s($,he),u(ft,he,null),s(he,Rs),s(he,co),s($,Ns),s($,ue),u(_t,ue,null),s(ue,Hs),s(ue,mo),p(e,qo,i),u(Tt,e,i),p(e,Do,i),p(e,U,i),u(wt,U,null),s(U,Gs),s(U,po),s(U,Xs),s(U,go),s(U,Ps),s(U,F),u(bt,F,null),s(F,Es),s(F,ho),s(F,Ls),u(fe,F,null),s(F,qs),u(_e,F,null),s(U,Ds),s(U,R),u(Mt,R,null),s(R,Qs),s(R,uo),s(R,Ys),u(Te,R,null),s(R,Ss),u(we,R,null),s(U,As),s(U,N),u(yt,N,null),s(N,Ks),s(N,fo),s(N,en),u(be,N,null),s(N,tn),u(Me,N,null),p(e,Qo,i),u(vt,e,i),p(e,Yo,i),p(e,A,i),u(jt,A,null),s(A,on),s(A,H),u(Vt,H,null),s(H,sn),s(H,_o),s(H,nn),u(ye,H,null),s(H,an),u(ve,H,null),p(e,So,i),u(xt,e,i),p(e,Ao,i),p(e,K,i),u($t,K,null),s(K,rn),s(K,G),u(Jt,G,null),s(G,ln),s(G,To),s(G,cn),u(je,G,null),s(G,dn),u(Ve,G,null),p(e,Ko,i),u(Ut,e,i),p(e,es,i),p(e,L,i),u(zt,L,null),s(L,mn),s(L,X),u(Ot,X,null),s(X,pn),s(X,wo),s(X,gn),u(xe,X,null),s(X,hn),u($e,X,null),s(L,un),s(L,P),u(It,P,null),s(P,fn),s(P,bo),s(P,_n),u(Je,P,null),s(P,Tn),u(Ue,P,null),p(e,ts,i),p(e,yo,i),os=!0},p(e,[i]){const q={};i&2&&(q.$$scope={dirty:i,ctx:e}),se.$set(q);const Ct={};i&2&&(Ct.$$scope={dirty:i,ctx:e}),ne.$set(Ct);const D={};i&2&&(D.$$scope={dirty:i,ctx:e}),fe.$set(D);const Q={};i&2&&(Q.$$scope={dirty:i,ctx:e}),_e.$set(Q);const I={};i&2&&(I.$$scope={dirty:i,ctx:e}),Te.$set(I);const kt={};i&2&&(kt.$$scope={dirty:i,ctx:e}),we.$set(kt);const Zt={};i&2&&(Zt.$$scope={dirty:i,ctx:e}),be.$set(Zt);const Wt={};i&2&&(Wt.$$scope={dirty:i,ctx:e}),Me.$set(Wt);const Y={};i&2&&(Y.$$scope={dirty:i,ctx:e}),ye.$set(Y);const Bt={};i&2&&(Bt.$$scope={dirty:i,ctx:e}),ve.$set(Bt);const Ft={};i&2&&(Ft.$$scope={dirty:i,ctx:e}),je.$set(Ft);const Rt={};i&2&&(Rt.$$scope={dirty:i,ctx:e}),Ve.$set(Rt);const z={};i&2&&(z.$$scope={dirty:i,ctx:e}),xe.$set(z);const Nt={};i&2&&(Nt.$$scope={dirty:i,ctx:e}),$e.$set(Nt);const Ht={};i&2&&(Ht.$$scope={dirty:i,ctx:e}),Je.$set(Ht);const Gt={};i&2&&(Gt.$$scope={dirty:i,ctx:e}),Ue.$set(Gt)},i(e){os||(f(M.$$.fragment,e),f(y.$$.fragment,e),f(Ge.$$.fragment,e),f(Ee.$$.fragment,e),f(Le.$$.fragment,e),f(De.$$.fragment,e),f(Qe.$$.fragment,e),f(Ye.$$.fragment,e),f(Se.$$.fragment,e),f(Ae.$$.fragment,e),f(se.$$.fragment,e),f(Ke.$$.fragment,e),f(et.$$.fragment,e),f(ne.$$.fragment,e),f(tt.$$.fragment,e),f(ot.$$.fragment,e),f(st.$$.fragment,e),f(nt.$$.fragment,e),f(at.$$.fragment,e),f(rt.$$.fragment,e),f(it.$$.fragment,e),f(lt.$$.fragment,e),f(ct.$$.fragment,e),f(dt.$$.fragment,e),f(mt.$$.fragment,e),f(pt.$$.fragment,e),f(gt.$$.fragment,e),f(ht.$$.fragment,e),f(ut.$$.fragment,e),f(ft.$$.fragment,e),f(_t.$$.fragment,e),f(Tt.$$.fragment,e),f(wt.$$.fragment,e),f(bt.$$.fragment,e),f(fe.$$.fragment,e),f(_e.$$.fragment,e),f(Mt.$$.fragment,e),f(Te.$$.fragment,e),f(we.$$.fragment,e),f(yt.$$.fragment,e),f(be.$$.fragment,e),f(Me.$$.fragment,e),f(vt.$$.fragment,e),f(jt.$$.fragment,e),f(Vt.$$.fragment,e),f(ye.$$.fragment,e),f(ve.$$.fragment,e),f(xt.$$.fragment,e),f($t.$$.fragment,e),f(Jt.$$.fragment,e),f(je.$$.fragment,e),f(Ve.$$.fragment,e),f(Ut.$$.fragment,e),f(zt.$$.fragment,e),f(Ot.$$.fragment,e),f(xe.$$.fragment,e),f($e.$$.fragment,e),f(It.$$.fragment,e),f(Je.$$.fragment,e),f(Ue.$$.fragment,e),os=!0)},o(e){_(M.$$.fragment,e),_(y.$$.fragment,e),_(Ge.$$.fragment,e),_(Ee.$$.fragment,e),_(Le.$$.fragment,e),_(De.$$.fragment,e),_(Qe.$$.fragment,e),_(Ye.$$.fragment,e),_(Se.$$.fragment,e),_(Ae.$$.fragment,e),_(se.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(ne.$$.fragment,e),_(tt.$$.fragment,e),_(ot.$$.fragment,e),_(st.$$.fragment,e),_(nt.$$.fragment,e),_(at.$$.fragment,e),_(rt.$$.fragment,e),_(it.$$.fragment,e),_(lt.$$.fragment,e),_(ct.$$.fragment,e),_(dt.$$.fragment,e),_(mt.$$.fragment,e),_(pt.$$.fragment,e),_(gt.$$.fragment,e),_(ht.$$.fragment,e),_(ut.$$.fragment,e),_(ft.$$.fragment,e),_(_t.$$.fragment,e),_(Tt.$$.fragment,e),_(wt.$$.fragment,e),_(bt.$$.fragment,e),_(fe.$$.fragment,e),_(_e.$$.fragment,e),_(Mt.$$.fragment,e),_(Te.$$.fragment,e),_(we.$$.fragment,e),_(yt.$$.fragment,e),_(be.$$.fragment,e),_(Me.$$.fragment,e),_(vt.$$.fragment,e),_(jt.$$.fragment,e),_(Vt.$$.fragment,e),_(ye.$$.fragment,e),_(ve.$$.fragment,e),_(xt.$$.fragment,e),_($t.$$.fragment,e),_(Jt.$$.fragment,e),_(je.$$.fragment,e),_(Ve.$$.fragment,e),_(Ut.$$.fragment,e),_(zt.$$.fragment,e),_(Ot.$$.fragment,e),_(xe.$$.fragment,e),_($e.$$.fragment,e),_(It.$$.fragment,e),_(Je.$$.fragment,e),_(Ue.$$.fragment,e),os=!1},d(e){e&&(n(b),n(l),n(c),n(t),n(vo),n(Be),n(jo),n(Fe),n(Vo),n(Re),n(xo),n(te),n($o),n(Ne),n(Jo),n(He),n(Uo),n(zo),n(Xe),n(Oo),n(Pe),n(Io),n(Co),n(ko),n(qe),n(Zo),n(Wo),n(k),n(Bo),n(Fo),n(Z),n(Ro),n(No),n(W),n(Ho),n(Go),n(J),n(Xo),n(Po),n(B),n(Eo),n(Lo),n($),n(qo),n(Do),n(U),n(Qo),n(Yo),n(A),n(So),n(Ao),n(K),n(Ko),n(es),n(L),n(ts),n(yo)),n(o),T(M,e),T(y,e),T(Ge,e),T(Ee,e),T(Le,e),T(De,e),T(Qe),T(Ye),T(Se,e),T(Ae),T(se),T(Ke,e),T(et),T(ne),T(tt,e),T(ot),T(st),T(nt),T(at),T(rt,e),T(it),T(lt),T(ct),T(dt),T(mt,e),T(pt),T(gt),T(ht),T(ut),T(ft),T(_t),T(Tt,e),T(wt),T(bt),T(fe),T(_e),T(Mt),T(Te),T(we),T(yt),T(be),T(Me),T(vt,e),T(jt),T(Vt),T(ye),T(ve),T(xt,e),T($t),T(Jt),T(je),T(Ve),T(Ut,e),T(zt),T(Ot),T(xe),T($e),T(It),T(Je),T(Ue)}}}const $a='{"title":"OWL-ViT","local":"owl-vit","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"OwlViTConfig","local":"transformers.OwlViTConfig","sections":[],"depth":2},{"title":"OwlViTTextConfig","local":"transformers.OwlViTTextConfig","sections":[],"depth":2},{"title":"OwlViTVisionConfig","local":"transformers.OwlViTVisionConfig","sections":[],"depth":2},{"title":"OwlViTImageProcessor","local":"transformers.OwlViTImageProcessor","sections":[],"depth":2},{"title":"OwlViTFeatureExtractor","local":"transformers.OwlViTFeatureExtractor","sections":[],"depth":2},{"title":"OwlViTProcessor","local":"transformers.OwlViTProcessor","sections":[],"depth":2},{"title":"OwlViTModel","local":"transformers.OwlViTModel","sections":[],"depth":2},{"title":"OwlViTTextModel","local":"transformers.OwlViTTextModel","sections":[],"depth":2},{"title":"OwlViTVisionModel","local":"transformers.OwlViTVisionModel","sections":[],"depth":2},{"title":"OwlViTForObjectDetection","local":"transformers.OwlViTForObjectDetection","sections":[],"depth":2}],"depth":1}';function Ja(v){return ra(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wa extends ia{constructor(o){super(),la(this,o,Ja,xa,na,{})}}export{Wa as component};
