import{s as ar,f as ir,o as lr,n as U}from"../chunks/scheduler.25b97de1.js";import{S as cr,i as dr,g as d,s as r,r as g,A as mr,h as m,f as s,c as a,j as V,u as h,x as w,k as j,y as n,a as p,v as u,d as f,t as _,w as T}from"../chunks/index.d9030fc9.js";import{T as Xt}from"../chunks/Tip.baa67368.js";import{D as $}from"../chunks/Docstring.e257edda.js";import{C as S}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ee}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as C,E as pr}from"../chunks/EditOnGithub.91d95064.js";function gr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function hr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function ur(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:U,d(l){l&&s(o)}}}function fr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function _r(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:U,d(l){l&&s(o)}}}function Tr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function wr(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:U,d(l){l&&s(o)}}}function br(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function Mr(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:U,d(l){l&&s(o)}}}function yr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function vr(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:U,d(l){l&&s(o)}}}function jr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function Vr(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:U,d(l){l&&s(o)}}}function $r(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function xr(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:U,d(l){l&&s(o)}}}function Jr(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=r(),g(c.$$.fragment)},l(t){o=m(t,"P",{"data-svelte-h":!0}),w(o)!=="svelte-kvfsh7"&&(o.textContent=b),l=a(t),h(c.$$.fragment,t)},m(t,y){p(t,o,y),p(t,l,y),u(c,t,y),M=!0},p:U,i(t){M||(f(c.$$.fragment,t),M=!0)},o(t){_(c.$$.fragment,t),M=!1},d(t){t&&(s(o),s(l)),T(c,t)}}}function zr(v){let o,b,l,c,M,t,y,jo,Be,Mn='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.',Vo,Re,yn="The abstract from the paper is the following:",$o,Fe,vn="<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,jn,Jo,Ne,Vn='OWL-ViT architecture. Taken from the <a href="https://arxiv.org/abs/2205.06230">original paper</a>.',zo,He,$n='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>.',Oo,Ge,Uo,Pe,xn='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.',Io,Xe,Jn='<a href="/docs/transformers/pr_29261/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/pr_29261/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a> is used to encode the text. <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> wraps <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/pr_29261/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/pr_29261/en/model_doc/owlvit#transformers.OwlViTProcessor">OwlViTProcessor</a> and <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a>.',Co,Ee,ko,qe,Zo,Le,zn='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>.',Wo,De,Bo,k,Qe,cs,Et,On=`<a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> is the configuration class to store the configuration of an <a href="/docs/transformers/pr_29261/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.`,ds,qt,Un=`Configuration objects inherit from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ms,oe,Ye,ps,Lt,In=`Instantiate a <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a> (or a derived class) from owlvit text model configuration and owlvit vision
model configuration.`,Ro,Se,Fo,Z,Ae,gs,Dt,Cn=`This is the configuration class to store the configuration of an <a href="/docs/transformers/pr_29261/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.`,hs,Qt,kn=`Configuration objects inherit from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,us,se,No,Ke,Ho,W,et,fs,Yt,Zn=`This is the configuration class to store the configuration of an <a href="/docs/transformers/pr_29261/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.`,_s,St,Wn=`Configuration objects inherit from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_29261/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ts,ne,Go,tt,Po,J,ot,ws,At,Bn="Constructs an OWL-ViT image processor.",bs,Kt,Rn=`This image processor inherits from <a href="/docs/transformers/pr_29261/en/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Ms,re,st,ys,eo,Fn="Prepares an image or batch of images for the model.",vs,ae,nt,js,to,Nn=`Converts the raw output of <a href="/docs/transformers/pr_29261/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,rt,$s,oo,Hn=`Converts the output of <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,Xo,at,Eo,B,it,xs,le,lt,Js,so,Gn="Preprocess an image or a batch of images.",zs,ce,ct,Os,no,Pn=`Converts the raw output of <a href="/docs/transformers/pr_29261/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,Is,ro,Xn=`Converts the output of <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection">OwlViTForObjectDetection.image_guided_detection()</a> into the format expected by the COCO
api.`,qo,mt,Lo,x,pt,Cs,ao,En=`Constructs an OWL-ViT processor which wraps <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a> and <a href="/docs/transformers/pr_29261/en/model_doc/clip#transformers.CLIPTokenizer">CLIPTokenizer</a>/<a href="/docs/transformers/pr_29261/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/pr_29261/en/model_doc/owlvit#transformers.OwlViTProcessor.decode">decode()</a> for more information.`,ks,me,gt,Zs,io,qn=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Ws,pe,ht,Bs,lo,Ln=`This method forwards all its arguments to CLIPTokenizerFast’s <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,Rs,ge,ut,Fs,co,Dn=`This method forwards all its arguments to <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTFeatureExtractor.post_process">OwlViTImageProcessor.post_process()</a>. Please refer to the docstring
of this method for more information.`,Ns,he,ft,Hs,mo,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.`,Gs,ue,_t,Ps,po,Yn=`This method forwards all its arguments to <a href="/docs/transformers/pr_29261/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.`,Do,Tt,Qo,z,wt,Xs,go,Sn=`This model inherits from <a href="/docs/transformers/pr_29261/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.)`,Es,ho,An=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,qs,R,bt,Ls,uo,Kn='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',Ds,fe,Qs,_e,Ys,F,Mt,Ss,fo,er='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',As,Te,Ks,we,en,N,yt,tn,_o,tr='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTModel">OwlViTModel</a> forward method, overrides the <code>__call__</code> special method.',on,be,sn,Me,Yo,vt,So,A,jt,nn,H,Vt,rn,To,or='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a> forward method, overrides the <code>__call__</code> special method.',an,ye,ln,ve,Ao,$t,Ko,K,xt,cn,G,Jt,dn,wo,sr='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTVisionModel">OwlViTVisionModel</a> forward method, overrides the <code>__call__</code> special method.',mn,je,pn,Ve,es,zt,ts,q,Ot,gn,P,Ut,hn,bo,nr='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',un,$e,fn,xe,_n,X,It,Tn,Mo,rr='The <a href="/docs/transformers/pr_29261/en/model_doc/owlvit#transformers.OwlViTForObjectDetection">OwlViTForObjectDetection</a> forward method, overrides the <code>__call__</code> special method.',wn,Je,bn,ze,os,Ct,ss,vo,ns;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}}),qe=new C({props:{title:"Resources",local:"resources",headingTag:"h2"}}),De=new C({props:{title:"OwlViTConfig",local:"transformers.OwlViTConfig",headingTag:"h2"}}),Qe=new $({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/pr_29261/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/pr_29261/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 initial 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/vr_29261/src/transformers/models/owlvit/configuration_owlvit.py#L252"}}),Ye=new $({props:{name:"from_text_vision_configs",anchor:"transformers.OwlViTConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": Dict"},{name:"vision_config",val:": Dict"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/configuration_owlvit.py#L321",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/pr_29261/en/model_doc/owlvit#transformers.OwlViTConfig"
>OwlViTConfig</a></p>
`}}),Se=new C({props:{title:"OwlViTTextConfig",local:"transformers.OwlViTTextConfig",headingTag:"h2"}}),Ae=new $({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/pr_29261/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/vr_29261/src/transformers/models/owlvit/configuration_owlvit.py#L34"}}),se=new ee({props:{anchor:"transformers.OwlViTTextConfig.example",$$slots:{default:[gr]},$$scope:{ctx:v}}}),Ke=new C({props:{title:"OwlViTVisionConfig",local:"transformers.OwlViTVisionConfig",headingTag:"h2"}}),et=new $({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/vr_29261/src/transformers/models/owlvit/configuration_owlvit.py#L147"}}),ne=new ee({props:{anchor:"transformers.OwlViTVisionConfig.example",$$slots:{default:[hr]},$$scope:{ctx:v}}}),tt=new C({props:{title:"OwlViTImageProcessor",local:"transformers.OwlViTImageProcessor",headingTag:"h2"}}),ot=new $({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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L92"}}),st=new $({props:{name:"preprocess",anchor:"transformers.OwlViTImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": Optional = None"},{name:"crop_size",val:": Optional = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"}],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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L271"}}),nt=new $({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:": Union = 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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L461",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>
`}}),rt=new $({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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L517",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>
`}}),at=new C({props:{title:"OwlViTFeatureExtractor",local:"transformers.OwlViTFeatureExtractor",headingTag:"h2"}}),it=new $({props:{name:"class transformers.OwlViTFeatureExtractor",anchor:"transformers.OwlViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/feature_extraction_owlvit.py#L26"}}),lt=new $({props:{name:"__call__",anchor:"transformers.OwlViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/image_processing_utils.py#L39"}}),ct=new $({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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L415",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 $({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/vr_29261/src/transformers/models/owlvit/image_processing_owlvit.py#L517",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 $({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/pr_29261/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/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L29"}}),gt=new $({props:{name:"batch_decode",anchor:"transformers.OwlViTProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L196"}}),ht=new $({props:{name:"decode",anchor:"transformers.OwlViTProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L203"}}),ut=new $({props:{name:"post_process",anchor:"transformers.OwlViTProcessor.post_process",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L175"}}),ft=new $({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/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L189"}}),_t=new $({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/vr_29261/src/transformers/models/owlvit/processing_owlvit.py#L182"}}),Tt=new C({props:{title:"OwlViTModel",local:"transformers.OwlViTModel",headingTag:"h2"}}),wt=new $({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/pr_29261/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/pr_29261/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L993"}}),bt=new $({props:{name:"forward",anchor:"transformers.OwlViTModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"pixel_values",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"return_loss",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_base_image_embeds",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1109",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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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:[ur]},$$scope:{ctx:v}}}),_e=new ee({props:{anchor:"transformers.OwlViTModel.forward.example",$$slots:{default:[fr]},$$scope:{ctx:v}}}),Mt=new $({props:{name:"get_text_features",anchor:"transformers.OwlViTModel.get_text_features",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1029",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/pr_29261/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:[_r]},$$scope:{ctx:v}}}),we=new ee({props:{anchor:"transformers.OwlViTModel.get_text_features.example",$$slots:{default:[Tr]},$$scope:{ctx:v}}}),yt=new $({props:{name:"get_image_features",anchor:"transformers.OwlViTModel.get_image_features",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1064",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/pr_29261/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:[wr]},$$scope:{ctx:v}}}),Me=new ee({props:{anchor:"transformers.OwlViTModel.get_image_features.example",$$slots:{default:[br]},$$scope:{ctx:v}}}),vt=new C({props:{title:"OwlViTTextModel",local:"transformers.OwlViTTextModel",headingTag:"h2"}}),jt=new $({props:{name:"class transformers.OwlViTTextModel",anchor:"transformers.OwlViTTextModel",parameters:[{name:"config",val:": OwlViTTextConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L833"}}),Vt=new $({props:{name:"forward",anchor:"transformers.OwlViTTextModel.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L848",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29261/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/pr_29261/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:[Mr]},$$scope:{ctx:v}}}),ve=new ee({props:{anchor:"transformers.OwlViTTextModel.forward.example",$$slots:{default:[yr]},$$scope:{ctx:v}}}),$t=new C({props:{title:"OwlViTVisionModel",local:"transformers.OwlViTVisionModel",headingTag:"h2"}}),xt=new $({props:{name:"class transformers.OwlViTVisionModel",anchor:"transformers.OwlViTVisionModel",parameters:[{name:"config",val:": OwlViTVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L943"}}),Jt=new $({props:{name:"forward",anchor:"transformers.OwlViTVisionModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L956",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_29261/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/pr_29261/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:[vr]},$$scope:{ctx:v}}}),Ve=new ee({props:{anchor:"transformers.OwlViTVisionModel.forward.example",$$slots:{default:[jr]},$$scope:{ctx:v}}}),zt=new C({props:{title:"OwlViTForObjectDetection",local:"transformers.OwlViTForObjectDetection",headingTag:"h2"}}),Ot=new $({props:{name:"class transformers.OwlViTForObjectDetection",anchor:"transformers.OwlViTForObjectDetection",parameters:[{name:"config",val:": OwlViTConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1266"}}),Ut=new $({props:{name:"forward",anchor:"transformers.OwlViTForObjectDetection.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"pixel_values",val:": FloatTensor"},{name:"attention_mask",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/pr_29261/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1568",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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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>
`}}),$e=new Xt({props:{$$slots:{default:[Vr]},$$scope:{ctx:v}}}),xe=new ee({props:{anchor:"transformers.OwlViTForObjectDetection.forward.example",$$slots:{default:[$r]},$$scope:{ctx:v}}}),It=new $({props:{name:"image_guided_detection",anchor:"transformers.OwlViTForObjectDetection.image_guided_detection",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"query_pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_29261/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_29261/src/transformers/models/owlvit/modeling_owlvit.py#L1473",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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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/pr_29261/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:[xr]},$$scope:{ctx:v}}}),ze=new ee({props:{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.example",$$slots:{default:[Jr]},$$scope:{ctx:v}}}),Ct=new pr({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/owlvit.md"}}),{c(){o=d("meta"),b=r(),l=d("p"),c=r(),g(M.$$.fragment),t=r(),g(y.$$.fragment),jo=r(),Be=d("p"),Be.innerHTML=Mn,Vo=r(),Re=d("p"),Re.textContent=yn,$o=r(),Fe=d("p"),Fe.innerHTML=vn,xo=r(),te=d("img"),Jo=r(),Ne=d("small"),Ne.innerHTML=Vn,zo=r(),He=d("p"),He.innerHTML=$n,Oo=r(),g(Ge.$$.fragment),Uo=r(),Pe=d("p"),Pe.innerHTML=xn,Io=r(),Xe=d("p"),Xe.innerHTML=Jn,Co=r(),g(Ee.$$.fragment),ko=r(),g(qe.$$.fragment),Zo=r(),Le=d("p"),Le.innerHTML=zn,Wo=r(),g(De.$$.fragment),Bo=r(),k=d("div"),g(Qe.$$.fragment),cs=r(),Et=d("p"),Et.innerHTML=On,ds=r(),qt=d("p"),qt.innerHTML=Un,ms=r(),oe=d("div"),g(Ye.$$.fragment),ps=r(),Lt=d("p"),Lt.innerHTML=In,Ro=r(),g(Se.$$.fragment),Fo=r(),Z=d("div"),g(Ae.$$.fragment),gs=r(),Dt=d("p"),Dt.innerHTML=Cn,hs=r(),Qt=d("p"),Qt.innerHTML=kn,us=r(),g(se.$$.fragment),No=r(),g(Ke.$$.fragment),Ho=r(),W=d("div"),g(et.$$.fragment),fs=r(),Yt=d("p"),Yt.innerHTML=Zn,_s=r(),St=d("p"),St.innerHTML=Wn,Ts=r(),g(ne.$$.fragment),Go=r(),g(tt.$$.fragment),Po=r(),J=d("div"),g(ot.$$.fragment),ws=r(),At=d("p"),At.textContent=Bn,bs=r(),Kt=d("p"),Kt.innerHTML=Rn,Ms=r(),re=d("div"),g(st.$$.fragment),ys=r(),eo=d("p"),eo.textContent=Fn,vs=r(),ae=d("div"),g(nt.$$.fragment),js=r(),to=d("p"),to.innerHTML=Nn,Vs=r(),ie=d("div"),g(rt.$$.fragment),$s=r(),oo=d("p"),oo.innerHTML=Hn,Xo=r(),g(at.$$.fragment),Eo=r(),B=d("div"),g(it.$$.fragment),xs=r(),le=d("div"),g(lt.$$.fragment),Js=r(),so=d("p"),so.textContent=Gn,zs=r(),ce=d("div"),g(ct.$$.fragment),Os=r(),no=d("p"),no.innerHTML=Pn,Us=r(),de=d("div"),g(dt.$$.fragment),Is=r(),ro=d("p"),ro.innerHTML=Xn,qo=r(),g(mt.$$.fragment),Lo=r(),x=d("div"),g(pt.$$.fragment),Cs=r(),ao=d("p"),ao.innerHTML=En,ks=r(),me=d("div"),g(gt.$$.fragment),Zs=r(),io=d("p"),io.innerHTML=qn,Ws=r(),pe=d("div"),g(ht.$$.fragment),Bs=r(),lo=d("p"),lo.innerHTML=Ln,Rs=r(),ge=d("div"),g(ut.$$.fragment),Fs=r(),co=d("p"),co.innerHTML=Dn,Ns=r(),he=d("div"),g(ft.$$.fragment),Hs=r(),mo=d("p"),mo.innerHTML=Qn,Gs=r(),ue=d("div"),g(_t.$$.fragment),Ps=r(),po=d("p"),po.innerHTML=Yn,Do=r(),g(Tt.$$.fragment),Qo=r(),z=d("div"),g(wt.$$.fragment),Xs=r(),go=d("p"),go.innerHTML=Sn,Es=r(),ho=d("p"),ho.innerHTML=An,qs=r(),R=d("div"),g(bt.$$.fragment),Ls=r(),uo=d("p"),uo.innerHTML=Kn,Ds=r(),g(fe.$$.fragment),Qs=r(),g(_e.$$.fragment),Ys=r(),F=d("div"),g(Mt.$$.fragment),Ss=r(),fo=d("p"),fo.innerHTML=er,As=r(),g(Te.$$.fragment),Ks=r(),g(we.$$.fragment),en=r(),N=d("div"),g(yt.$$.fragment),tn=r(),_o=d("p"),_o.innerHTML=tr,on=r(),g(be.$$.fragment),sn=r(),g(Me.$$.fragment),Yo=r(),g(vt.$$.fragment),So=r(),A=d("div"),g(jt.$$.fragment),nn=r(),H=d("div"),g(Vt.$$.fragment),rn=r(),To=d("p"),To.innerHTML=or,an=r(),g(ye.$$.fragment),ln=r(),g(ve.$$.fragment),Ao=r(),g($t.$$.fragment),Ko=r(),K=d("div"),g(xt.$$.fragment),cn=r(),G=d("div"),g(Jt.$$.fragment),dn=r(),wo=d("p"),wo.innerHTML=sr,mn=r(),g(je.$$.fragment),pn=r(),g(Ve.$$.fragment),es=r(),g(zt.$$.fragment),ts=r(),q=d("div"),g(Ot.$$.fragment),gn=r(),P=d("div"),g(Ut.$$.fragment),hn=r(),bo=d("p"),bo.innerHTML=nr,un=r(),g($e.$$.fragment),fn=r(),g(xe.$$.fragment),_n=r(),X=d("div"),g(It.$$.fragment),Tn=r(),Mo=d("p"),Mo.innerHTML=rr,wn=r(),g(Je.$$.fragment),bn=r(),g(ze.$$.fragment),os=r(),g(Ct.$$.fragment),ss=r(),vo=d("p"),this.h()},l(e){const i=mr("svelte-u9bgzb",document.head);o=m(i,"META",{name:!0,content:!0}),i.forEach(s),b=a(e),l=m(e,"P",{}),V(l).forEach(s),c=a(e),h(M.$$.fragment,e),t=a(e),h(y.$$.fragment,e),jo=a(e),Be=m(e,"P",{"data-svelte-h":!0}),w(Be)!=="svelte-hzu5op"&&(Be.innerHTML=Mn),Vo=a(e),Re=m(e,"P",{"data-svelte-h":!0}),w(Re)!=="svelte-vfdo9a"&&(Re.textContent=yn),$o=a(e),Fe=m(e,"P",{"data-svelte-h":!0}),w(Fe)!=="svelte-1scvdlr"&&(Fe.innerHTML=vn),xo=a(e),te=m(e,"IMG",{src:!0,alt:!0,width:!0}),Jo=a(e),Ne=m(e,"SMALL",{"data-svelte-h":!0}),w(Ne)!=="svelte-8x9gvw"&&(Ne.innerHTML=Vn),zo=a(e),He=m(e,"P",{"data-svelte-h":!0}),w(He)!=="svelte-1xerg4a"&&(He.innerHTML=$n),Oo=a(e),h(Ge.$$.fragment,e),Uo=a(e),Pe=m(e,"P",{"data-svelte-h":!0}),w(Pe)!=="svelte-4h82a2"&&(Pe.innerHTML=xn),Io=a(e),Xe=m(e,"P",{"data-svelte-h":!0}),w(Xe)!=="svelte-132pfx0"&&(Xe.innerHTML=Jn),Co=a(e),h(Ee.$$.fragment,e),ko=a(e),h(qe.$$.fragment,e),Zo=a(e),Le=m(e,"P",{"data-svelte-h":!0}),w(Le)!=="svelte-vmrc34"&&(Le.innerHTML=zn),Wo=a(e),h(De.$$.fragment,e),Bo=a(e),k=m(e,"DIV",{class:!0});var L=V(k);h(Qe.$$.fragment,L),cs=a(L),Et=m(L,"P",{"data-svelte-h":!0}),w(Et)!=="svelte-10w2yrp"&&(Et.innerHTML=On),ds=a(L),qt=m(L,"P",{"data-svelte-h":!0}),w(qt)!=="svelte-1k3ao0b"&&(qt.innerHTML=Un),ms=a(L),oe=m(L,"DIV",{class:!0});var kt=V(oe);h(Ye.$$.fragment,kt),ps=a(kt),Lt=m(kt,"P",{"data-svelte-h":!0}),w(Lt)!=="svelte-1xad3lt"&&(Lt.innerHTML=In),kt.forEach(s),L.forEach(s),Ro=a(e),h(Se.$$.fragment,e),Fo=a(e),Z=m(e,"DIV",{class:!0});var D=V(Z);h(Ae.$$.fragment,D),gs=a(D),Dt=m(D,"P",{"data-svelte-h":!0}),w(Dt)!=="svelte-1j1xkdu"&&(Dt.innerHTML=Cn),hs=a(D),Qt=m(D,"P",{"data-svelte-h":!0}),w(Qt)!=="svelte-1k3ao0b"&&(Qt.innerHTML=kn),us=a(D),h(se.$$.fragment,D),D.forEach(s),No=a(e),h(Ke.$$.fragment,e),Ho=a(e),W=m(e,"DIV",{class:!0});var Q=V(W);h(et.$$.fragment,Q),fs=a(Q),Yt=m(Q,"P",{"data-svelte-h":!0}),w(Yt)!=="svelte-10w8x4i"&&(Yt.innerHTML=Zn),_s=a(Q),St=m(Q,"P",{"data-svelte-h":!0}),w(St)!=="svelte-1k3ao0b"&&(St.innerHTML=Wn),Ts=a(Q),h(ne.$$.fragment,Q),Q.forEach(s),Go=a(e),h(tt.$$.fragment,e),Po=a(e),J=m(e,"DIV",{class:!0});var I=V(J);h(ot.$$.fragment,I),ws=a(I),At=m(I,"P",{"data-svelte-h":!0}),w(At)!=="svelte-16zd1vi"&&(At.textContent=Bn),bs=a(I),Kt=m(I,"P",{"data-svelte-h":!0}),w(Kt)!=="svelte-s6s5ej"&&(Kt.innerHTML=Rn),Ms=a(I),re=m(I,"DIV",{class:!0});var Zt=V(re);h(st.$$.fragment,Zt),ys=a(Zt),eo=m(Zt,"P",{"data-svelte-h":!0}),w(eo)!=="svelte-1doxhpf"&&(eo.textContent=Fn),Zt.forEach(s),vs=a(I),ae=m(I,"DIV",{class:!0});var Wt=V(ae);h(nt.$$.fragment,Wt),js=a(Wt),to=m(Wt,"P",{"data-svelte-h":!0}),w(to)!=="svelte-17mfiyh"&&(to.innerHTML=Nn),Wt.forEach(s),Vs=a(I),ie=m(I,"DIV",{class:!0});var Bt=V(ie);h(rt.$$.fragment,Bt),$s=a(Bt),oo=m(Bt,"P",{"data-svelte-h":!0}),w(oo)!=="svelte-1wdozkc"&&(oo.innerHTML=Hn),Bt.forEach(s),I.forEach(s),Xo=a(e),h(at.$$.fragment,e),Eo=a(e),B=m(e,"DIV",{class:!0});var Y=V(B);h(it.$$.fragment,Y),xs=a(Y),le=m(Y,"DIV",{class:!0});var Rt=V(le);h(lt.$$.fragment,Rt),Js=a(Rt),so=m(Rt,"P",{"data-svelte-h":!0}),w(so)!=="svelte-khengj"&&(so.textContent=Gn),Rt.forEach(s),zs=a(Y),ce=m(Y,"DIV",{class:!0});var Ft=V(ce);h(ct.$$.fragment,Ft),Os=a(Ft),no=m(Ft,"P",{"data-svelte-h":!0}),w(no)!=="svelte-17mfiyh"&&(no.innerHTML=Pn),Ft.forEach(s),Us=a(Y),de=m(Y,"DIV",{class:!0});var Nt=V(de);h(dt.$$.fragment,Nt),Is=a(Nt),ro=m(Nt,"P",{"data-svelte-h":!0}),w(ro)!=="svelte-1wdozkc"&&(ro.innerHTML=Xn),Nt.forEach(s),Y.forEach(s),qo=a(e),h(mt.$$.fragment,e),Lo=a(e),x=m(e,"DIV",{class:!0});var O=V(x);h(pt.$$.fragment,O),Cs=a(O),ao=m(O,"P",{"data-svelte-h":!0}),w(ao)!=="svelte-1wygdzk"&&(ao.innerHTML=En),ks=a(O),me=m(O,"DIV",{class:!0});var Ht=V(me);h(gt.$$.fragment,Ht),Zs=a(Ht),io=m(Ht,"P",{"data-svelte-h":!0}),w(io)!=="svelte-wg5y6d"&&(io.innerHTML=qn),Ht.forEach(s),Ws=a(O),pe=m(O,"DIV",{class:!0});var Gt=V(pe);h(ht.$$.fragment,Gt),Bs=a(Gt),lo=m(Gt,"P",{"data-svelte-h":!0}),w(lo)!=="svelte-47coan"&&(lo.innerHTML=Ln),Gt.forEach(s),Rs=a(O),ge=m(O,"DIV",{class:!0});var Pt=V(ge);h(ut.$$.fragment,Pt),Fs=a(Pt),co=m(Pt,"P",{"data-svelte-h":!0}),w(co)!=="svelte-gn152u"&&(co.innerHTML=Dn),Pt.forEach(s),Ns=a(O),he=m(O,"DIV",{class:!0});var rs=V(he);h(ft.$$.fragment,rs),Hs=a(rs),mo=m(rs,"P",{"data-svelte-h":!0}),w(mo)!=="svelte-13us65f"&&(mo.innerHTML=Qn),rs.forEach(s),Gs=a(O),ue=m(O,"DIV",{class:!0});var as=V(ue);h(_t.$$.fragment,as),Ps=a(as),po=m(as,"P",{"data-svelte-h":!0}),w(po)!=="svelte-kwumbd"&&(po.innerHTML=Yn),as.forEach(s),O.forEach(s),Do=a(e),h(Tt.$$.fragment,e),Qo=a(e),z=m(e,"DIV",{class:!0});var E=V(z);h(wt.$$.fragment,E),Xs=a(E),go=m(E,"P",{"data-svelte-h":!0}),w(go)!=="svelte-1ar4eek"&&(go.innerHTML=Sn),Es=a(E),ho=m(E,"P",{"data-svelte-h":!0}),w(ho)!=="svelte-hswkmf"&&(ho.innerHTML=An),qs=a(E),R=m(E,"DIV",{class:!0});var Oe=V(R);h(bt.$$.fragment,Oe),Ls=a(Oe),uo=m(Oe,"P",{"data-svelte-h":!0}),w(uo)!=="svelte-1kiep9c"&&(uo.innerHTML=Kn),Ds=a(Oe),h(fe.$$.fragment,Oe),Qs=a(Oe),h(_e.$$.fragment,Oe),Oe.forEach(s),Ys=a(E),F=m(E,"DIV",{class:!0});var Ue=V(F);h(Mt.$$.fragment,Ue),Ss=a(Ue),fo=m(Ue,"P",{"data-svelte-h":!0}),w(fo)!=="svelte-1kiep9c"&&(fo.innerHTML=er),As=a(Ue),h(Te.$$.fragment,Ue),Ks=a(Ue),h(we.$$.fragment,Ue),Ue.forEach(s),en=a(E),N=m(E,"DIV",{class:!0});var Ie=V(N);h(yt.$$.fragment,Ie),tn=a(Ie),_o=m(Ie,"P",{"data-svelte-h":!0}),w(_o)!=="svelte-1kiep9c"&&(_o.innerHTML=tr),on=a(Ie),h(be.$$.fragment,Ie),sn=a(Ie),h(Me.$$.fragment,Ie),Ie.forEach(s),E.forEach(s),Yo=a(e),h(vt.$$.fragment,e),So=a(e),A=m(e,"DIV",{class:!0});var is=V(A);h(jt.$$.fragment,is),nn=a(is),H=m(is,"DIV",{class:!0});var Ce=V(H);h(Vt.$$.fragment,Ce),rn=a(Ce),To=m(Ce,"P",{"data-svelte-h":!0}),w(To)!=="svelte-1gq00jw"&&(To.innerHTML=or),an=a(Ce),h(ye.$$.fragment,Ce),ln=a(Ce),h(ve.$$.fragment,Ce),Ce.forEach(s),is.forEach(s),Ao=a(e),h($t.$$.fragment,e),Ko=a(e),K=m(e,"DIV",{class:!0});var ls=V(K);h(xt.$$.fragment,ls),cn=a(ls),G=m(ls,"DIV",{class:!0});var ke=V(G);h(Jt.$$.fragment,ke),dn=a(ke),wo=m(ke,"P",{"data-svelte-h":!0}),w(wo)!=="svelte-wtiv4g"&&(wo.innerHTML=sr),mn=a(ke),h(je.$$.fragment,ke),pn=a(ke),h(Ve.$$.fragment,ke),ke.forEach(s),ls.forEach(s),es=a(e),h(zt.$$.fragment,e),ts=a(e),q=m(e,"DIV",{class:!0});var yo=V(q);h(Ot.$$.fragment,yo),gn=a(yo),P=m(yo,"DIV",{class:!0});var Ze=V(P);h(Ut.$$.fragment,Ze),hn=a(Ze),bo=m(Ze,"P",{"data-svelte-h":!0}),w(bo)!=="svelte-addh08"&&(bo.innerHTML=nr),un=a(Ze),h($e.$$.fragment,Ze),fn=a(Ze),h(xe.$$.fragment,Ze),Ze.forEach(s),_n=a(yo),X=m(yo,"DIV",{class:!0});var We=V(X);h(It.$$.fragment,We),Tn=a(We),Mo=m(We,"P",{"data-svelte-h":!0}),w(Mo)!=="svelte-addh08"&&(Mo.innerHTML=rr),wn=a(We),h(Je.$$.fragment,We),bn=a(We),h(ze.$$.fragment,We),We.forEach(s),yo.forEach(s),os=a(e),h(Ct.$$.fragment,e),ss=a(e),vo=m(e,"P",{}),V(vo).forEach(s),this.h()},h(){j(o,"name","hf:doc:metadata"),j(o,"content",Or),ir(te.src,jn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/owlvit_architecture.jpg")||j(te,"src",jn),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(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(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(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(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(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(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(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(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(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(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(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(q,"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){n(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,jo,i),p(e,Be,i),p(e,Vo,i),p(e,Re,i),p(e,$o,i),p(e,Fe,i),p(e,xo,i),p(e,te,i),p(e,Jo,i),p(e,Ne,i),p(e,zo,i),p(e,He,i),p(e,Oo,i),u(Ge,e,i),p(e,Uo,i),p(e,Pe,i),p(e,Io,i),p(e,Xe,i),p(e,Co,i),u(Ee,e,i),p(e,ko,i),u(qe,e,i),p(e,Zo,i),p(e,Le,i),p(e,Wo,i),u(De,e,i),p(e,Bo,i),p(e,k,i),u(Qe,k,null),n(k,cs),n(k,Et),n(k,ds),n(k,qt),n(k,ms),n(k,oe),u(Ye,oe,null),n(oe,ps),n(oe,Lt),p(e,Ro,i),u(Se,e,i),p(e,Fo,i),p(e,Z,i),u(Ae,Z,null),n(Z,gs),n(Z,Dt),n(Z,hs),n(Z,Qt),n(Z,us),u(se,Z,null),p(e,No,i),u(Ke,e,i),p(e,Ho,i),p(e,W,i),u(et,W,null),n(W,fs),n(W,Yt),n(W,_s),n(W,St),n(W,Ts),u(ne,W,null),p(e,Go,i),u(tt,e,i),p(e,Po,i),p(e,J,i),u(ot,J,null),n(J,ws),n(J,At),n(J,bs),n(J,Kt),n(J,Ms),n(J,re),u(st,re,null),n(re,ys),n(re,eo),n(J,vs),n(J,ae),u(nt,ae,null),n(ae,js),n(ae,to),n(J,Vs),n(J,ie),u(rt,ie,null),n(ie,$s),n(ie,oo),p(e,Xo,i),u(at,e,i),p(e,Eo,i),p(e,B,i),u(it,B,null),n(B,xs),n(B,le),u(lt,le,null),n(le,Js),n(le,so),n(B,zs),n(B,ce),u(ct,ce,null),n(ce,Os),n(ce,no),n(B,Us),n(B,de),u(dt,de,null),n(de,Is),n(de,ro),p(e,qo,i),u(mt,e,i),p(e,Lo,i),p(e,x,i),u(pt,x,null),n(x,Cs),n(x,ao),n(x,ks),n(x,me),u(gt,me,null),n(me,Zs),n(me,io),n(x,Ws),n(x,pe),u(ht,pe,null),n(pe,Bs),n(pe,lo),n(x,Rs),n(x,ge),u(ut,ge,null),n(ge,Fs),n(ge,co),n(x,Ns),n(x,he),u(ft,he,null),n(he,Hs),n(he,mo),n(x,Gs),n(x,ue),u(_t,ue,null),n(ue,Ps),n(ue,po),p(e,Do,i),u(Tt,e,i),p(e,Qo,i),p(e,z,i),u(wt,z,null),n(z,Xs),n(z,go),n(z,Es),n(z,ho),n(z,qs),n(z,R),u(bt,R,null),n(R,Ls),n(R,uo),n(R,Ds),u(fe,R,null),n(R,Qs),u(_e,R,null),n(z,Ys),n(z,F),u(Mt,F,null),n(F,Ss),n(F,fo),n(F,As),u(Te,F,null),n(F,Ks),u(we,F,null),n(z,en),n(z,N),u(yt,N,null),n(N,tn),n(N,_o),n(N,on),u(be,N,null),n(N,sn),u(Me,N,null),p(e,Yo,i),u(vt,e,i),p(e,So,i),p(e,A,i),u(jt,A,null),n(A,nn),n(A,H),u(Vt,H,null),n(H,rn),n(H,To),n(H,an),u(ye,H,null),n(H,ln),u(ve,H,null),p(e,Ao,i),u($t,e,i),p(e,Ko,i),p(e,K,i),u(xt,K,null),n(K,cn),n(K,G),u(Jt,G,null),n(G,dn),n(G,wo),n(G,mn),u(je,G,null),n(G,pn),u(Ve,G,null),p(e,es,i),u(zt,e,i),p(e,ts,i),p(e,q,i),u(Ot,q,null),n(q,gn),n(q,P),u(Ut,P,null),n(P,hn),n(P,bo),n(P,un),u($e,P,null),n(P,fn),u(xe,P,null),n(q,_n),n(q,X),u(It,X,null),n(X,Tn),n(X,Mo),n(X,wn),u(Je,X,null),n(X,bn),u(ze,X,null),p(e,os,i),u(Ct,e,i),p(e,ss,i),p(e,vo,i),ns=!0},p(e,[i]){const L={};i&2&&(L.$$scope={dirty:i,ctx:e}),se.$set(L);const kt={};i&2&&(kt.$$scope={dirty:i,ctx:e}),ne.$set(kt);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 Zt={};i&2&&(Zt.$$scope={dirty:i,ctx:e}),we.$set(Zt);const Wt={};i&2&&(Wt.$$scope={dirty:i,ctx:e}),be.$set(Wt);const Bt={};i&2&&(Bt.$$scope={dirty:i,ctx:e}),Me.$set(Bt);const Y={};i&2&&(Y.$$scope={dirty:i,ctx:e}),ye.$set(Y);const Rt={};i&2&&(Rt.$$scope={dirty:i,ctx:e}),ve.$set(Rt);const Ft={};i&2&&(Ft.$$scope={dirty:i,ctx:e}),je.$set(Ft);const Nt={};i&2&&(Nt.$$scope={dirty:i,ctx:e}),Ve.$set(Nt);const O={};i&2&&(O.$$scope={dirty:i,ctx:e}),$e.$set(O);const Ht={};i&2&&(Ht.$$scope={dirty:i,ctx:e}),xe.$set(Ht);const Gt={};i&2&&(Gt.$$scope={dirty:i,ctx:e}),Je.$set(Gt);const Pt={};i&2&&(Pt.$$scope={dirty:i,ctx:e}),ze.$set(Pt)},i(e){ns||(f(M.$$.fragment,e),f(y.$$.fragment,e),f(Ge.$$.fragment,e),f(Ee.$$.fragment,e),f(qe.$$.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(rt.$$.fragment,e),f(at.$$.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($t.$$.fragment,e),f(xt.$$.fragment,e),f(Jt.$$.fragment,e),f(je.$$.fragment,e),f(Ve.$$.fragment,e),f(zt.$$.fragment,e),f(Ot.$$.fragment,e),f(Ut.$$.fragment,e),f($e.$$.fragment,e),f(xe.$$.fragment,e),f(It.$$.fragment,e),f(Je.$$.fragment,e),f(ze.$$.fragment,e),f(Ct.$$.fragment,e),ns=!0)},o(e){_(M.$$.fragment,e),_(y.$$.fragment,e),_(Ge.$$.fragment,e),_(Ee.$$.fragment,e),_(qe.$$.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),_(rt.$$.fragment,e),_(at.$$.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),_($t.$$.fragment,e),_(xt.$$.fragment,e),_(Jt.$$.fragment,e),_(je.$$.fragment,e),_(Ve.$$.fragment,e),_(zt.$$.fragment,e),_(Ot.$$.fragment,e),_(Ut.$$.fragment,e),_($e.$$.fragment,e),_(xe.$$.fragment,e),_(It.$$.fragment,e),_(Je.$$.fragment,e),_(ze.$$.fragment,e),_(Ct.$$.fragment,e),ns=!1},d(e){e&&(s(b),s(l),s(c),s(t),s(jo),s(Be),s(Vo),s(Re),s($o),s(Fe),s(xo),s(te),s(Jo),s(Ne),s(zo),s(He),s(Oo),s(Uo),s(Pe),s(Io),s(Xe),s(Co),s(ko),s(Zo),s(Le),s(Wo),s(Bo),s(k),s(Ro),s(Fo),s(Z),s(No),s(Ho),s(W),s(Go),s(Po),s(J),s(Xo),s(Eo),s(B),s(qo),s(Lo),s(x),s(Do),s(Qo),s(z),s(Yo),s(So),s(A),s(Ao),s(Ko),s(K),s(es),s(ts),s(q),s(os),s(ss),s(vo)),s(o),T(M,e),T(y,e),T(Ge,e),T(Ee,e),T(qe,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(rt),T(at,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($t,e),T(xt),T(Jt),T(je),T(Ve),T(zt,e),T(Ot),T(Ut),T($e),T(xe),T(It),T(Je),T(ze),T(Ct,e)}}}const Or='{"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 Ur(v){return lr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fr extends cr{constructor(o){super(),dr(this,o,Ur,zr,ar,{})}}export{Fr as component};
