import{S as Np,i as Wp,s as Sp,e as s,k as m,w as b,t as i,M as Rp,c as r,d as o,m as h,a,x as T,h as l,b as d,G as e,g as _,y as $,q as O,o as x,B as V,v as Bp,L as ye}from"../../chunks/vendor-hf-doc-builder.js";import{T as Lo}from"../../chunks/Tip-hf-doc-builder.js";import{D as y}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Q}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as N}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as je}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Up(j){let c,v,g,f,w;return f=new Q({props:{code:`from transformers import OwlViTTextConfig, OwlViTTextModel

# Initializing a OwlViTTextModel with google/owlvit-base-patch32 style configuration
configuration = OwlViTTextConfig()

# Initializing a OwlViTTextConfig from the google/owlvit-base-patch32 style configuration
model = OwlViTTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,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"),v=i("Example:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Example:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function Hp(j){let c,v,g,f,w;return f=new Q({props:{code:`from transformers import OwlViTVisionConfig, OwlViTVisionModel

# Initializing a OwlViTVisionModel with google/owlvit-base-patch32 style configuration
configuration = OwlViTVisionConfig()

# Initializing a OwlViTVisionModel model from the google/owlvit-base-patch32 style configuration
model = OwlViTVisionModel(configuration)

# Accessing the model configuration
configuration = model.config`,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"),v=i("Example:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Example:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function Gp(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function Xp(j){let c,v,g,f,w;return f=new Q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, OwlViTModel

model = OwlViTModel.from_pretrained("google/owlvit-base-patch32")
processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(text=[["a photo of a cat", "a photo of a dog"]], images=image, return_tensors="pt")
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities`,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"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function Yp(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function Zp(j){let c,v,g,f,w;return f=new Q({props:{code:`from transformers import AutoProcessor, OwlViTModel

model = OwlViTModel.from_pretrained("google/owlvit-base-patch32")
processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
inputs = processor(
    text=[["a photo of a cat", "a photo of a dog"], ["photo of a astranaut"]], return_tensors="pt"
)
text_features = model.get_text_features(**inputs)`,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"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function Jp(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function Kp(j){let c,v,g,f,w;return f=new Q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, OwlViTModel

model = OwlViTModel.from_pretrained("google/owlvit-base-patch32")
processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(images=image, return_tensors="pt")
image_features = model.get_image_features(**inputs)`,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"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function Qp(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function em(j){let c,v,g,f,w;return f=new Q({props:{code:`from transformers import AutoProcessor, OwlViTTextModel

model = OwlViTTextModel.from_pretrained("google/owlvit-base-patch32")
processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
inputs = processor(
    text=[["a photo of a cat", "a photo of a dog"], ["photo of a astranaut"]], return_tensors="pt"
)
outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states`,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"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function tm(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function om(j){let c,v,g,f,w;return f=new Q({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, OwlViTVisionModel

model = OwlViTVisionModel.from_pretrained("google/owlvit-base-patch32")
processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(images=image, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled CLS states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, OwlViTVisionModel

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

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

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

processor = AutoProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
texts = [["a photo of a cat", "a photo of a dog"]]
inputs = processor(text=texts, images=image, return_tensors="pt")
outputs = model(**inputs)

# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
target_sizes = torch.Tensor([image.size[::-1]])
# Convert outputs (bounding boxes and class logits) to final bounding boxes and scores
results = processor.post_process_object_detection(
    outputs=outputs, threshold=0.1, target_sizes=target_sizes
)

i = 0  # Retrieve predictions for the first image for the corresponding text queries
text = texts[i]
boxes, scores, labels = results[i]["boxes"], results[i]["scores"], results[i]["labels"]

for box, score, label in zip(boxes, scores, labels):
    box = [round(i, 2) for i in box.tolist()]
    print(f"Detected {text[label]} with confidence {round(score.item(), 3)} at location {box}")`,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"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function nm(j){let c,v,g,f,w;return{c(){c=s("p"),v=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(n){c=r(n,"P",{});var p=a(c);v=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r(p,"CODE",{});var z=a(g);f=l(z,"Module"),z.forEach(o),w=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){_(n,c,p),e(c,v),e(c,g),e(g,f),e(c,w)},d(n){n&&o(c)}}}function am(j){let c,v,g,f,w;return f=new Q({props:{code:`import requests
from PIL import Image
import torch
from transformers import AutoProcessor, OwlViTForObjectDetection

processor = AutoProcessor.from_pretrained("google/owlvit-base-patch16")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch16")
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
query_url = "http://images.cocodataset.org/val2017/000000001675.jpg"
query_image = Image.open(requests.get(query_url, stream=True).raw)
inputs = processor(images=image, query_images=query_image, return_tensors="pt")
with torch.no_grad():
    outputs = model.image_guided_detection(**inputs)
# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
target_sizes = torch.Tensor([image.size[::-1]])
# Convert outputs (bounding boxes and class logits) to COCO API
results = processor.post_process_image_guided_detection(
    outputs=outputs, threshold=0.6, nms_threshold=0.3, target_sizes=target_sizes
)
i = 0  # Retrieve predictions for the first image
boxes, scores = results[i]["boxes"], results[i]["scores"]
for box, score in zip(boxes, scores):
    box = [round(i, 2) for i in box.tolist()]
    print(f"Detected similar object with confidence {round(score.item(), 3)} at location {box}")`,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.782</span> at location [-<span class="hljs-number">0.06</span>, -<span class="hljs-number">1.52</span>, <span class="hljs-number">637.96</span>, <span class="hljs-number">271.16</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">39.64</span>, <span class="hljs-number">71.61</span>, <span class="hljs-number">176.21</span>, <span class="hljs-number">117.15</span>]`}}),{c(){c=s("p"),v=i("Examples:"),g=m(),b(f.$$.fragment)},l(n){c=r(n,"P",{});var p=a(c);v=l(p,"Examples:"),p.forEach(o),g=h(n),T(f.$$.fragment,n)},m(n,p){_(n,c,p),e(c,v),_(n,g,p),$(f,n,p),w=!0},p:ye,i(n){w||(O(f.$$.fragment,n),w=!0)},o(n){x(f.$$.fragment,n),w=!1},d(n){n&&o(c),n&&o(g),V(f,n)}}}function im(j){let c,v,g,f,w,n,p,z,Yn,Dr,ee,ze,Ws,zt,Zn,Ss,Jn,Ar,ke,Kn,kt,Qn,ea,Fr,No,ta,Lr,Wo,Rs,oa,Nr,te,Pe,Bs,Pt,sa,Us,ra,Wr,Ee,na,So,aa,ia,Sr,k,Ro,la,ca,Bo,da,pa,Uo,ma,ha,Ho,fa,ga,Go,ua,_a,Xo,wa,va,Yo,ba,Ta,Rr,Et,Br,J,$a,It,Oa,xa,qt,Va,ja,Ur,oe,Ie,Hs,Ct,ya,Gs,za,Hr,M,Mt,ka,K,Zo,Pa,Ea,Jo,Ia,qa,Dt,Ca,Ma,Da,se,Aa,Ko,Fa,La,Qo,Na,Wa,Sa,qe,At,Ra,Ft,Ba,es,Ua,Ha,Gr,re,Ce,Xs,Lt,Ga,Ys,Xa,Xr,D,Nt,Ya,ne,Za,ts,Ja,Ka,Wt,Qa,ei,ti,ae,oi,os,si,ri,ss,ni,ai,ii,Me,Yr,ie,De,Zs,St,li,Js,ci,Zr,A,Rt,di,le,pi,rs,mi,hi,Bt,fi,gi,ui,ce,_i,ns,wi,vi,as,bi,Ti,$i,Ae,Jr,de,Fe,Ks,Ut,Oi,Qs,xi,Kr,E,Ht,Vi,er,ji,yi,Gt,zi,is,ki,Pi,Ei,Le,Xt,Ii,tr,qi,Ci,Ne,Yt,Mi,Zt,Di,ls,Ai,Fi,Li,We,Jt,Ni,Kt,Wi,cs,Si,Ri,Qr,pe,Se,or,Qt,Bi,sr,Ui,en,F,eo,Hi,Re,to,Gi,rr,Xi,Yi,Be,oo,Zi,so,Ji,ds,Ki,Qi,el,Ue,ro,tl,no,ol,ps,sl,rl,tn,me,He,nr,ao,nl,ar,al,on,P,io,il,I,ll,ms,cl,dl,hs,pl,ml,fs,hl,fl,ir,gl,ul,gs,_l,wl,vl,Ge,lo,bl,co,Tl,us,$l,Ol,xl,Xe,po,Vl,mo,jl,_s,yl,zl,kl,Ye,ho,Pl,fo,El,ws,Il,ql,Cl,Ze,go,Ml,uo,Dl,lr,Al,Fl,Ll,Je,_o,Nl,wo,Wl,vs,Sl,Rl,sn,he,Ke,cr,vo,Bl,dr,Ul,rn,L,bo,Hl,W,To,Gl,fe,Xl,bs,Yl,Zl,pr,Jl,Kl,Ql,Qe,ec,et,tc,S,$o,oc,ge,sc,Ts,rc,nc,mr,ac,ic,lc,tt,cc,ot,dc,R,Oo,pc,ue,mc,$s,hc,fc,hr,gc,uc,_c,st,wc,rt,nn,_e,nt,fr,xo,vc,gr,bc,an,we,Vo,Tc,B,jo,$c,ve,Oc,Os,xc,Vc,ur,jc,yc,zc,at,kc,it,ln,be,lt,_r,yo,Pc,wr,Ec,cn,Te,zo,Ic,U,ko,qc,$e,Cc,xs,Mc,Dc,vr,Ac,Fc,Lc,ct,Nc,dt,dn,Oe,pt,br,Po,Wc,Tr,Sc,pn,Z,Eo,Rc,H,Io,Bc,xe,Uc,Vs,Hc,Gc,$r,Xc,Yc,Zc,mt,Jc,ht,Kc,G,qo,Qc,Ve,ed,js,td,od,Or,sd,rd,nd,ft,ad,gt,mn;return n=new N({}),zt=new N({}),Pt=new N({}),Et=new Q({props:{code:`import requests
from PIL import Image
import torch

from transformers import OwlViTProcessor, OwlViTForObjectDetection

processor = OwlViTProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
texts = [["a photo of a cat", "a photo of a dog"]]
inputs = processor(text=texts, images=image, return_tensors="pt")
outputs = model(**inputs)

# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
target_sizes = torch.Tensor([image.size[::-1]])
# Convert outputs (bounding boxes and class logits) to COCO API
results = processor.post_process(outputs=outputs, target_sizes=target_sizes)

i = 0  # Retrieve predictions for the first image for the corresponding text queries
text = texts[i]
boxes, scores, labels = results[i]["boxes"], results[i]["scores"], results[i]["labels"]

score_threshold = 0.1
for box, score, label in zip(boxes, scores, labels):
    box = [round(i, 2) for i in box.tolist()]
    if score >= score_threshold:
        print(f"Detected {text[label]} with confidence {round(score.item(), 3)} at location {box}")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Target image sizes (height, width) to rescale box predictions [batch_size, 2]</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_sizes = torch.Tensor([image.size[::-<span class="hljs-number">1</span>]])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Convert outputs (bounding boxes and class logits) to COCO API</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>results = processor.post_process(outputs=outputs, target_sizes=target_sizes)

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