import{S as Pm,i as Fm,s as Rm,e as s,k as p,w as T,t as i,M as Gm,c as n,d as o,m as h,a as r,x as v,h as l,b as d,G as e,g as _,y,q as M,o as V,B as j,v as Dm,L as Je}from"../../chunks/vendor-hf-doc-builder.js";import{T as No}from"../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../chunks/Docstring-hf-doc-builder.js";import{C as K}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as P}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as $e}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Am($){let c,b,g,f,w;return f=new K({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`}}),{c(){c=s("p"),b=i("Example:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function Xm($){let c,b,g,f,w;return f=new K({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`}}),{c(){c=s("p"),b=i("Example:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Example:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function qm($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function Hm($){let c,b,g,f,w;return f=new K({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>`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function Qm($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function Ym($){let c,b,g,f,w;return f=new K({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)`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function Sm($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function Lm($){let c,b,g,f,w;return f=new K({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)`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function Km($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function ep($){let c,b,g,f,w;return f=new K({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>`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function tp($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.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</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>`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function sp($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function np($){let c,b,g,f,w;return f=new K({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwT3dsVmlURm9yT2JqZWN0RGV0ZWN0aW9uJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFtb2RlbCUyMCUzRCUyME93bFZpVEZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGb3dsdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBdGV4dHMlMjAlM0QlMjAlNUIlNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlNUQlMEFpbnB1dHMlMjAlM0QlM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lNUQlMkMlMjByZXN1bHRzJTVCaSU1RCU1QiUyMnNjb3JlcyUyMiU1RCUyQyUyMHJlc3VsdHMlNUJpJTVEJTVCJTIybGFiZWxzJTIyJTVEJTBBJTBBZm9yJTIwYm94JTJDJTIwc2NvcmUlMkMlMjBsYWJlbCUyMGluJTIwemlwKGJveGVzJTJDJTIwc2NvcmVzJTJDJTIwbGFiZWxzKSUzQSUwQSUyMCUyMCUyMCUyMGJveCUyMCUzRCUyMCU1QnJvdW5kKGklMkMlMjAyKSUyMGZvciUyMGklMjBpbiUyMGJveC50b2xpc3QoKSU1RCUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJEZXRlY3RlZCUyMCU3QnRleHQlNUJsYWJlbCU1RCU3RCUyMHdpdGglMjBjb25maWRlbmNlJTIwJTdCcm91bmQoc2NvcmUuaXRlbSgpJTJDJTIwMyklN0QlMjBhdCUyMGxvY2F0aW9uJTIwJTdCYm94JTdEJTIyKQ==",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>]`}}),{c(){c=s("p"),b=i("Examples:"),g=p(),T(f.$$.fragment)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Examples:"),m.forEach(o),g=h(a),v(f.$$.fragment,a)},m(a,m){_(a,c,m),e(c,b),_(a,g,m),y(f,a,m),w=!0},p:Je,i(a){w||(M(f.$$.fragment,a),w=!0)},o(a){V(f.$$.fragment,a),w=!1},d(a){a&&o(c),a&&o(g),j(f,a)}}}function ap($){let c,b,g,f,w;return{c(){c=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s("code"),f=i("Module"),w=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(a){c=n(a,"P",{});var m=r(c);b=l(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=n(m,"CODE",{});var O=r(g);f=l(O,"Module"),O.forEach(o),w=l(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(a,m){_(a,c,m),e(c,b),e(c,g),e(g,f),e(c,w)},d(a){a&&o(c)}}}function rp($){let c,b,g,f,w;return f=new K({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMl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2JqZWN0JTIwd2l0aCUyMGNvbmZpZGVuY2UlMjAlN0Jyb3VuZChzY29yZS5pdGVtKCklMkMlMjAzKSU3RCUyMGF0JTIwbG9jYXRpb24lMjAlN0Jib3glN0QlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTForObjectDetection

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTForObjectDetection.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>query_url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000001675.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>query_image = Image.<span class="hljs-built_in">open</span>(requests.get(query_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, query_images=query_image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model.image_guided_detection(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process_image_guided_detection(
<span class="hljs-meta">... </span>    outputs=outputs, threshold=<span class="hljs-number">0.6</span>, nms_threshold=<span class="hljs-number">0.3</span>, target_sizes=target_sizes
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">0</span>  <span class="hljs-comment"># Retrieve predictions for the first image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes, scores = results[i][<span class="hljs-string">&quot;boxes&quot;</span>], results[i][<span class="hljs-string">&quot;scores&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> box, score <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(boxes, scores):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Detected similar object with confidence <span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>)
Detected similar <span class="hljs-built_in">object</span> <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.856</span> at location [<span class="hljs-number">10.94</span>, <span class="hljs-number">50.4</span>, <span class="hljs-number">315.8</span>, <span class="hljs-number">471.39</span>]
Detected similar <span class="hljs-built_in">object</span> <span class="hljs-keyword">with</span> confidence <span class="hljs-number">1.0</span> at location [<span class="hljs-number">334.84</span>, <span class="hljs-number">25.33</span>, <span class="hljs-number">636.16</span>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;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = OwlViTProcessor.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OwlViTForObjectDetection.from_pretrained(<span class="hljs-string">&quot;google/owlvit-base-patch32&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process_object_detection(outputs=outputs, target_sizes=target_sizes, threshold=<span class="hljs-number">0.1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>i = <span class="hljs-number">0</span>  <span class="hljs-comment"># Retrieve predictions for the first image for the corresponding text queries</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text = texts[i]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes, scores, labels = results[i][<span class="hljs-string">&quot;boxes&quot;</span>], results[i][<span class="hljs-string">&quot;scores&quot;</span>], results[i][<span class="hljs-string">&quot;labels&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> box, score, label <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(boxes, scores, labels):
<span class="hljs-meta">... </span>    box = [<span class="hljs-built_in">round</span>(i, <span class="hljs-number">2</span>) <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> box.tolist()]
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Detected <span class="hljs-subst">{text[label]}</span> with confidence <span class="hljs-subst">{<span class="hljs-built_in">round</span>(score.item(), <span class="hljs-number">3</span>)}</span> at location <span class="hljs-subst">{box}</span>&quot;</span>)
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.707</span> at location [<span class="hljs-number">324.97</span>, <span class="hljs-number">20.44</span>, <span class="hljs-number">640.58</span>, <span class="hljs-number">373.29</span>]
Detected a photo of a cat <span class="hljs-keyword">with</span> confidence <span class="hljs-number">0.717</span> at location [<span class="hljs-number">1.46</span>, <span class="hljs-number">55.26</span>, <span class="hljs-number">315.55</span>, <span class="hljs-number">472.17</span>]`}}),Et=new P({}),Ct=new J({props:{name:"class transformers.OwlViTConfig",anchor:"transformers.OwlViTConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"return_dict",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextConfig">OwlViTTextConfig</a>.`,name:"text_config"},{anchor:"transformers.OwlViTConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionConfig">OwlViTVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.OwlViTConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.OwlViTConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> parameter. Default is used as per the original OWL-ViT
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.OwlViTConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/configuration_owlvit.py#L251"}}),Wt=new J({props:{name:"from_text_vision_configs",anchor:"transformers.OwlViTConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": typing.Dict"},{name:"vision_config",val:": typing.Dict"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/configuration_owlvit.py#L318",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig"
>OwlViTConfig</a></p>
`}}),Nt=new P({}),Pt=new J({props:{name:"class transformers.OwlViTTextConfig",anchor:"transformers.OwlViTTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 16"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the OWL-ViT text model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel">OwlViTTextModel</a>.`,name:"vocab_size"},{anchor:"transformers.OwlViTTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.OwlViTTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.OwlViTTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.OwlViTTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.OwlViTTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.OwlViTTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.OwlViTTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.OwlViTTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.OwlViTTextConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.OwlViTTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/configuration_owlvit.py#L40"}}),Ce=new $e({props:{anchor:"transformers.OwlViTTextConfig.example",$$slots:{default:[Am]},$$scope:{ctx:$}}}),Rt=new P({}),Gt=new J({props:{name:"class transformers.OwlViTVisionConfig",anchor:"transformers.OwlViTVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 768"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.OwlViTVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.OwlViTVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.OwlViTVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.OwlViTVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.OwlViTVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.OwlViTVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.OwlViTVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.OwlViTVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.OwlViTVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.OwlViTVisionConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.OwlViTVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/configuration_owlvit.py#L146"}}),We=new $e({props:{anchor:"transformers.OwlViTVisionConfig.example",$$slots:{default:[Xm]},$$scope:{ctx:$}}}),At=new P({}),Xt=new J({props:{name:"class transformers.OwlViTImageProcessor",anchor:"transformers.OwlViTImageProcessor",parameters:[{name:"do_resize",val:" = True"},{name:"size",val:" = None"},{name:"resample",val:" = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:" = False"},{name:"crop_size",val:" = None"},{name:"do_rescale",val:" = True"},{name:"rescale_factor",val:" = 0.00392156862745098"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the shorter edge of the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.OwlViTImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 768, &#x201C;width&#x201D;: 768}):
The size to use for resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. If <code>size</code> is a
sequence like (h, w), output size will be matched to this. If <code>size</code> is an int, then image will be resized
to (size, size).`,name:"size"},{anchor:"transformers.OwlViTImageProcessor.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>PIL.Image.Resampling.BICUBIC</code>) &#x2014;
An optional resampling filter. This can be one of <code>PIL.Image.Resampling.NEAREST</code>,
<code>PIL.Image.Resampling.BOX</code>, <code>PIL.Image.Resampling.BILINEAR</code>, <code>PIL.Image.Resampling.HAMMING</code>,
<code>PIL.Image.Resampling.BICUBIC</code> or <code>PIL.Image.Resampling.LANCZOS</code>. Only has an effect if <code>do_resize</code> is set
to <code>True</code>.`,name:"resample"},{anchor:"transformers.OwlViTImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to crop the input at the center. If the input size is smaller than <code>crop_size</code> along any edge, the
image is padded with 0&#x2019;s and then center cropped.`,name:"do_center_crop"},{anchor:"transformers.OwlViTImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>int</code>, <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 768, &#x201C;width&#x201D;: 768}):
The size to use for center cropping the image. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.OwlViTImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the input by a certain factor.`,name:"do_rescale"},{anchor:"transformers.OwlViTImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
The factor to use for rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.OwlViTImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input with <code>image_mean</code> and <code>image_std</code>. Desired output size when applying
center-cropping. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"do_normalize"},{anchor:"transformers.OwlViTImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images.`,name:"image_mean"},{anchor:"transformers.OwlViTImageProcessor.image_std",description:`<strong>image_std</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L91"}}),Ht=new J({props:{name:"preprocess",anchor:"transformers.OwlViTImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Union[typing.Dict[str, int], NoneType] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
The image or batch of images to be prepared. Expects a single or batch of images with pixel values
ranging from 0 to 255. If passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether or not to resize the input. If <code>True</code>, will resize the input to the size specified by <code>size</code>.`,name:"do_resize"},{anchor:"transformers.OwlViTImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
The size to resize the input to. Only has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"size"},{anchor:"transformers.OwlViTImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
The resampling filter to use when resizing the input. Only has an effect if <code>do_resize</code> is set to
<code>True</code>.`,name:"resample"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether or not to center crop the input. If <code>True</code>, will center crop the input to the size specified by
<code>crop_size</code>.`,name:"do_center_crop"},{anchor:"transformers.OwlViTImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
The size to center crop the input to. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether or not to rescale the input. If <code>True</code>, will rescale the input by dividing it by
<code>rescale_factor</code>.`,name:"do_rescale"},{anchor:"transformers.OwlViTImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
The factor to rescale the input by. Only has an effect if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.OwlViTImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether or not to normalize the input. If <code>True</code>, will normalize the input by subtracting <code>image_mean</code>
and dividing by <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.OwlViTImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, List[float]]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
The mean to subtract from the input when normalizing. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_mean"},{anchor:"transformers.OwlViTImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>Union[float, List[float]]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
The standard deviation to divide the input by when normalizing. Only has an effect if <code>do_normalize</code> is
set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.OwlViTImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.OwlViTImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.OwlViTImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L269"}}),Qt=new J({props:{name:"post_process_object_detection",anchor:"transformers.OwlViTImageProcessor.post_process_object_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:": float = 0.1"},{name:"target_sizes",val:": typing.Union[transformers.utils.generic.TensorType, typing.List[typing.Tuple]] = None"}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Score threshold to keep object detection predictions.`,name:"threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_object_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> or <code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
Tensor of shape <code>(batch_size, 2)</code> or list of tuples (<code>Tuple[int, int]</code>) containing the target size
<code>(height, width)</code> of each image in the batch. If unset, predictions will not be resized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L458",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),St=new J({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:" = 0.0"},{name:"nms_threshold",val:" = 0.3"},{name:"target_sizes",val:" = None"}],parametersDescription:[{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTImageGuidedObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Minimum confidence threshold to use to filter out predicted boxes.`,name:"threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.nms_threshold",description:`<strong>nms_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
IoU threshold for non-maximum suppression of overlapping boxes.`,name:"nms_threshold"},{anchor:"transformers.OwlViTImageProcessor.post_process_image_guided_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Tensor of shape (batch_size, 2) where each entry is the (height, width) of the corresponding image in
the batch. If set, predicted normalized bounding boxes are rescaled to the target sizes. If left to
None, predictions will not be unnormalized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L514",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model. All labels are set to None as
<code>OwlViTForObjectDetection.image_guided_detection</code> perform one-shot object detection.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Kt=new P({}),eo=new J({props:{name:"class transformers.OwlViTFeatureExtractor",anchor:"transformers.OwlViTFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/feature_extraction_owlvit.py#L26"}}),to=new J({props:{name:"__call__",anchor:"transformers.OwlViTFeatureExtractor.__call__",parameters:[{name:"images",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils.py#L544"}}),oo=new J({props:{name:"post_process",anchor:"transformers.OwlViTFeatureExtractor.post_process",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:""}],parametersDescription:[{anchor:"transformers.OwlViTFeatureExtractor.post_process.outputs",description:`<strong>outputs</strong> (<code>OwlViTObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTFeatureExtractor.post_process.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the size (h, w) of each image of the batch. For evaluation, this must be the original
image size (before any data augmentation). For visualization, this should be the image size after data
augment, but before padding.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L412",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),no=new J({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection",parameters:[{name:"outputs",val:""},{name:"threshold",val:" = 0.0"},{name:"nms_threshold",val:" = 0.3"},{name:"target_sizes",val:" = None"}],parametersDescription:[{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.outputs",description:`<strong>outputs</strong> (<code>OwlViTImageGuidedObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Minimum confidence threshold to use to filter out predicted boxes.`,name:"threshold"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.nms_threshold",description:`<strong>nms_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
IoU threshold for non-maximum suppression of overlapping boxes.`,name:"nms_threshold"},{anchor:"transformers.OwlViTFeatureExtractor.post_process_image_guided_detection.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Tensor of shape (batch_size, 2) where each entry is the (height, width) of the corresponding image in
the batch. If set, predicted normalized bounding boxes are rescaled to the target sizes. If left to
None, predictions will not be unnormalized.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/image_processing_owlvit.py#L514",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
in the batch as predicted by the model. All labels are set to None as
<code>OwlViTForObjectDetection.image_guided_detection</code> perform one-shot object detection.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),ro=new P({}),io=new J({props:{name:"class transformers.OwlViTProcessor",anchor:"transformers.OwlViTProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OwlViTProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor">OwlViTImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.OwlViTProcessor.tokenizer",description:`<strong>tokenizer</strong> ([<code>CLIPTokenizer</code>, <code>CLIPTokenizerFast</code>]) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L29"}}),lo=new J({props:{name:"batch_decode",anchor:"transformers.OwlViTProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L196"}}),mo=new J({props:{name:"decode",anchor:"transformers.OwlViTProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L203"}}),ho=new J({props:{name:"post_process",anchor:"transformers.OwlViTProcessor.post_process",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L175"}}),go=new J({props:{name:"post_process_image_guided_detection",anchor:"transformers.OwlViTProcessor.post_process_image_guided_detection",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L189"}}),_o=new J({props:{name:"post_process_object_detection",anchor:"transformers.OwlViTProcessor.post_process_object_detection",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/processing_owlvit.py#L182"}}),bo=new P({}),To=new J({props:{name:"class transformers.OwlViTModel",anchor:"transformers.OwlViTModel",parameters:[{name:"config",val:": OwlViTConfig"}],parametersDescription:[{anchor:"transformers.OwlViTModel.This",description:`<strong>This</strong> model is a PyTorch [torch.nn.Module](https &#x2014;
//pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass. Use it`,name:"This"},{anchor:"transformers.OwlViTModel.as",description:`<strong>as</strong> a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and &#x2014;
behavior. &#x2014;
config (<a href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig">OwlViTConfig</a>): Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"as"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1038"}}),vo=new J({props:{name:"forward",anchor:"transformers.OwlViTModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_base_image_embeds",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1153",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 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>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size * num_max_text_queries, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
<li><strong>text_model_output</strong> (Tuple<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new No({props:{$$slots:{default:[qm]},$$scope:{ctx:$}}}),et=new $e({props:{anchor:"transformers.OwlViTModel.forward.example",$$slots:{default:[Hm]},$$scope:{ctx:$}}}),yo=new J({props:{name:"get_text_features",anchor:"transformers.OwlViTModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1073",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),tt=new No({props:{$$slots:{default:[Qm]},$$scope:{ctx:$}}}),ot=new $e({props:{anchor:"transformers.OwlViTModel.get_text_features.example",$$slots:{default:[Ym]},$$scope:{ctx:$}}}),Mo=new J({props:{name:"get_image_features",anchor:"transformers.OwlViTModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values.`,name:"pixel_values"},{anchor:"transformers.OwlViTModel.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.OwlViTModel.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.OwlViTModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1108",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),st=new No({props:{$$slots:{default:[Sm]},$$scope:{ctx:$}}}),nt=new $e({props:{anchor:"transformers.OwlViTModel.get_image_features.example",$$slots:{default:[Lm]},$$scope:{ctx:$}}}),Vo=new P({}),jo=new J({props:{name:"class transformers.OwlViTTextModel",anchor:"transformers.OwlViTTextModel",parameters:[{name:"config",val:": OwlViTTextConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L877"}}),$o=new J({props:{name:"forward",anchor:"transformers.OwlViTTextModel.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L892",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),rt=new No({props:{$$slots:{default:[Km]},$$scope:{ctx:$}}}),it=new $e({props:{anchor:"transformers.OwlViTTextModel.forward.example",$$slots:{default:[ep]},$$scope:{ctx:$}}}),Jo=new P({}),Oo=new J({props:{name:"class transformers.OwlViTVisionModel",anchor:"transformers.OwlViTVisionModel",parameters:[{name:"config",val:": OwlViTVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L987"}}),xo=new J({props:{name:"forward",anchor:"transformers.OwlViTVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values.`,name:"pixel_values"},{anchor:"transformers.OwlViTVisionModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.OwlViTVisionModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.OwlViTVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1000",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ct=new No({props:{$$slots:{default:[tp]},$$scope:{ctx:$}}}),dt=new $e({props:{anchor:"transformers.OwlViTVisionModel.forward.example",$$slots:{default:[op]},$$scope:{ctx:$}}}),zo=new P({}),Io=new J({props:{name:"class transformers.OwlViTForObjectDetection",anchor:"transformers.OwlViTForObjectDetection",parameters:[{name:"config",val:": OwlViTConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1320"}}),Uo=new J({props:{name:"forward",anchor:"transformers.OwlViTForObjectDetection.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"pixel_values",val:": FloatTensor"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTForObjectDetection.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values.`,name:"pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size * num_max_text_queries, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and <a href="/docs/transformers/main/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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1622",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTObjectDetectionOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> are provided)) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual image in the batch (disregarding
possible padding). You can use <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to retrieve the
unnormalized bounding boxes.</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_max_text_queries, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) \u2014 Pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>class_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>) \u2014 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>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pt=new No({props:{$$slots:{default:[sp]},$$scope:{ctx:$}}}),ht=new $e({props:{anchor:"transformers.OwlViTForObjectDetection.forward.example",$$slots:{default:[np]},$$scope:{ctx:$}}}),ko=new J({props:{name:"image_guided_detection",anchor:"transformers.OwlViTForObjectDetection.image_guided_detection",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"query_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values.`,name:"pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.query_pixel_values",description:`<strong>query_pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values of query image(s) to be detected. Pass in one query image per target image.`,name:"query_pixel_values"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py#L1527",returnDescription:`
<p>A <code>transformers.models.owlvit.modeling_owlvit.OwlViTImageGuidedObjectDetectionOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.owlvit.configuration_owlvit.OwlViTConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, num_queries)</code>) \u2014 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>) \u2014 Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual target image in the batch
(disregarding possible padding). You can use <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to
retrieve the unnormalized bounding boxes.</li>
<li><strong>query_pred_boxes</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, 4)</code>) \u2014 Normalized boxes coordinates for all queries, represented as (center_x, center_y, width, height). These
values are normalized in [0, 1], relative to the size of each individual query image in the batch
(disregarding possible padding). You can use <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"
>post_process_object_detection()</a> to
retrieve the unnormalized bounding boxes.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) \u2014 Pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>query_image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_size, patch_size, output_dim</code>) \u2014 Pooled output of <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>. OWL-ViT represents images as a set of image patches and computes
image embeddings for each patch.</li>
<li><strong>class_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_patches, hidden_size)</code>) \u2014 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>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"
>OwlViTTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"
>OwlViTVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.owlvit.modeling_owlvit.OwlViTImageGuidedObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new No({props:{$$slots:{default:[ap]},$$scope:{ctx:$}}}),gt=new $e({props:{anchor:"transformers.OwlViTForObjectDetection.image_guided_detection.example",$$slots:{default:[rp]},$$scope:{ctx:$}}}),{c(){c=s("meta"),b=p(),g=s("h1"),f=s("a"),w=s("span"),T(a.$$.fragment),m=p(),O=s("span"),Qa=i("OWL-ViT"),Wn=p(),ee=s("h2"),Oe=s("a"),Fs=s("span"),T(Ot.$$.fragment),Ya=p(),Rs=s("span"),Sa=i("Overview"),Bn=p(),xe=s("p"),La=i("The OWL-ViT (short for Vision Transformer for Open-World Localization) was proposed in "),xt=s("a"),Ka=i("Simple Open-Vocabulary Object Detection with Vision Transformers"),er=i(" 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."),Nn=p(),Po=s("p"),tr=i("The abstract from the paper is the following:"),Pn=p(),Fo=s("p"),Gs=s("em"),or=i("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."),Fn=p(),te=s("h2"),ze=s("a"),Ds=s("span"),T(zt.$$.fragment),sr=p(),As=s("span"),nr=i("Usage"),Rn=p(),Ie=s("p"),ar=i("OWL-ViT is a zero-shot text-conditioned object detection model. OWL-ViT uses "),Ro=s("a"),rr=i("CLIP"),ir=i(" 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."),Gn=p(),x=s("p"),Go=s("a"),lr=i("OwlViTImageProcessor"),cr=i(" can be used to resize (or rescale) and normalize images for the model and "),Do=s("a"),dr=i("CLIPTokenizer"),mr=i(" is used to encode the text. "),Ao=s("a"),pr=i("OwlViTProcessor"),hr=i(" wraps "),Xo=s("a"),fr=i("OwlViTImageProcessor"),gr=i(" and "),qo=s("a"),ur=i("CLIPTokenizer"),_r=i(" into a single instance to both encode the text and prepare the images. The following example shows how to perform object detection using "),Ho=s("a"),wr=i("OwlViTProcessor"),br=i(" and "),Qo=s("a"),Tr=i("OwlViTForObjectDetection"),vr=i("."),Dn=p(),T(It.$$.fragment),An=p(),S=s("p"),yr=i("This model was contributed by "),Ut=s("a"),Mr=i("adirik"),Vr=i(". The original code can be found "),kt=s("a"),jr=i("here"),$r=i("."),Xn=p(),oe=s("h2"),Ue=s("a"),Xs=s("span"),T(Et.$$.fragment),Jr=p(),qs=s("span"),Or=i("OwlViTConfig"),qn=p(),C=s("div"),T(Ct.$$.fragment),xr=p(),L=s("p"),Yo=s("a"),zr=i("OwlViTConfig"),Ir=i(" is the configuration class to store the configuration of an "),So=s("a"),Ur=i("OwlViTModel"),kr=i(`. 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
`),Zt=s("a"),Er=i("google/owlvit-base-patch32"),Cr=i(" architecture."),Zr=p(),se=s("p"),Wr=i("Configuration objects inherit from "),Lo=s("a"),Br=i("PretrainedConfig"),Nr=i(` and can be used to control the model outputs. Read the
documentation from `),Ko=s("a"),Pr=i("PretrainedConfig"),Fr=i(" for more information."),Rr=p(),ke=s("div"),T(Wt.$$.fragment),Gr=p(),Bt=s("p"),Dr=i("Instantiate a "),es=s("a"),Ar=i("OwlViTConfig"),Xr=i(` (or a derived class) from owlvit text model configuration and owlvit vision
model configuration.`),Hn=p(),ne=s("h2"),Ee=s("a"),Hs=s("span"),T(Nt.$$.fragment),qr=p(),Qs=s("span"),Hr=i("OwlViTTextConfig"),Qn=p(),Z=s("div"),T(Pt.$$.fragment),Qr=p(),ae=s("p"),Yr=i("This is the configuration class to store the configuration of an "),ts=s("a"),Sr=i("OwlViTTextModel"),Lr=i(`. 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
`),Ft=s("a"),Kr=i("google/owlvit-base-patch32"),ei=i(" architecture."),ti=p(),re=s("p"),oi=i("Configuration objects inherit from "),os=s("a"),si=i("PretrainedConfig"),ni=i(` and can be used to control the model outputs. Read the
documentation from `),ss=s("a"),ai=i("PretrainedConfig"),ri=i(" for more information."),ii=p(),T(Ce.$$.fragment),Yn=p(),ie=s("h2"),Ze=s("a"),Ys=s("span"),T(Rt.$$.fragment),li=p(),Ss=s("span"),ci=i("OwlViTVisionConfig"),Sn=p(),W=s("div"),T(Gt.$$.fragment),di=p(),le=s("p"),mi=i("This is the configuration class to store the configuration of an "),ns=s("a"),pi=i("OwlViTVisionModel"),hi=i(`. 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
`),Dt=s("a"),fi=i("google/owlvit-base-patch32"),gi=i(" architecture."),ui=p(),ce=s("p"),_i=i("Configuration objects inherit from "),as=s("a"),wi=i("PretrainedConfig"),bi=i(` and can be used to control the model outputs. Read the
documentation from `),rs=s("a"),Ti=i("PretrainedConfig"),vi=i(" for more information."),yi=p(),T(We.$$.fragment),Ln=p(),de=s("h2"),Be=s("a"),Ls=s("span"),T(At.$$.fragment),Mi=p(),Ks=s("span"),Vi=i("OwlViTImageProcessor"),Kn=p(),I=s("div"),T(Xt.$$.fragment),ji=p(),en=s("p"),$i=i("Constructs an OWL-ViT image processor."),Ji=p(),qt=s("p"),Oi=i("This image processor inherits from "),is=s("a"),xi=i("ImageProcessingMixin"),zi=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ii=p(),Ne=s("div"),T(Ht.$$.fragment),Ui=p(),tn=s("p"),ki=i("Prepares an image or batch of images for the model."),Ei=p(),Pe=s("div"),T(Qt.$$.fragment),Ci=p(),Yt=s("p"),Zi=i("Converts the raw output of "),ls=s("a"),Wi=i("OwlViTForObjectDetection"),Bi=i(` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`),Ni=p(),Fe=s("div"),T(St.$$.fragment),Pi=p(),Lt=s("p"),Fi=i("Converts the output of "),cs=s("a"),Ri=i("OwlViTForObjectDetection.image_guided_detection()"),Gi=i(` into the format expected by the COCO
api.`),ea=p(),me=s("h2"),Re=s("a"),on=s("span"),T(Kt.$$.fragment),Di=p(),sn=s("span"),Ai=i("OwlViTFeatureExtractor"),ta=p(),B=s("div"),T(eo.$$.fragment),Xi=p(),Ge=s("div"),T(to.$$.fragment),qi=p(),nn=s("p"),Hi=i("Preprocess an image or a batch of images."),Qi=p(),De=s("div"),T(oo.$$.fragment),Yi=p(),so=s("p"),Si=i("Converts the raw output of "),ds=s("a"),Li=i("OwlViTForObjectDetection"),Ki=i(` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`),el=p(),Ae=s("div"),T(no.$$.fragment),tl=p(),ao=s("p"),ol=i("Converts the output of "),ms=s("a"),sl=i("OwlViTForObjectDetection.image_guided_detection()"),nl=i(` into the format expected by the COCO
api.`),oa=p(),pe=s("h2"),Xe=s("a"),an=s("span"),T(ro.$$.fragment),al=p(),rn=s("span"),rl=i("OwlViTProcessor"),sa=p(),z=s("div"),T(io.$$.fragment),il=p(),U=s("p"),ll=i("Constructs an OWL-ViT processor which wraps "),ps=s("a"),cl=i("OwlViTImageProcessor"),dl=i(" and "),hs=s("a"),ml=i("CLIPTokenizer"),pl=i("/"),fs=s("a"),hl=i("CLIPTokenizerFast"),fl=i(`
into a single processor that interits both the image processor and tokenizer functionalities. See the
`),ln=s("code"),gl=i("__call__()"),ul=i(" and "),gs=s("a"),_l=i("decode()"),wl=i(" for more information."),bl=p(),qe=s("div"),T(lo.$$.fragment),Tl=p(),co=s("p"),vl=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),us=s("a"),yl=i("batch_decode()"),Ml=i(`. Please
refer to the docstring of this method for more information.`),Vl=p(),He=s("div"),T(mo.$$.fragment),jl=p(),po=s("p"),$l=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),_s=s("a"),Jl=i("decode()"),Ol=i(`. Please refer to
the docstring of this method for more information.`),xl=p(),Qe=s("div"),T(ho.$$.fragment),zl=p(),fo=s("p"),Il=i("This method forwards all its arguments to "),ws=s("a"),Ul=i("OwlViTImageProcessor.post_process()"),kl=i(`. Please refer to the docstring
of this method for more information.`),El=p(),Ye=s("div"),T(go.$$.fragment),Cl=p(),uo=s("p"),Zl=i("This method forwards all its arguments to "),cn=s("code"),Wl=i("OwlViTImageProcessor.post_process_one_shot_object_detection"),Bl=i(`.
Please refer to the docstring of this method for more information.`),Nl=p(),Se=s("div"),T(_o.$$.fragment),Pl=p(),wo=s("p"),Fl=i("This method forwards all its arguments to "),bs=s("a"),Rl=i("OwlViTImageProcessor.post_process_object_detection()"),Gl=i(`. Please refer
to the docstring of this method for more information.`),na=p(),he=s("h2"),Le=s("a"),dn=s("span"),T(bo.$$.fragment),Dl=p(),mn=s("span"),Al=i("OwlViTModel"),aa=p(),N=s("div"),T(To.$$.fragment),Xl=p(),F=s("div"),T(vo.$$.fragment),ql=p(),fe=s("p"),Hl=i("The "),Ts=s("a"),Ql=i("OwlViTModel"),Yl=i(" forward method, overrides the "),pn=s("code"),Sl=i("__call__"),Ll=i(" special method."),Kl=p(),T(Ke.$$.fragment),ec=p(),T(et.$$.fragment),tc=p(),R=s("div"),T(yo.$$.fragment),oc=p(),ge=s("p"),sc=i("The "),vs=s("a"),nc=i("OwlViTModel"),ac=i(" forward method, overrides the "),hn=s("code"),rc=i("__call__"),ic=i(" special method."),lc=p(),T(tt.$$.fragment),cc=p(),T(ot.$$.fragment),dc=p(),G=s("div"),T(Mo.$$.fragment),mc=p(),ue=s("p"),pc=i("The "),ys=s("a"),hc=i("OwlViTModel"),fc=i(" forward method, overrides the "),fn=s("code"),gc=i("__call__"),uc=i(" special method."),_c=p(),T(st.$$.fragment),wc=p(),T(nt.$$.fragment),ra=p(),_e=s("h2"),at=s("a"),gn=s("span"),T(Vo.$$.fragment),bc=p(),un=s("span"),Tc=i("OwlViTTextModel"),ia=p(),we=s("div"),T(jo.$$.fragment),vc=p(),D=s("div"),T($o.$$.fragment),yc=p(),be=s("p"),Mc=i("The "),Ms=s("a"),Vc=i("OwlViTTextModel"),jc=i(" forward method, overrides the "),_n=s("code"),$c=i("__call__"),Jc=i(" special method."),Oc=p(),T(rt.$$.fragment),xc=p(),T(it.$$.fragment),la=p(),Te=s("h2"),lt=s("a"),wn=s("span"),T(Jo.$$.fragment),zc=p(),bn=s("span"),Ic=i("OwlViTVisionModel"),ca=p(),ve=s("div"),T(Oo.$$.fragment),Uc=p(),A=s("div"),T(xo.$$.fragment),kc=p(),ye=s("p"),Ec=i("The "),Vs=s("a"),Cc=i("OwlViTVisionModel"),Zc=i(" forward method, overrides the "),Tn=s("code"),Wc=i("__call__"),Bc=i(" special method."),Nc=p(),T(ct.$$.fragment),Pc=p(),T(dt.$$.fragment),da=p(),Me=s("h2"),mt=s("a"),vn=s("span"),T(zo.$$.fragment),Fc=p(),yn=s("span"),Rc=i("OwlViTForObjectDetection"),ma=p(),Y=s("div"),T(Io.$$.fragment),Gc=p(),X=s("div"),T(Uo.$$.fragment),Dc=p(),Ve=s("p"),Ac=i("The "),js=s("a"),Xc=i("OwlViTForObjectDetection"),qc=i(" forward method, overrides the "),Mn=s("code"),Hc=i("__call__"),Qc=i(" special method."),Yc=p(),T(pt.$$.fragment),Sc=p(),T(ht.$$.fragment),Lc=p(),q=s("div"),T(ko.$$.fragment),Kc=p(),je=s("p"),ed=i("The "),$s=s("a"),td=i("OwlViTForObjectDetection"),od=i(" forward method, overrides the "),Vn=s("code"),sd=i("__call__"),nd=i(" special method."),ad=p(),T(ft.$$.fragment),rd=p(),T(gt.$$.fragment),this.h()},l(t){const u=Gm('[data-svelte="svelte-1phssyn"]',document.head);c=n(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),g=n(t,"H1",{class:!0});var Eo=r(g);f=n(Eo,"A",{id:!0,class:!0,href:!0});var jn=r(f);w=n(jn,"SPAN",{});var $n=r(w);v(a.$$.fragment,$n),$n.forEach(o),jn.forEach(o),m=h(Eo),O=n(Eo,"SPAN",{});var Jn=r(O);Qa=l(Jn,"OWL-ViT"),Jn.forEach(o),Eo.forEach(o),Wn=h(t),ee=n(t,"H2",{class:!0});var Co=r(ee);Oe=n(Co,"A",{id:!0,class:!0,href:!0});var On=r(Oe);Fs=n(On,"SPAN",{});var xn=r(Fs);v(Ot.$$.fragment,xn),xn.forEach(o),On.forEach(o),Ya=h(Co),Rs=n(Co,"SPAN",{});var zn=r(Rs);Sa=l(zn,"Overview"),zn.forEach(o),Co.forEach(o),Bn=h(t),xe=n(t,"P",{});var Zo=r(xe);La=l(Zo,"The OWL-ViT (short for Vision Transformer for Open-World Localization) was proposed in "),xt=n(Zo,"A",{href:!0,rel:!0});var In=r(xt);Ka=l(In,"Simple Open-Vocabulary Object Detection with Vision Transformers"),In.forEach(o),er=l(Zo," 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."),Zo.forEach(o),Nn=h(t),Po=n(t,"P",{});var Un=r(Po);tr=l(Un,"The abstract from the paper is the following:"),Un.forEach(o),Pn=h(t),Fo=n(t,"P",{});var kn=r(Fo);Gs=n(kn,"EM",{});var En=r(Gs);or=l(En,"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."),En.forEach(o),kn.forEach(o),Fn=h(t),te=n(t,"H2",{class:!0});var Wo=r(te);ze=n(Wo,"A",{id:!0,class:!0,href:!0});var Cn=r(ze);Ds=n(Cn,"SPAN",{});var Zn=r(Ds);v(zt.$$.fragment,Zn),Zn.forEach(o),Cn.forEach(o),sr=h(Wo),As=n(Wo,"SPAN",{});var id=r(As);nr=l(id,"Usage"),id.forEach(o),Wo.forEach(o),Rn=h(t),Ie=n(t,"P",{});var ha=r(Ie);ar=l(ha,"OWL-ViT is a zero-shot text-conditioned object detection model. OWL-ViT uses "),Ro=n(ha,"A",{href:!0});var ld=r(Ro);rr=l(ld,"CLIP"),ld.forEach(o),ir=l(ha," 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."),ha.forEach(o),Gn=h(t),x=n(t,"P",{});var k=r(x);Go=n(k,"A",{href:!0});var cd=r(Go);lr=l(cd,"OwlViTImageProcessor"),cd.forEach(o),cr=l(k," can be used to resize (or rescale) and normalize images for the model and "),Do=n(k,"A",{href:!0});var dd=r(Do);dr=l(dd,"CLIPTokenizer"),dd.forEach(o),mr=l(k," is used to encode the text. "),Ao=n(k,"A",{href:!0});var md=r(Ao);pr=l(md,"OwlViTProcessor"),md.forEach(o),hr=l(k," wraps "),Xo=n(k,"A",{href:!0});var pd=r(Xo);fr=l(pd,"OwlViTImageProcessor"),pd.forEach(o),gr=l(k," and "),qo=n(k,"A",{href:!0});var hd=r(qo);ur=l(hd,"CLIPTokenizer"),hd.forEach(o),_r=l(k," into a single instance to both encode the text and prepare the images. The following example shows how to perform object detection using "),Ho=n(k,"A",{href:!0});var fd=r(Ho);wr=l(fd,"OwlViTProcessor"),fd.forEach(o),br=l(k," and "),Qo=n(k,"A",{href:!0});var gd=r(Qo);Tr=l(gd,"OwlViTForObjectDetection"),gd.forEach(o),vr=l(k,"."),k.forEach(o),Dn=h(t),v(It.$$.fragment,t),An=h(t),S=n(t,"P",{});var Js=r(S);yr=l(Js,"This model was contributed by "),Ut=n(Js,"A",{href:!0,rel:!0});var ud=r(Ut);Mr=l(ud,"adirik"),ud.forEach(o),Vr=l(Js,". The original code can be found "),kt=n(Js,"A",{href:!0,rel:!0});var _d=r(kt);jr=l(_d,"here"),_d.forEach(o),$r=l(Js,"."),Js.forEach(o),Xn=h(t),oe=n(t,"H2",{class:!0});var fa=r(oe);Ue=n(fa,"A",{id:!0,class:!0,href:!0});var wd=r(Ue);Xs=n(wd,"SPAN",{});var bd=r(Xs);v(Et.$$.fragment,bd),bd.forEach(o),wd.forEach(o),Jr=h(fa),qs=n(fa,"SPAN",{});var Td=r(qs);Or=l(Td,"OwlViTConfig"),Td.forEach(o),fa.forEach(o),qn=h(t),C=n(t,"DIV",{class:!0});var ut=r(C);v(Ct.$$.fragment,ut),xr=h(ut),L=n(ut,"P",{});var Bo=r(L);Yo=n(Bo,"A",{href:!0});var vd=r(Yo);zr=l(vd,"OwlViTConfig"),vd.forEach(o),Ir=l(Bo," is the configuration class to store the configuration of an "),So=n(Bo,"A",{href:!0});var yd=r(So);Ur=l(yd,"OwlViTModel"),yd.forEach(o),kr=l(Bo,`. 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
`),Zt=n(Bo,"A",{href:!0,rel:!0});var Md=r(Zt);Er=l(Md,"google/owlvit-base-patch32"),Md.forEach(o),Cr=l(Bo," architecture."),Bo.forEach(o),Zr=h(ut),se=n(ut,"P",{});var Os=r(se);Wr=l(Os,"Configuration objects inherit from "),Lo=n(Os,"A",{href:!0});var Vd=r(Lo);Br=l(Vd,"PretrainedConfig"),Vd.forEach(o),Nr=l(Os,` and can be used to control the model outputs. Read the
documentation from `),Ko=n(Os,"A",{href:!0});var jd=r(Ko);Pr=l(jd,"PretrainedConfig"),jd.forEach(o),Fr=l(Os," for more information."),Os.forEach(o),Rr=h(ut),ke=n(ut,"DIV",{class:!0});var ga=r(ke);v(Wt.$$.fragment,ga),Gr=h(ga),Bt=n(ga,"P",{});var ua=r(Bt);Dr=l(ua,"Instantiate a "),es=n(ua,"A",{href:!0});var $d=r(es);Ar=l($d,"OwlViTConfig"),$d.forEach(o),Xr=l(ua,` (or a derived class) from owlvit text model configuration and owlvit vision
model configuration.`),ua.forEach(o),ga.forEach(o),ut.forEach(o),Hn=h(t),ne=n(t,"H2",{class:!0});var _a=r(ne);Ee=n(_a,"A",{id:!0,class:!0,href:!0});var Jd=r(Ee);Hs=n(Jd,"SPAN",{});var Od=r(Hs);v(Nt.$$.fragment,Od),Od.forEach(o),Jd.forEach(o),qr=h(_a),Qs=n(_a,"SPAN",{});var xd=r(Qs);Hr=l(xd,"OwlViTTextConfig"),xd.forEach(o),_a.forEach(o),Qn=h(t),Z=n(t,"DIV",{class:!0});var _t=r(Z);v(Pt.$$.fragment,_t),Qr=h(_t),ae=n(_t,"P",{});var xs=r(ae);Yr=l(xs,"This is the configuration class to store the configuration of an "),ts=n(xs,"A",{href:!0});var zd=r(ts);Sr=l(zd,"OwlViTTextModel"),zd.forEach(o),Lr=l(xs,`. 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
`),Ft=n(xs,"A",{href:!0,rel:!0});var Id=r(Ft);Kr=l(Id,"google/owlvit-base-patch32"),Id.forEach(o),ei=l(xs," architecture."),xs.forEach(o),ti=h(_t),re=n(_t,"P",{});var zs=r(re);oi=l(zs,"Configuration objects inherit from "),os=n(zs,"A",{href:!0});var Ud=r(os);si=l(Ud,"PretrainedConfig"),Ud.forEach(o),ni=l(zs,` and can be used to control the model outputs. Read the
documentation from `),ss=n(zs,"A",{href:!0});var kd=r(ss);ai=l(kd,"PretrainedConfig"),kd.forEach(o),ri=l(zs," for more information."),zs.forEach(o),ii=h(_t),v(Ce.$$.fragment,_t),_t.forEach(o),Yn=h(t),ie=n(t,"H2",{class:!0});var wa=r(ie);Ze=n(wa,"A",{id:!0,class:!0,href:!0});var Ed=r(Ze);Ys=n(Ed,"SPAN",{});var Cd=r(Ys);v(Rt.$$.fragment,Cd),Cd.forEach(o),Ed.forEach(o),li=h(wa),Ss=n(wa,"SPAN",{});var Zd=r(Ss);ci=l(Zd,"OwlViTVisionConfig"),Zd.forEach(o),wa.forEach(o),Sn=h(t),W=n(t,"DIV",{class:!0});var wt=r(W);v(Gt.$$.fragment,wt),di=h(wt),le=n(wt,"P",{});var Is=r(le);mi=l(Is,"This is the configuration class to store the configuration of an "),ns=n(Is,"A",{href:!0});var Wd=r(ns);pi=l(Wd,"OwlViTVisionModel"),Wd.forEach(o),hi=l(Is,`. 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
`),Dt=n(Is,"A",{href:!0,rel:!0});var Bd=r(Dt);fi=l(Bd,"google/owlvit-base-patch32"),Bd.forEach(o),gi=l(Is," architecture."),Is.forEach(o),ui=h(wt),ce=n(wt,"P",{});var Us=r(ce);_i=l(Us,"Configuration objects inherit from "),as=n(Us,"A",{href:!0});var Nd=r(as);wi=l(Nd,"PretrainedConfig"),Nd.forEach(o),bi=l(Us,` and can be used to control the model outputs. Read the
documentation from `),rs=n(Us,"A",{href:!0});var Pd=r(rs);Ti=l(Pd,"PretrainedConfig"),Pd.forEach(o),vi=l(Us," for more information."),Us.forEach(o),yi=h(wt),v(We.$$.fragment,wt),wt.forEach(o),Ln=h(t),de=n(t,"H2",{class:!0});var ba=r(de);Be=n(ba,"A",{id:!0,class:!0,href:!0});var Fd=r(Be);Ls=n(Fd,"SPAN",{});var Rd=r(Ls);v(At.$$.fragment,Rd),Rd.forEach(o),Fd.forEach(o),Mi=h(ba),Ks=n(ba,"SPAN",{});var Gd=r(Ks);Vi=l(Gd,"OwlViTImageProcessor"),Gd.forEach(o),ba.forEach(o),Kn=h(t),I=n(t,"DIV",{class:!0});var H=r(I);v(Xt.$$.fragment,H),ji=h(H),en=n(H,"P",{});var Dd=r(en);$i=l(Dd,"Constructs an OWL-ViT image processor."),Dd.forEach(o),Ji=h(H),qt=n(H,"P",{});var Ta=r(qt);Oi=l(Ta,"This image processor inherits from "),is=n(Ta,"A",{href:!0});var Ad=r(is);xi=l(Ad,"ImageProcessingMixin"),Ad.forEach(o),zi=l(Ta,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Ta.forEach(o),Ii=h(H),Ne=n(H,"DIV",{class:!0});var va=r(Ne);v(Ht.$$.fragment,va),Ui=h(va),tn=n(va,"P",{});var Xd=r(tn);ki=l(Xd,"Prepares an image or batch of images for the model."),Xd.forEach(o),va.forEach(o),Ei=h(H),Pe=n(H,"DIV",{class:!0});var ya=r(Pe);v(Qt.$$.fragment,ya),Ci=h(ya),Yt=n(ya,"P",{});var Ma=r(Yt);Zi=l(Ma,"Converts the raw output of "),ls=n(Ma,"A",{href:!0});var qd=r(ls);Wi=l(qd,"OwlViTForObjectDetection"),qd.forEach(o),Bi=l(Ma,` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`),Ma.forEach(o),ya.forEach(o),Ni=h(H),Fe=n(H,"DIV",{class:!0});var Va=r(Fe);v(St.$$.fragment,Va),Pi=h(Va),Lt=n(Va,"P",{});var ja=r(Lt);Fi=l(ja,"Converts the output of "),cs=n(ja,"A",{href:!0});var Hd=r(cs);Ri=l(Hd,"OwlViTForObjectDetection.image_guided_detection()"),Hd.forEach(o),Gi=l(ja,` into the format expected by the COCO
api.`),ja.forEach(o),Va.forEach(o),H.forEach(o),ea=h(t),me=n(t,"H2",{class:!0});var $a=r(me);Re=n($a,"A",{id:!0,class:!0,href:!0});var Qd=r(Re);on=n(Qd,"SPAN",{});var Yd=r(on);v(Kt.$$.fragment,Yd),Yd.forEach(o),Qd.forEach(o),Di=h($a),sn=n($a,"SPAN",{});var Sd=r(sn);Ai=l(Sd,"OwlViTFeatureExtractor"),Sd.forEach(o),$a.forEach(o),ta=h(t),B=n(t,"DIV",{class:!0});var bt=r(B);v(eo.$$.fragment,bt),Xi=h(bt),Ge=n(bt,"DIV",{class:!0});var Ja=r(Ge);v(to.$$.fragment,Ja),qi=h(Ja),nn=n(Ja,"P",{});var Ld=r(nn);Hi=l(Ld,"Preprocess an image or a batch of images."),Ld.forEach(o),Ja.forEach(o),Qi=h(bt),De=n(bt,"DIV",{class:!0});var Oa=r(De);v(oo.$$.fragment,Oa),Yi=h(Oa),so=n(Oa,"P",{});var xa=r(so);Si=l(xa,"Converts the raw output of "),ds=n(xa,"A",{href:!0});var Kd=r(ds);Li=l(Kd,"OwlViTForObjectDetection"),Kd.forEach(o),Ki=l(xa,` into final bounding boxes in (top_left_x, top_left_y,
bottom_right_x, bottom_right_y) format.`),xa.forEach(o),Oa.forEach(o),el=h(bt),Ae=n(bt,"DIV",{class:!0});var za=r(Ae);v(no.$$.fragment,za),tl=h(za),ao=n(za,"P",{});var Ia=r(ao);ol=l(Ia,"Converts the output of "),ms=n(Ia,"A",{href:!0});var em=r(ms);sl=l(em,"OwlViTForObjectDetection.image_guided_detection()"),em.forEach(o),nl=l(Ia,` into the format expected by the COCO
api.`),Ia.forEach(o),za.forEach(o),bt.forEach(o),oa=h(t),pe=n(t,"H2",{class:!0});var Ua=r(pe);Xe=n(Ua,"A",{id:!0,class:!0,href:!0});var tm=r(Xe);an=n(tm,"SPAN",{});var om=r(an);v(ro.$$.fragment,om),om.forEach(o),tm.forEach(o),al=h(Ua),rn=n(Ua,"SPAN",{});var sm=r(rn);rl=l(sm,"OwlViTProcessor"),sm.forEach(o),Ua.forEach(o),sa=h(t),z=n(t,"DIV",{class:!0});var E=r(z);v(io.$$.fragment,E),il=h(E),U=n(E,"P",{});var Q=r(U);ll=l(Q,"Constructs an OWL-ViT processor which wraps "),ps=n(Q,"A",{href:!0});var nm=r(ps);cl=l(nm,"OwlViTImageProcessor"),nm.forEach(o),dl=l(Q," and "),hs=n(Q,"A",{href:!0});var am=r(hs);ml=l(am,"CLIPTokenizer"),am.forEach(o),pl=l(Q,"/"),fs=n(Q,"A",{href:!0});var rm=r(fs);hl=l(rm,"CLIPTokenizerFast"),rm.forEach(o),fl=l(Q,`
into a single processor that interits both the image processor and tokenizer functionalities. See the
`),ln=n(Q,"CODE",{});var im=r(ln);gl=l(im,"__call__()"),im.forEach(o),ul=l(Q," and "),gs=n(Q,"A",{href:!0});var lm=r(gs);_l=l(lm,"decode()"),lm.forEach(o),wl=l(Q," for more information."),Q.forEach(o),bl=h(E),qe=n(E,"DIV",{class:!0});var ka=r(qe);v(lo.$$.fragment,ka),Tl=h(ka),co=n(ka,"P",{});var Ea=r(co);vl=l(Ea,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),us=n(Ea,"A",{href:!0});var cm=r(us);yl=l(cm,"batch_decode()"),cm.forEach(o),Ml=l(Ea,`. Please
refer to the docstring of this method for more information.`),Ea.forEach(o),ka.forEach(o),Vl=h(E),He=n(E,"DIV",{class:!0});var Ca=r(He);v(mo.$$.fragment,Ca),jl=h(Ca),po=n(Ca,"P",{});var Za=r(po);$l=l(Za,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),_s=n(Za,"A",{href:!0});var dm=r(_s);Jl=l(dm,"decode()"),dm.forEach(o),Ol=l(Za,`. Please refer to
the docstring of this method for more information.`),Za.forEach(o),Ca.forEach(o),xl=h(E),Qe=n(E,"DIV",{class:!0});var Wa=r(Qe);v(ho.$$.fragment,Wa),zl=h(Wa),fo=n(Wa,"P",{});var Ba=r(fo);Il=l(Ba,"This method forwards all its arguments to "),ws=n(Ba,"A",{href:!0});var mm=r(ws);Ul=l(mm,"OwlViTImageProcessor.post_process()"),mm.forEach(o),kl=l(Ba,`. Please refer to the docstring
of this method for more information.`),Ba.forEach(o),Wa.forEach(o),El=h(E),Ye=n(E,"DIV",{class:!0});var Na=r(Ye);v(go.$$.fragment,Na),Cl=h(Na),uo=n(Na,"P",{});var Pa=r(uo);Zl=l(Pa,"This method forwards all its arguments to "),cn=n(Pa,"CODE",{});var pm=r(cn);Wl=l(pm,"OwlViTImageProcessor.post_process_one_shot_object_detection"),pm.forEach(o),Bl=l(Pa,`.
Please refer to the docstring of this method for more information.`),Pa.forEach(o),Na.forEach(o),Nl=h(E),Se=n(E,"DIV",{class:!0});var Fa=r(Se);v(_o.$$.fragment,Fa),Pl=h(Fa),wo=n(Fa,"P",{});var Ra=r(wo);Fl=l(Ra,"This method forwards all its arguments to "),bs=n(Ra,"A",{href:!0});var hm=r(bs);Rl=l(hm,"OwlViTImageProcessor.post_process_object_detection()"),hm.forEach(o),Gl=l(Ra,`. Please refer
to the docstring of this method for more information.`),Ra.forEach(o),Fa.forEach(o),E.forEach(o),na=h(t),he=n(t,"H2",{class:!0});var Ga=r(he);Le=n(Ga,"A",{id:!0,class:!0,href:!0});var fm=r(Le);dn=n(fm,"SPAN",{});var gm=r(dn);v(bo.$$.fragment,gm),gm.forEach(o),fm.forEach(o),Dl=h(Ga),mn=n(Ga,"SPAN",{});var um=r(mn);Al=l(um,"OwlViTModel"),um.forEach(o),Ga.forEach(o),aa=h(t),N=n(t,"DIV",{class:!0});var Tt=r(N);v(To.$$.fragment,Tt),Xl=h(Tt),F=n(Tt,"DIV",{class:!0});var vt=r(F);v(vo.$$.fragment,vt),ql=h(vt),fe=n(vt,"P",{});var ks=r(fe);Hl=l(ks,"The "),Ts=n(ks,"A",{href:!0});var _m=r(Ts);Ql=l(_m,"OwlViTModel"),_m.forEach(o),Yl=l(ks," forward method, overrides the "),pn=n(ks,"CODE",{});var wm=r(pn);Sl=l(wm,"__call__"),wm.forEach(o),Ll=l(ks," special method."),ks.forEach(o),Kl=h(vt),v(Ke.$$.fragment,vt),ec=h(vt),v(et.$$.fragment,vt),vt.forEach(o),tc=h(Tt),R=n(Tt,"DIV",{class:!0});var yt=r(R);v(yo.$$.fragment,yt),oc=h(yt),ge=n(yt,"P",{});var Es=r(ge);sc=l(Es,"The "),vs=n(Es,"A",{href:!0});var bm=r(vs);nc=l(bm,"OwlViTModel"),bm.forEach(o),ac=l(Es," forward method, overrides the "),hn=n(Es,"CODE",{});var Tm=r(hn);rc=l(Tm,"__call__"),Tm.forEach(o),ic=l(Es," special method."),Es.forEach(o),lc=h(yt),v(tt.$$.fragment,yt),cc=h(yt),v(ot.$$.fragment,yt),yt.forEach(o),dc=h(Tt),G=n(Tt,"DIV",{class:!0});var Mt=r(G);v(Mo.$$.fragment,Mt),mc=h(Mt),ue=n(Mt,"P",{});var Cs=r(ue);pc=l(Cs,"The "),ys=n(Cs,"A",{href:!0});var vm=r(ys);hc=l(vm,"OwlViTModel"),vm.forEach(o),fc=l(Cs," forward method, overrides the "),fn=n(Cs,"CODE",{});var ym=r(fn);gc=l(ym,"__call__"),ym.forEach(o),uc=l(Cs," special method."),Cs.forEach(o),_c=h(Mt),v(st.$$.fragment,Mt),wc=h(Mt),v(nt.$$.fragment,Mt),Mt.forEach(o),Tt.forEach(o),ra=h(t),_e=n(t,"H2",{class:!0});var Da=r(_e);at=n(Da,"A",{id:!0,class:!0,href:!0});var Mm=r(at);gn=n(Mm,"SPAN",{});var Vm=r(gn);v(Vo.$$.fragment,Vm),Vm.forEach(o),Mm.forEach(o),bc=h(Da),un=n(Da,"SPAN",{});var jm=r(un);Tc=l(jm,"OwlViTTextModel"),jm.forEach(o),Da.forEach(o),ia=h(t),we=n(t,"DIV",{class:!0});var Aa=r(we);v(jo.$$.fragment,Aa),vc=h(Aa),D=n(Aa,"DIV",{class:!0});var Vt=r(D);v($o.$$.fragment,Vt),yc=h(Vt),be=n(Vt,"P",{});var Zs=r(be);Mc=l(Zs,"The "),Ms=n(Zs,"A",{href:!0});var $m=r(Ms);Vc=l($m,"OwlViTTextModel"),$m.forEach(o),jc=l(Zs," forward method, overrides the "),_n=n(Zs,"CODE",{});var Jm=r(_n);$c=l(Jm,"__call__"),Jm.forEach(o),Jc=l(Zs," special method."),Zs.forEach(o),Oc=h(Vt),v(rt.$$.fragment,Vt),xc=h(Vt),v(it.$$.fragment,Vt),Vt.forEach(o),Aa.forEach(o),la=h(t),Te=n(t,"H2",{class:!0});var Xa=r(Te);lt=n(Xa,"A",{id:!0,class:!0,href:!0});var Om=r(lt);wn=n(Om,"SPAN",{});var xm=r(wn);v(Jo.$$.fragment,xm),xm.forEach(o),Om.forEach(o),zc=h(Xa),bn=n(Xa,"SPAN",{});var zm=r(bn);Ic=l(zm,"OwlViTVisionModel"),zm.forEach(o),Xa.forEach(o),ca=h(t),ve=n(t,"DIV",{class:!0});var qa=r(ve);v(Oo.$$.fragment,qa),Uc=h(qa),A=n(qa,"DIV",{class:!0});var jt=r(A);v(xo.$$.fragment,jt),kc=h(jt),ye=n(jt,"P",{});var Ws=r(ye);Ec=l(Ws,"The "),Vs=n(Ws,"A",{href:!0});var Im=r(Vs);Cc=l(Im,"OwlViTVisionModel"),Im.forEach(o),Zc=l(Ws," forward method, overrides the "),Tn=n(Ws,"CODE",{});var Um=r(Tn);Wc=l(Um,"__call__"),Um.forEach(o),Bc=l(Ws," special method."),Ws.forEach(o),Nc=h(jt),v(ct.$$.fragment,jt),Pc=h(jt),v(dt.$$.fragment,jt),jt.forEach(o),qa.forEach(o),da=h(t),Me=n(t,"H2",{class:!0});var Ha=r(Me);mt=n(Ha,"A",{id:!0,class:!0,href:!0});var km=r(mt);vn=n(km,"SPAN",{});var Em=r(vn);v(zo.$$.fragment,Em),Em.forEach(o),km.forEach(o),Fc=h(Ha),yn=n(Ha,"SPAN",{});var Cm=r(yn);Rc=l(Cm,"OwlViTForObjectDetection"),Cm.forEach(o),Ha.forEach(o),ma=h(t),Y=n(t,"DIV",{class:!0});var Bs=r(Y);v(Io.$$.fragment,Bs),Gc=h(Bs),X=n(Bs,"DIV",{class:!0});var $t=r(X);v(Uo.$$.fragment,$t),Dc=h($t),Ve=n($t,"P",{});var Ns=r(Ve);Ac=l(Ns,"The "),js=n(Ns,"A",{href:!0});var Zm=r(js);Xc=l(Zm,"OwlViTForObjectDetection"),Zm.forEach(o),qc=l(Ns," forward method, overrides the "),Mn=n(Ns,"CODE",{});var Wm=r(Mn);Hc=l(Wm,"__call__"),Wm.forEach(o),Qc=l(Ns," special method."),Ns.forEach(o),Yc=h($t),v(pt.$$.fragment,$t),Sc=h($t),v(ht.$$.fragment,$t),$t.forEach(o),Lc=h(Bs),q=n(Bs,"DIV",{class:!0});var Jt=r(q);v(ko.$$.fragment,Jt),Kc=h(Jt),je=n(Jt,"P",{});var Ps=r(je);ed=l(Ps,"The "),$s=n(Ps,"A",{href:!0});var Bm=r($s);td=l(Bm,"OwlViTForObjectDetection"),Bm.forEach(o),od=l(Ps," forward method, overrides the "),Vn=n(Ps,"CODE",{});var Nm=r(Vn);sd=l(Nm,"__call__"),Nm.forEach(o),nd=l(Ps," special method."),Ps.forEach(o),ad=h(Jt),v(ft.$$.fragment,Jt),rd=h(Jt),v(gt.$$.fragment,Jt),Jt.forEach(o),Bs.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(lp)),d(f,"id","owlvit"),d(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(f,"href","#owlvit"),d(g,"class","relative group"),d(Oe,"id","overview"),d(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Oe,"href","#overview"),d(ee,"class","relative group"),d(xt,"href","https://arxiv.org/abs/2205.06230"),d(xt,"rel","nofollow"),d(ze,"id","usage"),d(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ze,"href","#usage"),d(te,"class","relative group"),d(Ro,"href","clip"),d(Go,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor"),d(Do,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),d(Ao,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTProcessor"),d(Xo,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor"),d(qo,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),d(Ho,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTProcessor"),d(Qo,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection"),d(Ut,"href","https://huggingface.co/adirik"),d(Ut,"rel","nofollow"),d(kt,"href","https://github.com/google-research/scenic/tree/main/scenic/projects/owl_vit"),d(kt,"rel","nofollow"),d(Ue,"id","transformers.OwlViTConfig"),d(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ue,"href","#transformers.OwlViTConfig"),d(oe,"class","relative group"),d(Yo,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig"),d(So,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel"),d(Zt,"href","https://huggingface.co/google/owlvit-base-patch32"),d(Zt,"rel","nofollow"),d(Lo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Ko,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(es,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTConfig"),d(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"id","transformers.OwlViTTextConfig"),d(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ee,"href","#transformers.OwlViTTextConfig"),d(ne,"class","relative group"),d(ts,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"),d(Ft,"href","https://huggingface.co/google/owlvit-base-patch32"),d(Ft,"rel","nofollow"),d(os,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(ss,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ze,"id","transformers.OwlViTVisionConfig"),d(Ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ze,"href","#transformers.OwlViTVisionConfig"),d(ie,"class","relative group"),d(ns,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"),d(Dt,"href","https://huggingface.co/google/owlvit-base-patch32"),d(Dt,"rel","nofollow"),d(as,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(rs,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Be,"id","transformers.OwlViTImageProcessor"),d(Be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Be,"href","#transformers.OwlViTImageProcessor"),d(de,"class","relative group"),d(is,"href","/docs/transformers/main/en/internal/image_processing_utils#transformers.ImageProcessingMixin"),d(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ls,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection"),d(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(cs,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection"),d(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.OwlViTFeatureExtractor"),d(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Re,"href","#transformers.OwlViTFeatureExtractor"),d(me,"class","relative group"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ds,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection"),d(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ms,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection.image_guided_detection"),d(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Xe,"id","transformers.OwlViTProcessor"),d(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Xe,"href","#transformers.OwlViTProcessor"),d(pe,"class","relative group"),d(ps,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor"),d(hs,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),d(fs,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast"),d(gs,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTProcessor.decode"),d(us,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),d(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(_s,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),d(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ws,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTFeatureExtractor.post_process"),d(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(bs,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTImageProcessor.post_process_object_detection"),d(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"id","transformers.OwlViTModel"),d(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Le,"href","#transformers.OwlViTModel"),d(he,"class","relative group"),d(Ts,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(vs,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel"),d(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ys,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTModel"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(at,"id","transformers.OwlViTTextModel"),d(at,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(at,"href","#transformers.OwlViTTextModel"),d(_e,"class","relative group"),d(Ms,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTTextModel"),d(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(lt,"id","transformers.OwlViTVisionModel"),d(lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(lt,"href","#transformers.OwlViTVisionModel"),d(Te,"class","relative group"),d(Vs,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTVisionModel"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(mt,"id","transformers.OwlViTForObjectDetection"),d(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(mt,"href","#transformers.OwlViTForObjectDetection"),d(Me,"class","relative group"),d(js,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($s,"href","/docs/transformers/main/en/model_doc/owlvit#transformers.OwlViTForObjectDetection"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,c),_(t,b,u),_(t,g,u),e(g,f),e(f,w),y(a,w,null),e(g,m),e(g,O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,u),y(Pt,Z,null),e(Z,Qr),e(Z,ae),e(ae,Yr),e(ae,ts),e(ts,Sr),e(ae,Lr),e(ae,Ft),e(Ft,Kr),e(ae,ei),e(Z,ti),e(Z,re),e(re,oi),e(re,os),e(os,si),e(re,ni),e(re,ss),e(ss,ai),e(re,ri),e(Z,ii),y(Ce,Z,null),_(t,Yn,u),_(t,ie,u),e(ie,Ze),e(Ze,Ys),y(Rt,Ys,null),e(ie,li),e(ie,Ss),e(Ss,ci),_(t,Sn,u),_(t,W,u),y(Gt,W,null),e(W,di),e(W,le),e(le,mi),e(le,ns),e(ns,pi),e(le,hi),e(le,Dt),e(Dt,fi),e(le,gi),e(W,ui),e(W,ce),e(ce,_i),e(ce,as),e(as,wi),e(ce,bi),e(ce,rs),e(rs,Ti),e(ce,vi),e(W,yi),y(We,W,null),_(t,Ln,u),_(t,de,u),e(de,Be),e(Be,Ls),y(At,Ls,null),e(de,Mi),e(de,Ks),e(Ks,Vi),_(t,Kn,u),_(t,I,u),y(Xt,I,null),e(I,ji),e(I,en),e(en,$i),e(I,Ji),e(I,qt),e(qt,Oi),e(qt,is),e(is,xi),e(qt,zi),e(I,Ii),e(I,Ne),y(Ht,Ne,null),e(Ne,Ui),e(Ne,tn),e(tn,ki),e(I,Ei),e(I,Pe),y(Qt,Pe,null),e(Pe,Ci),e(Pe,Yt),e(Yt,Zi),e(Yt,ls),e(ls,Wi),e(Yt,Bi),e(I,Ni),e(I,Fe),y(St,Fe,null),e(Fe,Pi),e(Fe,Lt),e(Lt,Fi),e(Lt,cs),e(cs,Ri),e(Lt,Gi),_(t,ea,u),_(t,me,u),e(me,Re),e(Re,on),y(Kt,on,null),e(me,Di),e(me,sn),e(sn,Ai),_(t,ta,u),_(t,B,u),y(eo,B,null),e(B,Xi),e(B,Ge),y(to,Ge,null),e(Ge,qi),e(Ge,nn),e(nn,Hi),e(B,Qi),e(B,De),y(oo,De,null),e(De,Yi),e(De,so),e(so,Si),e(so,ds),e(ds,Li),e(so,Ki),e(B,el),e(B,Ae),y(no,Ae,null),e(Ae,tl),e(Ae,ao),e(ao,ol),e(ao,ms),e(ms,sl),e(ao,nl),_(t,oa,u),_(t,pe,u),e(pe,Xe),e(Xe,an),y(ro,an,null),e(pe,al),e(pe,rn),e(rn,rl),_(t,sa,u),_(t,z,u),y(io,z,null),e(z,il),e(z,U),e(U,ll),e(U,ps),e(ps,cl),e(U,dl),e(U,hs),e(hs,ml),e(U,pl),e(U,fs),e(fs,hl),e(U,fl),e(U,ln),e(ln,gl),e(U,ul),e(U,gs),e(gs,_l),e(U,wl),e(z,bl),e(z,qe),y(lo,qe,null),e(qe,Tl),e(qe,co),e(co,vl),e(co,us),e(us,yl),e(co,Ml),e(z,Vl),e(z,He),y(mo,He,null),e(He,jl),e(He,po),e(po,$l),e(po,_s),e(_s,Jl),e(po,Ol),e(z,xl),e(z,Qe),y(ho,Qe,null),e(Qe,zl),e(Qe,fo),e(fo,Il),e(fo,ws),e(ws,Ul),e(fo,kl),e(z,El),e(z,Ye),y(go,Ye,null),e(Ye,Cl),e(Ye,uo),e(uo,Zl),e(uo,cn),e(cn,Wl),e(uo,Bl),e(z,Nl),e(z,Se),y(_o,Se,null),e(Se,Pl),e(Se,wo),e(wo,Fl),e(wo,bs),e(bs,Rl),e(wo,Gl),_(t,na,u),_(t,he,u),e(he,Le),e(Le,dn),y(bo,dn,null),e(he,Dl),e(he,mn),e(mn,Al),_(t,aa,u),_(t,N,u),y(To,N,null),e(N,Xl),e(N,F),y(vo,F,null),e(F,ql),e(F,fe),e(fe,Hl),e(fe,Ts),e(Ts,Ql),e(fe,Yl),e(fe,pn),e(pn,Sl),e(fe,Ll),e(F,Kl),y(Ke,F,null),e(F,ec),y(et,F,null),e(N,tc),e(N,R),y(yo,R,null),e(R,oc),e(R,ge),e(ge,sc),e(ge,vs),e(vs,nc),e(ge,ac),e(ge,hn),e(hn,rc),e(ge,ic),e(R,lc),y(tt,R,null),e(R,cc),y(ot,R,null),e(N,dc),e(N,G),y(Mo,G,null),e(G,mc),e(G,ue),e(ue,pc),e(ue,ys),e(ys,hc),e(ue,fc),e(ue,fn),e(fn,gc),e(ue,uc),e(G,_c),y(st,G,null),e(G,wc),y(nt,G,null),_(t,ra,u),_(t,_e,u),e(_e,at),e(at,gn),y(Vo,gn,null),e(_e,bc),e(_e,un),e(un,Tc),_(t,ia,u),_(t,we,u),y(jo,we,null),e(we,vc),e(we,D),y($o,D,null),e(D,yc),e(D,be),e(be,Mc),e(be,Ms),e(Ms,Vc),e(be,jc),e(be,_n),e(_n,$c),e(be,Jc),e(D,Oc),y(rt,D,null),e(D,xc),y(it,D,null),_(t,la,u),_(t,Te,u),e(Te,lt),e(lt,wn),y(Jo,wn,null),e(Te,zc),e(Te,bn),e(bn,Ic),_(t,ca,u),_(t,ve,u),y(Oo,ve,null),e(ve,Uc),e(ve,A),y(xo,A,null),e(A,kc),e(A,ye),e(ye,Ec),e(ye,Vs),e(Vs,Cc),e(ye,Zc),e(ye,Tn),e(Tn,Wc),e(ye,Bc),e(A,Nc),y(ct,A,null),e(A,Pc),y(dt,A,null),_(t,da,u),_(t,Me,u),e(Me,mt),e(mt,vn),y(zo,vn,null),e(Me,Fc),e(Me,yn),e(yn,Rc),_(t,ma,u),_(t,Y,u),y(Io,Y,null),e(Y,Gc),e(Y,X),y(Uo,X,null),e(X,Dc),e(X,Ve),e(Ve,Ac),e(Ve,js),e(js,Xc),e(Ve,qc),e(Ve,Mn),e(Mn,Hc),e(Ve,Qc),e(X,Yc),y(pt,X,null),e(X,Sc),y(ht,X,null),e(Y,Lc),e(Y,q),y(ko,q,null),e(q,Kc),e(q,je),e(je,ed),e(je,$s),e($s,td),e(je,od),e(je,Vn),e(Vn,sd),e(je,nd),e(q,ad),y(ft,q,null),e(q,rd),y(gt,q,null),pa=!0},p(t,[u]){const Eo={};u&2&&(Eo.$$scope={dirty:u,ctx:t}),Ce.$set(Eo);const jn={};u&2&&(jn.$$scope={dirty:u,ctx:t}),We.$set(jn);const $n={};u&2&&($n.$$scope={dirty:u,ctx:t}),Ke.$set($n);const Jn={};u&2&&(Jn.$$scope={dirty:u,ctx:t}),et.$set(Jn);const Co={};u&2&&(Co.$$scope={dirty:u,ctx:t}),tt.$set(Co);const On={};u&2&&(On.$$scope={dirty:u,ctx:t}),ot.$set(On);const xn={};u&2&&(xn.$$scope={dirty:u,ctx:t}),st.$set(xn);const zn={};u&2&&(zn.$$scope={dirty:u,ctx:t}),nt.$set(zn);const Zo={};u&2&&(Zo.$$scope={dirty:u,ctx:t}),rt.$set(Zo);const In={};u&2&&(In.$$scope={dirty:u,ctx:t}),it.$set(In);const Un={};u&2&&(Un.$$scope={dirty:u,ctx:t}),ct.$set(Un);const kn={};u&2&&(kn.$$scope={dirty:u,ctx:t}),dt.$set(kn);const En={};u&2&&(En.$$scope={dirty:u,ctx:t}),pt.$set(En);const Wo={};u&2&&(Wo.$$scope={dirty:u,ctx:t}),ht.$set(Wo);const Cn={};u&2&&(Cn.$$scope={dirty:u,ctx:t}),ft.$set(Cn);const Zn={};u&2&&(Zn.$$scope={dirty:u,ctx:t}),gt.$set(Zn)},i(t){pa||(M(a.$$.fragment,t),M(Ot.$$.fragment,t),M(zt.$$.fragment,t),M(It.$$.fragment,t),M(Et.$$.fragment,t),M(Ct.$$.fragment,t),M(Wt.$$.fragment,t),M(Nt.$$.fragment,t),M(Pt.$$.fragment,t),M(Ce.$$.fragment,t),M(Rt.$$.fragment,t),M(Gt.$$.fragment,t),M(We.$$.fragment,t),M(At.$$.fragment,t),M(Xt.$$.fragment,t),M(Ht.$$.fragment,t),M(Qt.$$.fragment,t),M(St.$$.fragment,t),M(Kt.$$.fragment,t),M(eo.$$.fragment,t),M(to.$$.fragment,t),M(oo.$$.fragment,t),M(no.$$.fragment,t),M(ro.$$.fragment,t),M(io.$$.fragment,t),M(lo.$$.fragment,t),M(mo.$$.fragment,t),M(ho.$$.fragment,t),M(go.$$.fragment,t),M(_o.$$.fragment,t),M(bo.$$.fragment,t),M(To.$$.fragment,t),M(vo.$$.fragment,t),M(Ke.$$.fragment,t),M(et.$$.fragment,t),M(yo.$$.fragment,t),M(tt.$$.fragment,t),M(ot.$$.fragment,t),M(Mo.$$.fragment,t),M(st.$$.fragment,t),M(nt.$$.fragment,t),M(Vo.$$.fragment,t),M(jo.$$.fragment,t),M($o.$$.fragment,t),M(rt.$$.fragment,t),M(it.$$.fragment,t),M(Jo.$$.fragment,t),M(Oo.$$.fragment,t),M(xo.$$.fragment,t),M(ct.$$.fragment,t),M(dt.$$.fragment,t),M(zo.$$.fragment,t),M(Io.$$.fragment,t),M(Uo.$$.fragment,t),M(pt.$$.fragment,t),M(ht.$$.fragment,t),M(ko.$$.fragment,t),M(ft.$$.fragment,t),M(gt.$$.fragment,t),pa=!0)},o(t){V(a.$$.fragment,t),V(Ot.$$.fragment,t),V(zt.$$.fragment,t),V(It.$$.fragment,t),V(Et.$$.fragment,t),V(Ct.$$.fragment,t),V(Wt.$$.fragment,t),V(Nt.$$.fragment,t),V(Pt.$$.fragment,t),V(Ce.$$.fragment,t),V(Rt.$$.fragment,t),V(Gt.$$.fragment,t),V(We.$$.fragment,t),V(At.$$.fragment,t),V(Xt.$$.fragment,t),V(Ht.$$.fragment,t),V(Qt.$$.fragment,t),V(St.$$.fragment,t),V(Kt.$$.fragment,t),V(eo.$$.fragment,t),V(to.$$.fragment,t),V(oo.$$.fragment,t),V(no.$$.fragment,t),V(ro.$$.fragment,t),V(io.$$.fragment,t),V(lo.$$.fragment,t),V(mo.$$.fragment,t),V(ho.$$.fragment,t),V(go.$$.fragment,t),V(_o.$$.fragment,t),V(bo.$$.fragment,t),V(To.$$.fragment,t),V(vo.$$.fragment,t),V(Ke.$$.fragment,t),V(et.$$.fragment,t),V(yo.$$.fragment,t),V(tt.$$.fragment,t),V(ot.$$.fragment,t),V(Mo.$$.fragment,t),V(st.$$.fragment,t),V(nt.$$.fragment,t),V(Vo.$$.fragment,t),V(jo.$$.fragment,t),V($o.$$.fragment,t),V(rt.$$.fragment,t),V(it.$$.fragment,t),V(Jo.$$.fragment,t),V(Oo.$$.fragment,t),V(xo.$$.fragment,t),V(ct.$$.fragment,t),V(dt.$$.fragment,t),V(zo.$$.fragment,t),V(Io.$$.fragment,t),V(Uo.$$.fragment,t),V(pt.$$.fragment,t),V(ht.$$.fragment,t),V(ko.$$.fragment,t),V(ft.$$.fragment,t),V(gt.$$.fragment,t),pa=!1},d(t){o(c),t&&o(b),t&&o(g),j(a),t&&o(Wn),t&&o(ee),j(Ot),t&&o(Bn),t&&o(xe),t&&o(Nn),t&&o(Po),t&&o(Pn),t&&o(Fo),t&&o(Fn),t&&o(te),j(zt),t&&o(Rn),t&&o(Ie),t&&o(Gn),t&&o(x),t&&o(Dn),j(It,t),t&&o(An),t&&o(S),t&&o(Xn),t&&o(oe),j(Et),t&&o(qn),t&&o(C),j(Ct),j(Wt),t&&o(Hn),t&&o(ne),j(Nt),t&&o(Qn),t&&o(Z),j(Pt),j(Ce),t&&o(Yn),t&&o(ie),j(Rt),t&&o(Sn),t&&o(W),j(Gt),j(We),t&&o(Ln),t&&o(de),j(At),t&&o(Kn),t&&o(I),j(Xt),j(Ht),j(Qt),j(St),t&&o(ea),t&&o(me),j(Kt),t&&o(ta),t&&o(B),j(eo),j(to),j(oo),j(no),t&&o(oa),t&&o(pe),j(ro),t&&o(sa),t&&o(z),j(io),j(lo),j(mo),j(ho),j(go),j(_o),t&&o(na),t&&o(he),j(bo),t&&o(aa),t&&o(N),j(To),j(vo),j(Ke),j(et),j(yo),j(tt),j(ot),j(Mo),j(st),j(nt),t&&o(ra),t&&o(_e),j(Vo),t&&o(ia),t&&o(we),j(jo),j($o),j(rt),j(it),t&&o(la),t&&o(Te),j(Jo),t&&o(ca),t&&o(ve),j(Oo),j(xo),j(ct),j(dt),t&&o(da),t&&o(Me),j(zo),t&&o(ma),t&&o(Y),j(Io),j(Uo),j(pt),j(ht),j(ko),j(ft),j(gt)}}}const lp={local:"owlvit",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"transformers.OwlViTConfig",title:"OwlViTConfig"},{local:"transformers.OwlViTTextConfig",title:"OwlViTTextConfig"},{local:"transformers.OwlViTVisionConfig",title:"OwlViTVisionConfig"},{local:"transformers.OwlViTImageProcessor",title:"OwlViTImageProcessor"},{local:"transformers.OwlViTFeatureExtractor",title:"OwlViTFeatureExtractor"},{local:"transformers.OwlViTProcessor",title:"OwlViTProcessor"},{local:"transformers.OwlViTModel",title:"OwlViTModel"},{local:"transformers.OwlViTTextModel",title:"OwlViTTextModel"},{local:"transformers.OwlViTVisionModel",title:"OwlViTVisionModel"},{local:"transformers.OwlViTForObjectDetection",title:"OwlViTForObjectDetection"}],title:"OWL-ViT"};function cp($){return Dm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class up extends Pm{constructor(c){super();Fm(this,c,cp,ip,Rm,{})}}export{up as default,lp as metadata};
