import{S as ya,i as xa,s as wa,e as r,k as h,w as y,t as n,M as $a,c as s,d as o,m,a,x,h as i,b as c,N as Ta,G as e,g as u,y as w,q as $,o as T,B as Y,v as Ya,L as Es}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ts}from"../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Os}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as yt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ys}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ea(F){let d,b,g,f,v;return f=new Os({props:{code:`from transformers import YolosModel, YolosConfig

# Initializing a YOLOS hustvl/yolos-base style configuration
configuration = YolosConfig()

# Initializing a model from the hustvl/yolos-base style configuration
model = YolosModel(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> YolosModel, YolosConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a YOLOS hustvl/yolos-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = YolosConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the hustvl/yolos-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YolosModel(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(){d=r("p"),b=n("Example:"),g=h(),y(f.$$.fragment)},l(l){d=s(l,"P",{});var _=a(d);b=i(_,"Example:"),_.forEach(o),g=m(l),x(f.$$.fragment,l)},m(l,_){u(l,d,_),e(d,b),u(l,g,_),w(f,l,_),v=!0},p:Es,i(l){v||($(f.$$.fragment,l),v=!0)},o(l){T(f.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),Y(f,l)}}}function Oa(F){let d,b;return{c(){d=r("p"),b=n(`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`)},l(g){d=s(g,"P",{});var f=a(d);b=i(f,`NumPy arrays and PyTorch tensors are converted to PIL images when resizing, so the most efficient is to pass
PIL images.`),f.forEach(o)},m(g,f){u(g,d,f),e(d,b)},d(g){g&&o(d)}}}function Fa(F){let d,b,g,f,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),f=n("Module"),v=n(`
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(l){d=s(l,"P",{});var _=a(d);b=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(_,"CODE",{});var C=a(g);f=i(C,"Module"),C.forEach(o),v=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.`),_.forEach(o)},m(l,_){u(l,d,_),e(d,b),e(d,g),e(g,f),e(d,v)},d(l){l&&o(d)}}}function za(F){let d,b,g,f,v;return f=new Os({props:{code:`from transformers import YolosFeatureExtractor, YolosModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][0]

feature_extractor = YolosFeatureExtractor.from_pretrained("hustvl/yolos-small")
model = YolosModel.from_pretrained("hustvl/yolos-small")

inputs = feature_extractor(image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state
list(last_hidden_states.shape)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> YolosFeatureExtractor, YolosModel
<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> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = YolosFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hustvl/yolos-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YolosModel.from_pretrained(<span class="hljs-string">&quot;hustvl/yolos-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(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(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">3401</span>, <span class="hljs-number">384</span>]`}}),{c(){d=r("p"),b=n("Example:"),g=h(),y(f.$$.fragment)},l(l){d=s(l,"P",{});var _=a(d);b=i(_,"Example:"),_.forEach(o),g=m(l),x(f.$$.fragment,l)},m(l,_){u(l,d,_),e(d,b),u(l,g,_),w(f,l,_),v=!0},p:Es,i(l){v||($(f.$$.fragment,l),v=!0)},o(l){T(f.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),Y(f,l)}}}function ka(F){let d,b,g,f,v;return{c(){d=r("p"),b=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=r("code"),f=n("Module"),v=n(`
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(l){d=s(l,"P",{});var _=a(d);b=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=s(_,"CODE",{});var C=a(g);f=i(C,"Module"),C.forEach(o),v=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.`),_.forEach(o)},m(l,_){u(l,d,_),e(d,b),e(d,g),e(g,f),e(d,v)},d(l){l&&o(d)}}}function ja(F){let d,b,g,f,v;return f=new Os({props:{code:`from transformers import YolosFeatureExtractor, YolosForObjectDetection
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = YolosFeatureExtractor.from_pretrained("hustvl/yolos-small")
model = YolosForObjectDetection.from_pretrained("hustvl/yolos-small")

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

outputs = model(**inputs)

# model predicts bounding boxes and corresponding COCO classes
logits = outputs.logits
bboxes = outputs.pred_boxes`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> YolosFeatureExtractor, YolosForObjectDetection
<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>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>feature_extractor = YolosFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;hustvl/yolos-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = YolosForObjectDetection.from_pretrained(<span class="hljs-string">&quot;hustvl/yolos-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(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"># model predicts bounding boxes and corresponding COCO classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>bboxes = outputs.pred_boxes`}}),{c(){d=r("p"),b=n("Examples:"),g=h(),y(f.$$.fragment)},l(l){d=s(l,"P",{});var _=a(d);b=i(_,"Examples:"),_.forEach(o),g=m(l),x(f.$$.fragment,l)},m(l,_){u(l,d,_),e(d,b),u(l,g,_),w(f,l,_),v=!0},p:Es,i(l){v||($(f.$$.fragment,l),v=!0)},o(l){T(f.$$.fragment,l),v=!1},d(l){l&&o(d),l&&o(g),Y(f,l)}}}function Da(F){let d,b,g,f,v,l,_,C,Yo,Wt,A,G,xt,be,Eo,wt,Oo,Bt,M,Fo,ve,zo,ko,Qe,jo,Do,Vt,Xe,Co,Ut,Ke,$t,Po,Ht,Ze,Lo,Jt,Q,P,qo,et,Mo,Io,tt,So,Ao,Tt,No,Ro,Wo,ye,Bo,xe,Vo,Uo,Gt,X,Fs,Qt,K,Ho,ot,Jo,Go,Xt,I,Qo,we,Xo,Ko,$e,Zo,er,Kt,N,Z,Yt,Te,tr,Et,or,Zt,z,Ye,rr,R,sr,rt,ar,nr,Ee,ir,lr,cr,W,dr,st,hr,mr,at,pr,fr,ur,ee,eo,B,te,Ot,Oe,gr,Ft,_r,to,E,Fe,br,zt,vr,yr,ze,xr,nt,wr,$r,Tr,S,ke,Yr,kt,Er,Or,oe,Fr,re,je,zr,jt,kr,jr,se,De,Dr,Ce,Cr,it,Pr,Lr,qr,ae,Pe,Mr,Le,Ir,lt,Sr,Ar,Nr,ne,qe,Rr,Me,Wr,ct,Br,Vr,oo,V,ie,Dt,Ie,Ur,Ct,Hr,ro,L,Se,Jr,Ae,Gr,Ne,Qr,Xr,Kr,j,Re,Zr,U,es,dt,ts,os,Pt,rs,ss,as,le,ns,ce,so,H,de,Lt,We,is,qt,ls,ao,k,Be,cs,Mt,ds,hs,Ve,ms,Ue,ps,fs,us,D,He,gs,J,_s,ht,bs,vs,It,ys,xs,ws,he,$s,me,no;return l=new yt({}),be=new yt({}),Te=new yt({}),Ye=new q({props:{name:"class transformers.YolosConfig",anchor:"transformers.YolosConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"attention_probs_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"image_size",val:" = [512, 864]"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"num_detection_tokens",val:" = 100"},{name:"use_mid_position_embeddings",val:" = True"},{name:"auxiliary_loss",val:" = False"},{name:"class_cost",val:" = 1"},{name:"bbox_cost",val:" = 5"},{name:"giou_cost",val:" = 2"},{name:"bbox_loss_coefficient",val:" = 5"},{name:"giou_loss_coefficient",val:" = 2"},{name:"eos_coefficient",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.YolosConfig.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.YolosConfig.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.YolosConfig.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.YolosConfig.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.YolosConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;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> are supported.`,name:"hidden_act"},{anchor:"transformers.YolosConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.YolosConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.YolosConfig.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.YolosConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.YolosConfig.image_size",description:`<strong>image_size</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[512, 864]</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.YolosConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>16</code>) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.YolosConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3</code>) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.YolosConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.YolosConfig.num_detection_tokens",description:`<strong>num_detection_tokens</strong> (<code>int</code>, <em>optional</em>, defaults to <code>100</code>) &#x2014;
The number of detection tokens.`,name:"num_detection_tokens"},{anchor:"transformers.YolosConfig.use_mid_position_embeddings",description:`<strong>use_mid_position_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use the mid-layer position encodings.`,name:"use_mid_position_embeddings"},{anchor:"transformers.YolosConfig.auxiliary_loss",description:`<strong>auxiliary_loss</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether auxiliary decoding losses (loss at each decoder layer) are to be used.`,name:"auxiliary_loss"},{anchor:"transformers.YolosConfig.class_cost",description:`<strong>class_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the classification error in the Hungarian matching cost.`,name:"class_cost"},{anchor:"transformers.YolosConfig.bbox_cost",description:`<strong>bbox_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 5) &#x2014;
Relative weight of the L1 error of the bounding box coordinates in the Hungarian matching cost.`,name:"bbox_cost"},{anchor:"transformers.YolosConfig.giou_cost",description:`<strong>giou_cost</strong> (<code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
Relative weight of the generalized IoU loss of the bounding box in the Hungarian matching cost.`,name:"giou_cost"},{anchor:"transformers.YolosConfig.bbox_loss_coefficient",description:`<strong>bbox_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 5) &#x2014;
Relative weight of the L1 bounding box loss in the object detection loss.`,name:"bbox_loss_coefficient"},{anchor:"transformers.YolosConfig.giou_loss_coefficient",description:`<strong>giou_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 2) &#x2014;
Relative weight of the generalized IoU loss in the object detection loss.`,name:"giou_loss_coefficient"},{anchor:"transformers.YolosConfig.eos_coefficient",description:`<strong>eos_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Relative classification weight of the &#x2018;no-object&#x2019; class in the object detection loss.`,name:"eos_coefficient"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/configuration_yolos.py#L29"}}),ee=new Ys({props:{anchor:"transformers.YolosConfig.example",$$slots:{default:[Ea]},$$scope:{ctx:F}}}),Oe=new yt({}),Fe=new q({props:{name:"class transformers.YolosFeatureExtractor",anchor:"transformers.YolosFeatureExtractor",parameters:[{name:"format",val:" = 'coco_detection'"},{name:"do_resize",val:" = True"},{name:"size",val:" = 800"},{name:"max_size",val:" = 1333"},{name:"do_normalize",val:" = True"},{name:"image_mean",val:" = None"},{name:"image_std",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.format",description:`<strong>format</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;coco_detection&quot;</code>) &#x2014;
Data format of the annotations. One of &#x201C;coco_detection&#x201D; or &#x201C;coco_panoptic&#x201D;.`,name:"format"},{anchor:"transformers.YolosFeatureExtractor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the input to a certain <code>size</code>.`,name:"do_resize"},{anchor:"transformers.YolosFeatureExtractor.size",description:`<strong>size</strong> (<code>int</code>, <em>optional</em>, defaults to 800) &#x2014;
Resize the input to the given size. Only has an effect if <code>do_resize</code> is set to <code>True</code>. If size is a
sequence like <code>(width, height)</code>, output size will be matched to this. If size is an int, smaller edge of
the image will be matched to this number. i.e, if <code>height &gt; width</code>, then image will be rescaled to <code>(size * height / width, size)</code>.`,name:"size"},{anchor:"transformers.YolosFeatureExtractor.max_size",description:`<strong>max_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1333</code>) &#x2014;
The largest size an image dimension can have (otherwise it&#x2019;s capped). Only has an effect if <code>do_resize</code> is
set to <code>True</code>.`,name:"max_size"},{anchor:"transformers.YolosFeatureExtractor.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 mean and standard deviation.`,name:"do_normalize"},{anchor:"transformers.YolosFeatureExtractor.image_mean",description:`<strong>image_mean</strong> (<code>int</code>, <em>optional</em>, defaults to <code>[0.485, 0.456, 0.406]</code>) &#x2014;
The sequence of means for each channel, to be used when normalizing images. Defaults to the ImageNet mean.`,name:"image_mean"},{anchor:"transformers.YolosFeatureExtractor.image_std",description:`<strong>image_std</strong> (<code>int</code>, <em>optional</em>, defaults to <code>[0.229, 0.224, 0.225]</code>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images. Defaults to the
ImageNet std.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L123"}}),ke=new q({props:{name:"__call__",anchor:"transformers.YolosFeatureExtractor.__call__",parameters:[{name:"images",val:": typing.Union[PIL.Image.Image, numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"annotations",val:": typing.Union[typing.List[typing.Dict], typing.List[typing.List[typing.Dict]]] = None"},{name:"return_segmentation_masks",val:": typing.Optional[bool] = False"},{name:"masks_path",val:": typing.Optional[pathlib.Path] = None"},{name:"padding",val:": typing.Optional[bool] = True"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.YolosFeatureExtractor.__call__.annotations",description:`<strong>annotations</strong> (<code>Dict</code>, <code>List[Dict]</code>, <em>optional</em>) &#x2014;
The corresponding annotations in COCO format.</p>
<p>In case <a href="/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrFeatureExtractor">DetrFeatureExtractor</a> was initialized with <code>format = &quot;coco_detection&quot;</code>, the annotations for
each image should have the following format: {&#x2018;image_id&#x2019;: int, &#x2018;annotations&#x2019;: [annotation]}, with the
annotations being a list of COCO object annotations.</p>
<p>In case <a href="/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrFeatureExtractor">DetrFeatureExtractor</a> was initialized with <code>format = &quot;coco_panoptic&quot;</code>, the annotations for
each image should have the following format: {&#x2018;image_id&#x2019;: int, &#x2018;file_name&#x2019;: str, &#x2018;segments_info&#x2019;:
[segment_info]} with segments_info being a list of COCO panoptic annotations.`,name:"annotations"},{anchor:"transformers.YolosFeatureExtractor.__call__.return_segmentation_masks",description:`<strong>return_segmentation_masks</strong> (<code>Dict</code>, <code>List[Dict]</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to also include instance segmentation masks as part of the labels in case <code>format = &quot;coco_detection&quot;</code>.`,name:"return_segmentation_masks"},{anchor:"transformers.YolosFeatureExtractor.__call__.masks_path",description:`<strong>masks_path</strong> (<code>pathlib.Path</code>, <em>optional</em>) &#x2014;
Path to the directory containing the PNG files that store the class-agnostic image segmentations. Only
relevant in case <a href="/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrFeatureExtractor">DetrFeatureExtractor</a> was initialized with <code>format = &quot;coco_panoptic&quot;</code>.`,name:"masks_path"},{anchor:"transformers.YolosFeatureExtractor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to pad images up to the largest image in a batch.`,name:"padding"},{anchor:"transformers.YolosFeatureExtractor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of NumPy arrays. If set to <code>&apos;pt&apos;</code>, return PyTorch <code>torch.Tensor</code>
objects.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L410",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model.</li>
<li><strong>labels</strong> \u2014 Optional labels to be fed to a model (when <code>annotations</code> are provided)</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),oe=new Ts({props:{warning:!0,$$slots:{default:[Oa]},$$scope:{ctx:F}}}),je=new q({props:{name:"pad",anchor:"transformers.YolosFeatureExtractor.pad",parameters:[{name:"pixel_values_list",val:": typing.List[ForwardRef('torch.Tensor')]"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.pad.pixel_values_list",description:`<strong>pixel_values_list</strong> (<code>List[torch.Tensor]</code>) &#x2014;
List of images (pixel values) to be padded. Each image should be a tensor of shape (C, H, W).`,name:"pixel_values_list"},{anchor:"transformers.YolosFeatureExtractor.pad.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of NumPy arrays. If set to <code>&apos;pt&apos;</code>, return PyTorch <code>torch.Tensor</code>
objects.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L626",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following field:</p>
<ul>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),De=new q({props:{name:"post_process",anchor:"transformers.YolosFeatureExtractor.post_process",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:""}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.post_process.outputs",description:`<strong>outputs</strong> (<code>DetrObjectDetectionOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.YolosFeatureExtractor.post_process.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the size (h, w) of each image of the batch. For evaluation, this must be the original
image size (before any data augmentation). For visualization, this should be the image size after data
augment, but before padding.`,name:"target_sizes"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L660",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>
`}}),Pe=new q({props:{name:"post_process_segmentation",anchor:"transformers.YolosFeatureExtractor.post_process_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:""},{name:"threshold",val:" = 0.9"},{name:"mask_threshold",val:" = 0.5"}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.post_process_segmentation.outputs",description:`<strong>outputs</strong> (<code>DetrSegmentationOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.YolosFeatureExtractor.post_process_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code> or <code>List[Tuple]</code> of length <code>batch_size</code>) &#x2014;
Torch Tensor (or list) corresponding to the requested final size (h, w) of each prediction.`,name:"target_sizes"},{anchor:"transformers.YolosFeatureExtractor.post_process_segmentation.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
Threshold to use to filter out queries.`,name:"threshold"},{anchor:"transformers.YolosFeatureExtractor.post_process_segmentation.mask_threshold",description:`<strong>mask_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
Threshold to use when turning the predicted masks into binary values.`,name:"mask_threshold"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L699",returnDescription:`
<p>A list of dictionaries, each dictionary containing the scores, labels, and masks for an image
in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),qe=new q({props:{name:"post_process_panoptic",anchor:"transformers.YolosFeatureExtractor.post_process_panoptic",parameters:[{name:"outputs",val:""},{name:"processed_sizes",val:""},{name:"target_sizes",val:" = None"},{name:"is_thing_map",val:" = None"},{name:"threshold",val:" = 0.85"}],parametersDescription:[{anchor:"transformers.YolosFeatureExtractor.post_process_panoptic.outputs",description:`<strong>outputs</strong> (<code>DetrSegmentationOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.YolosFeatureExtractor.post_process_panoptic.processed_sizes",description:`<strong>processed_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code> or <code>List[Tuple]</code> of length <code>batch_size</code>) &#x2014;
Torch Tensor (or list) containing the size (h, w) of each image of the batch, i.e. the size after data
augmentation but before batching.`,name:"processed_sizes"},{anchor:"transformers.YolosFeatureExtractor.post_process_panoptic.target_sizes",description:`<strong>target_sizes</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code> or <code>List[Tuple]</code> of length <code>batch_size</code>, <em>optional</em>) &#x2014;
Torch Tensor (or list) corresponding to the requested final size (h, w) of each prediction. If left to
None, it will default to the <code>processed_sizes</code>.`,name:"target_sizes"},{anchor:"transformers.YolosFeatureExtractor.post_process_panoptic.is_thing_map",description:`<strong>is_thing_map</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, 2)</code>, <em>optional</em>) &#x2014;
Dictionary mapping class indices to either True or False, depending on whether or not they are a thing.
If not set, defaults to the <code>is_thing_map</code> of COCO panoptic.`,name:"is_thing_map"},{anchor:"transformers.YolosFeatureExtractor.post_process_panoptic.threshold",description:`<strong>threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 0.85) &#x2014;
Threshold to use to filter out queries.`,name:"threshold"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/feature_extraction_yolos.py#L785",returnDescription:`
<p>A list of dictionaries, each dictionary containing a PNG string and segments_info values for
an image in the batch as predicted by the model.</p>
`,returnType:`
<p><code>List[Dict]</code></p>
`}}),Ie=new yt({}),Se=new q({props:{name:"class transformers.YolosModel",anchor:"transformers.YolosModel",parameters:[{name:"config",val:": YolosConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.YolosModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosConfig">YolosConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/modeling_yolos.py#L609"}}),Re=new q({props:{name:"forward",anchor:"transformers.YolosModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"head_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.YolosModel.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. Pixel values can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.YolosModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.YolosModel.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.YolosModel.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.YolosModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/modeling_yolos.py#L637",returnDescription:`
<p>A <a
  href="/docs/transformers/pr_17548/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 (<a
  href="/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosConfig"
>YolosConfig</a>) 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/pr_17548/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),le=new Ts({props:{$$slots:{default:[Fa]},$$scope:{ctx:F}}}),ce=new Ys({props:{anchor:"transformers.YolosModel.forward.example",$$slots:{default:[za]},$$scope:{ctx:F}}}),We=new yt({}),Be=new q({props:{name:"class transformers.YolosForObjectDetection",anchor:"transformers.YolosForObjectDetection",parameters:[{name:"config",val:": YolosConfig"}],parametersDescription:[{anchor:"transformers.YolosForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosConfig">YolosConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_17548/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/modeling_yolos.py#L718"}}),He=new q({props:{name:"forward",anchor:"transformers.YolosForObjectDetection.forward",parameters:[{name:"pixel_values",val:""},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.YolosForObjectDetection.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. Pixel values can be obtained using <a href="/docs/transformers/pr_17548/en/model_doc/auto#transformers.AutoFeatureExtractor">AutoFeatureExtractor</a>. See
<code>AutoFeatureExtractor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.YolosForObjectDetection.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.YolosForObjectDetection.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.YolosForObjectDetection.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.YolosForObjectDetection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_17548/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.YolosForObjectDetection.forward.labels",description:`<strong>labels</strong> (<code>List[Dict]</code> of len <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the bipartite matching loss. List of dicts, each dictionary containing at least the
following 2 keys: <code>&apos;class_labels&apos;</code> and <code>&apos;boxes&apos;</code> (the class labels and bounding boxes of an image in the
batch respectively). The class labels themselves should be a <code>torch.LongTensor</code> of len <code>(number of bounding boxes in the image,)</code> and the boxes a <code>torch.FloatTensor</code> of shape <code>(number of bounding boxes in the image, 4)</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/yolos/modeling_yolos.py#L745",returnDescription:`
<p>A <code>transformers.models.yolos.modeling_yolos.YolosObjectDetectionOutput</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 (<a
  href="/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosConfig"
>YolosConfig</a>) 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_queries, num_classes + 1)</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_queries, 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/pr_17548/en/model_doc/detr#transformers.DetrFeatureExtractor.post_process"
>post_process()</a> to retrieve the unnormalized bounding
boxes.</li>
<li><strong>auxiliary_outputs</strong> (<code>list[Dict]</code>, <em>optional</em>) \u2014 Optional, only returned when auxilary losses are activated (i.e. <code>config.auxiliary_loss</code> is set to <code>True</code>)
and labels are provided. It is a list of dictionaries containing the two above keys (<code>logits</code> and
<code>pred_boxes</code>) for each decoder layer.</li>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) \u2014 Sequence of hidden-states at the output of the last layer of the decoder of the model.</li>
<li><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>. Hidden-states of
the model at the output of each layer plus the optional initial embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.yolos.modeling_yolos.YolosObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),he=new Ts({props:{$$slots:{default:[ka]},$$scope:{ctx:F}}}),me=new Ys({props:{anchor:"transformers.YolosForObjectDetection.forward.example",$$slots:{default:[ja]},$$scope:{ctx:F}}}),{c(){d=r("meta"),b=h(),g=r("h1"),f=r("a"),v=r("span"),y(l.$$.fragment),_=h(),C=r("span"),Yo=n("YOLOS"),Wt=h(),A=r("h2"),G=r("a"),xt=r("span"),y(be.$$.fragment),Eo=h(),wt=r("span"),Oo=n("Overview"),Bt=h(),M=r("p"),Fo=n("The YOLOS model was proposed in "),ve=r("a"),zo=n("You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection"),ko=n(` by Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, Wenyu Liu.
YOLOS proposes to just leverage the plain `),Qe=r("a"),jo=n("Vision Transformer (ViT)"),Do=n(" for object detection, inspired by DETR. It turns out that a base-sized encoder-only Transformer can also achieve 42 AP on COCO, similar to DETR and much more complex frameworks such as Faster R-CNN."),Vt=h(),Xe=r("p"),Co=n("The abstract from the paper is the following:"),Ut=h(),Ke=r("p"),$t=r("em"),Po=n("Can Transformer perform 2D object- and region-level recognition from a pure sequence-to-sequence perspective with minimal knowledge about the 2D spatial structure? To answer this question, we present You Only Look at One Sequence (YOLOS), a series of object detection models based on the vanilla Vision Transformer with the fewest possible modifications, region priors, as well as inductive biases of the target task. We find that YOLOS pre-trained on the mid-sized ImageNet-1k dataset only can already achieve quite competitive performance on the challenging COCO object detection benchmark, e.g., YOLOS-Base directly adopted from BERT-Base architecture can obtain 42.0 box AP on COCO val. We also discuss the impacts as well as limitations of current pre-train schemes and model scaling strategies for Transformer in vision through YOLOS."),Ht=h(),Ze=r("p"),Lo=n("Tips:"),Jt=h(),Q=r("ul"),P=r("li"),qo=n("One can use "),et=r("a"),Mo=n("YolosFeatureExtractor"),Io=n(" for preparing images (and optional targets) for the model. Contrary to "),tt=r("a"),So=n("DETR"),Ao=n(", YOLOS doesn\u2019t require a "),Tt=r("code"),No=n("pixel_mask"),Ro=n(" to be created."),Wo=h(),ye=r("li"),Bo=n("Demo notebooks (regarding inference and fine-tuning on custom data) can be found "),xe=r("a"),Vo=n("here"),Uo=n("."),Gt=h(),X=r("img"),Qt=h(),K=r("small"),Ho=n("YOLOS architecture. Taken from the "),ot=r("a"),Jo=n("original paper"),Go=n("."),Xt=h(),I=r("p"),Qo=n("This model was contributed by "),we=r("a"),Xo=n("nielsr"),Ko=n(". The original code can be found "),$e=r("a"),Zo=n("here"),er=n("."),Kt=h(),N=r("h2"),Z=r("a"),Yt=r("span"),y(Te.$$.fragment),tr=h(),Et=r("span"),or=n("YolosConfig"),Zt=h(),z=r("div"),y(Ye.$$.fragment),rr=h(),R=r("p"),sr=n("This is the configuration class to store the configuration of a "),rt=r("a"),ar=n("YolosModel"),nr=n(`. It is used to instantiate a YOLOS
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the YOLOS
`),Ee=r("a"),ir=n("hustvl/yolos-base"),lr=n(" architecture."),cr=h(),W=r("p"),dr=n("Configuration objects inherit from "),st=r("a"),hr=n("PretrainedConfig"),mr=n(` and can be used to control the model outputs. Read the
documentation from `),at=r("a"),pr=n("PretrainedConfig"),fr=n(" for more information."),ur=h(),y(ee.$$.fragment),eo=h(),B=r("h2"),te=r("a"),Ot=r("span"),y(Oe.$$.fragment),gr=h(),Ft=r("span"),_r=n("YolosFeatureExtractor"),to=h(),E=r("div"),y(Fe.$$.fragment),br=h(),zt=r("p"),vr=n("Constructs a YOLOS feature extractor."),yr=h(),ze=r("p"),xr=n("This feature extractor inherits from "),nt=r("a"),wr=n("FeatureExtractionMixin"),$r=n(` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),Tr=h(),S=r("div"),y(ke.$$.fragment),Yr=h(),kt=r("p"),Er=n(`Main method to prepare for the model one or several image(s) and optional annotations. Images are by default
padded up to the largest image in a batch.`),Or=h(),y(oe.$$.fragment),Fr=h(),re=r("div"),y(je.$$.fragment),zr=h(),jt=r("p"),kr=n("Pad images up to the largest image in a batch."),jr=h(),se=r("div"),y(De.$$.fragment),Dr=h(),Ce=r("p"),Cr=n("Converts the output of "),it=r("a"),Pr=n("DetrForObjectDetection"),Lr=n(` into the format expected by the COCO api. Only supports
PyTorch.`),qr=h(),ae=r("div"),y(Pe.$$.fragment),Mr=h(),Le=r("p"),Ir=n("Converts the output of "),lt=r("a"),Sr=n("DetrForSegmentation"),Ar=n(" into image segmentation predictions. Only supports PyTorch."),Nr=h(),ne=r("div"),y(qe.$$.fragment),Rr=h(),Me=r("p"),Wr=n("Converts the output of "),ct=r("a"),Br=n("DetrForSegmentation"),Vr=n(" into actual panoptic predictions. Only supports PyTorch."),oo=h(),V=r("h2"),ie=r("a"),Dt=r("span"),y(Ie.$$.fragment),Ur=h(),Ct=r("span"),Hr=n("YolosModel"),ro=h(),L=r("div"),y(Se.$$.fragment),Jr=h(),Ae=r("p"),Gr=n(`The bare YOLOS Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=r("a"),Qr=n("torch.nn.Module"),Xr=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kr=h(),j=r("div"),y(Re.$$.fragment),Zr=h(),U=r("p"),es=n("The "),dt=r("a"),ts=n("YolosModel"),os=n(" forward method, overrides the "),Pt=r("code"),rs=n("__call__"),ss=n(" special method."),as=h(),y(le.$$.fragment),ns=h(),y(ce.$$.fragment),so=h(),H=r("h2"),de=r("a"),Lt=r("span"),y(We.$$.fragment),is=h(),qt=r("span"),ls=n("YolosForObjectDetection"),ao=h(),k=r("div"),y(Be.$$.fragment),cs=h(),Mt=r("p"),ds=n("YOLOS Model (consisting of a ViT encoder) with object detection heads on top, for tasks such as COCO detection."),hs=h(),Ve=r("p"),ms=n("This model is a PyTorch "),Ue=r("a"),ps=n("torch.nn.Module"),fs=n(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),us=h(),D=r("div"),y(He.$$.fragment),gs=h(),J=r("p"),_s=n("The "),ht=r("a"),bs=n("YolosForObjectDetection"),vs=n(" forward method, overrides the "),It=r("code"),ys=n("__call__"),xs=n(" special method."),ws=h(),y(he.$$.fragment),$s=h(),y(me.$$.fragment),this.h()},l(t){const p=$a('[data-svelte="svelte-1phssyn"]',document.head);d=s(p,"META",{name:!0,content:!0}),p.forEach(o),b=m(t),g=s(t,"H1",{class:!0});var Je=a(g);f=s(Je,"A",{id:!0,class:!0,href:!0});var St=a(f);v=s(St,"SPAN",{});var At=a(v);x(l.$$.fragment,At),At.forEach(o),St.forEach(o),_=m(Je),C=s(Je,"SPAN",{});var Nt=a(C);Yo=i(Nt,"YOLOS"),Nt.forEach(o),Je.forEach(o),Wt=m(t),A=s(t,"H2",{class:!0});var Ge=a(A);G=s(Ge,"A",{id:!0,class:!0,href:!0});var Rt=a(G);xt=s(Rt,"SPAN",{});var zs=a(xt);x(be.$$.fragment,zs),zs.forEach(o),Rt.forEach(o),Eo=m(Ge),wt=s(Ge,"SPAN",{});var ks=a(wt);Oo=i(ks,"Overview"),ks.forEach(o),Ge.forEach(o),Bt=m(t),M=s(t,"P",{});var mt=a(M);Fo=i(mt,"The YOLOS model was proposed in "),ve=s(mt,"A",{href:!0,rel:!0});var js=a(ve);zo=i(js,"You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection"),js.forEach(o),ko=i(mt,` by Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, Wenyu Liu.
YOLOS proposes to just leverage the plain `),Qe=s(mt,"A",{href:!0});var Ds=a(Qe);jo=i(Ds,"Vision Transformer (ViT)"),Ds.forEach(o),Do=i(mt," for object detection, inspired by DETR. It turns out that a base-sized encoder-only Transformer can also achieve 42 AP on COCO, similar to DETR and much more complex frameworks such as Faster R-CNN."),mt.forEach(o),Vt=m(t),Xe=s(t,"P",{});var Cs=a(Xe);Co=i(Cs,"The abstract from the paper is the following:"),Cs.forEach(o),Ut=m(t),Ke=s(t,"P",{});var Ps=a(Ke);$t=s(Ps,"EM",{});var Ls=a($t);Po=i(Ls,"Can Transformer perform 2D object- and region-level recognition from a pure sequence-to-sequence perspective with minimal knowledge about the 2D spatial structure? To answer this question, we present You Only Look at One Sequence (YOLOS), a series of object detection models based on the vanilla Vision Transformer with the fewest possible modifications, region priors, as well as inductive biases of the target task. We find that YOLOS pre-trained on the mid-sized ImageNet-1k dataset only can already achieve quite competitive performance on the challenging COCO object detection benchmark, e.g., YOLOS-Base directly adopted from BERT-Base architecture can obtain 42.0 box AP on COCO val. We also discuss the impacts as well as limitations of current pre-train schemes and model scaling strategies for Transformer in vision through YOLOS."),Ls.forEach(o),Ps.forEach(o),Ht=m(t),Ze=s(t,"P",{});var qs=a(Ze);Lo=i(qs,"Tips:"),qs.forEach(o),Jt=m(t),Q=s(t,"UL",{});var io=a(Q);P=s(io,"LI",{});var pe=a(P);qo=i(pe,"One can use "),et=s(pe,"A",{href:!0});var Ms=a(et);Mo=i(Ms,"YolosFeatureExtractor"),Ms.forEach(o),Io=i(pe," for preparing images (and optional targets) for the model. Contrary to "),tt=s(pe,"A",{href:!0});var Is=a(tt);So=i(Is,"DETR"),Is.forEach(o),Ao=i(pe,", YOLOS doesn\u2019t require a "),Tt=s(pe,"CODE",{});var Ss=a(Tt);No=i(Ss,"pixel_mask"),Ss.forEach(o),Ro=i(pe," to be created."),pe.forEach(o),Wo=m(io),ye=s(io,"LI",{});var lo=a(ye);Bo=i(lo,"Demo notebooks (regarding inference and fine-tuning on custom data) can be found "),xe=s(lo,"A",{href:!0,rel:!0});var As=a(xe);Vo=i(As,"here"),As.forEach(o),Uo=i(lo,"."),lo.forEach(o),io.forEach(o),Gt=m(t),X=s(t,"IMG",{src:!0,alt:!0,width:!0}),Qt=m(t),K=s(t,"SMALL",{});var co=a(K);Ho=i(co,"YOLOS architecture. Taken from the "),ot=s(co,"A",{href:!0});var Ns=a(ot);Jo=i(Ns,"original paper"),Ns.forEach(o),Go=i(co,"."),co.forEach(o),Xt=m(t),I=s(t,"P",{});var pt=a(I);Qo=i(pt,"This model was contributed by "),we=s(pt,"A",{href:!0,rel:!0});var Rs=a(we);Xo=i(Rs,"nielsr"),Rs.forEach(o),Ko=i(pt,". The original code can be found "),$e=s(pt,"A",{href:!0,rel:!0});var Ws=a($e);Zo=i(Ws,"here"),Ws.forEach(o),er=i(pt,"."),pt.forEach(o),Kt=m(t),N=s(t,"H2",{class:!0});var ho=a(N);Z=s(ho,"A",{id:!0,class:!0,href:!0});var Bs=a(Z);Yt=s(Bs,"SPAN",{});var Vs=a(Yt);x(Te.$$.fragment,Vs),Vs.forEach(o),Bs.forEach(o),tr=m(ho),Et=s(ho,"SPAN",{});var Us=a(Et);or=i(Us,"YolosConfig"),Us.forEach(o),ho.forEach(o),Zt=m(t),z=s(t,"DIV",{class:!0});var fe=a(z);x(Ye.$$.fragment,fe),rr=m(fe),R=s(fe,"P",{});var ft=a(R);sr=i(ft,"This is the configuration class to store the configuration of a "),rt=s(ft,"A",{href:!0});var Hs=a(rt);ar=i(Hs,"YolosModel"),Hs.forEach(o),nr=i(ft,`. It is used to instantiate a YOLOS
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the YOLOS
`),Ee=s(ft,"A",{href:!0,rel:!0});var Js=a(Ee);ir=i(Js,"hustvl/yolos-base"),Js.forEach(o),lr=i(ft," architecture."),ft.forEach(o),cr=m(fe),W=s(fe,"P",{});var ut=a(W);dr=i(ut,"Configuration objects inherit from "),st=s(ut,"A",{href:!0});var Gs=a(st);hr=i(Gs,"PretrainedConfig"),Gs.forEach(o),mr=i(ut,` and can be used to control the model outputs. Read the
documentation from `),at=s(ut,"A",{href:!0});var Qs=a(at);pr=i(Qs,"PretrainedConfig"),Qs.forEach(o),fr=i(ut," for more information."),ut.forEach(o),ur=m(fe),x(ee.$$.fragment,fe),fe.forEach(o),eo=m(t),B=s(t,"H2",{class:!0});var mo=a(B);te=s(mo,"A",{id:!0,class:!0,href:!0});var Xs=a(te);Ot=s(Xs,"SPAN",{});var Ks=a(Ot);x(Oe.$$.fragment,Ks),Ks.forEach(o),Xs.forEach(o),gr=m(mo),Ft=s(mo,"SPAN",{});var Zs=a(Ft);_r=i(Zs,"YolosFeatureExtractor"),Zs.forEach(o),mo.forEach(o),to=m(t),E=s(t,"DIV",{class:!0});var O=a(E);x(Fe.$$.fragment,O),br=m(O),zt=s(O,"P",{});var ea=a(zt);vr=i(ea,"Constructs a YOLOS feature extractor."),ea.forEach(o),yr=m(O),ze=s(O,"P",{});var po=a(ze);xr=i(po,"This feature extractor inherits from "),nt=s(po,"A",{href:!0});var ta=a(nt);wr=i(ta,"FeatureExtractionMixin"),ta.forEach(o),$r=i(po,` which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.`),po.forEach(o),Tr=m(O),S=s(O,"DIV",{class:!0});var gt=a(S);x(ke.$$.fragment,gt),Yr=m(gt),kt=s(gt,"P",{});var oa=a(kt);Er=i(oa,`Main method to prepare for the model one or several image(s) and optional annotations. Images are by default
padded up to the largest image in a batch.`),oa.forEach(o),Or=m(gt),x(oe.$$.fragment,gt),gt.forEach(o),Fr=m(O),re=s(O,"DIV",{class:!0});var fo=a(re);x(je.$$.fragment,fo),zr=m(fo),jt=s(fo,"P",{});var ra=a(jt);kr=i(ra,"Pad images up to the largest image in a batch."),ra.forEach(o),fo.forEach(o),jr=m(O),se=s(O,"DIV",{class:!0});var uo=a(se);x(De.$$.fragment,uo),Dr=m(uo),Ce=s(uo,"P",{});var go=a(Ce);Cr=i(go,"Converts the output of "),it=s(go,"A",{href:!0});var sa=a(it);Pr=i(sa,"DetrForObjectDetection"),sa.forEach(o),Lr=i(go,` into the format expected by the COCO api. Only supports
PyTorch.`),go.forEach(o),uo.forEach(o),qr=m(O),ae=s(O,"DIV",{class:!0});var _o=a(ae);x(Pe.$$.fragment,_o),Mr=m(_o),Le=s(_o,"P",{});var bo=a(Le);Ir=i(bo,"Converts the output of "),lt=s(bo,"A",{href:!0});var aa=a(lt);Sr=i(aa,"DetrForSegmentation"),aa.forEach(o),Ar=i(bo," into image segmentation predictions. Only supports PyTorch."),bo.forEach(o),_o.forEach(o),Nr=m(O),ne=s(O,"DIV",{class:!0});var vo=a(ne);x(qe.$$.fragment,vo),Rr=m(vo),Me=s(vo,"P",{});var yo=a(Me);Wr=i(yo,"Converts the output of "),ct=s(yo,"A",{href:!0});var na=a(ct);Br=i(na,"DetrForSegmentation"),na.forEach(o),Vr=i(yo," into actual panoptic predictions. Only supports PyTorch."),yo.forEach(o),vo.forEach(o),O.forEach(o),oo=m(t),V=s(t,"H2",{class:!0});var xo=a(V);ie=s(xo,"A",{id:!0,class:!0,href:!0});var ia=a(ie);Dt=s(ia,"SPAN",{});var la=a(Dt);x(Ie.$$.fragment,la),la.forEach(o),ia.forEach(o),Ur=m(xo),Ct=s(xo,"SPAN",{});var ca=a(Ct);Hr=i(ca,"YolosModel"),ca.forEach(o),xo.forEach(o),ro=m(t),L=s(t,"DIV",{class:!0});var _t=a(L);x(Se.$$.fragment,_t),Jr=m(_t),Ae=s(_t,"P",{});var wo=a(Ae);Gr=i(wo,`The bare YOLOS Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Ne=s(wo,"A",{href:!0,rel:!0});var da=a(Ne);Qr=i(da,"torch.nn.Module"),da.forEach(o),Xr=i(wo,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wo.forEach(o),Kr=m(_t),j=s(_t,"DIV",{class:!0});var ue=a(j);x(Re.$$.fragment,ue),Zr=m(ue),U=s(ue,"P",{});var bt=a(U);es=i(bt,"The "),dt=s(bt,"A",{href:!0});var ha=a(dt);ts=i(ha,"YolosModel"),ha.forEach(o),os=i(bt," forward method, overrides the "),Pt=s(bt,"CODE",{});var ma=a(Pt);rs=i(ma,"__call__"),ma.forEach(o),ss=i(bt," special method."),bt.forEach(o),as=m(ue),x(le.$$.fragment,ue),ns=m(ue),x(ce.$$.fragment,ue),ue.forEach(o),_t.forEach(o),so=m(t),H=s(t,"H2",{class:!0});var $o=a(H);de=s($o,"A",{id:!0,class:!0,href:!0});var pa=a(de);Lt=s(pa,"SPAN",{});var fa=a(Lt);x(We.$$.fragment,fa),fa.forEach(o),pa.forEach(o),is=m($o),qt=s($o,"SPAN",{});var ua=a(qt);ls=i(ua,"YolosForObjectDetection"),ua.forEach(o),$o.forEach(o),ao=m(t),k=s(t,"DIV",{class:!0});var ge=a(k);x(Be.$$.fragment,ge),cs=m(ge),Mt=s(ge,"P",{});var ga=a(Mt);ds=i(ga,"YOLOS Model (consisting of a ViT encoder) with object detection heads on top, for tasks such as COCO detection."),ga.forEach(o),hs=m(ge),Ve=s(ge,"P",{});var To=a(Ve);ms=i(To,"This model is a PyTorch "),Ue=s(To,"A",{href:!0,rel:!0});var _a=a(Ue);ps=i(_a,"torch.nn.Module"),_a.forEach(o),fs=i(To,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),To.forEach(o),us=m(ge),D=s(ge,"DIV",{class:!0});var _e=a(D);x(He.$$.fragment,_e),gs=m(_e),J=s(_e,"P",{});var vt=a(J);_s=i(vt,"The "),ht=s(vt,"A",{href:!0});var ba=a(ht);bs=i(ba,"YolosForObjectDetection"),ba.forEach(o),vs=i(vt," forward method, overrides the "),It=s(vt,"CODE",{});var va=a(It);ys=i(va,"__call__"),va.forEach(o),xs=i(vt," special method."),vt.forEach(o),ws=m(_e),x(he.$$.fragment,_e),$s=m(_e),x(me.$$.fragment,_e),_e.forEach(o),ge.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Ca)),c(f,"id","yolos"),c(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"),c(f,"href","#yolos"),c(g,"class","relative group"),c(G,"id","overview"),c(G,"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"),c(G,"href","#overview"),c(A,"class","relative group"),c(ve,"href","https://arxiv.org/abs/2106.00666"),c(ve,"rel","nofollow"),c(Qe,"href","vit"),c(et,"href","/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosFeatureExtractor"),c(tt,"href","detr"),c(xe,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/YOLOS"),c(xe,"rel","nofollow"),Ta(X.src,Fs="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/yolos_architecture.png")||c(X,"src",Fs),c(X,"alt","drawing"),c(X,"width","600"),c(ot,"href","https://arxiv.org/abs/2106.00666"),c(we,"href","https://huggingface.co/nielsr"),c(we,"rel","nofollow"),c($e,"href","https://github.com/hustvl/YOLOS"),c($e,"rel","nofollow"),c(Z,"id","transformers.YolosConfig"),c(Z,"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"),c(Z,"href","#transformers.YolosConfig"),c(N,"class","relative group"),c(rt,"href","/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosModel"),c(Ee,"href","https://huggingface.co/hustvl/yolos-base"),c(Ee,"rel","nofollow"),c(st,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),c(at,"href","/docs/transformers/pr_17548/en/main_classes/configuration#transformers.PretrainedConfig"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"id","transformers.YolosFeatureExtractor"),c(te,"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"),c(te,"href","#transformers.YolosFeatureExtractor"),c(B,"class","relative group"),c(nt,"href","/docs/transformers/pr_17548/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(it,"href","/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrForObjectDetection"),c(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(lt,"href","/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrForSegmentation"),c(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ct,"href","/docs/transformers/pr_17548/en/model_doc/detr#transformers.DetrForSegmentation"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ie,"id","transformers.YolosModel"),c(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"),c(ie,"href","#transformers.YolosModel"),c(V,"class","relative group"),c(Ne,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ne,"rel","nofollow"),c(dt,"href","/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosModel"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"id","transformers.YolosForObjectDetection"),c(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"),c(de,"href","#transformers.YolosForObjectDetection"),c(H,"class","relative group"),c(Ue,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ue,"rel","nofollow"),c(ht,"href","/docs/transformers/pr_17548/en/model_doc/yolos#transformers.YolosForObjectDetection"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"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,p){e(document.head,d),u(t,b,p),u(t,g,p),e(g,f),e(f,v),w(l,v,null),e(g,_),e(g,C),e(C,Yo),u(t,Wt,p),u(t,A,p),e(A,G),e(G,xt),w(be,xt,null),e(A,Eo),e(A,wt),e(wt,Oo),u(t,Bt,p),u(t,M,p),e(M,Fo),e(M,ve),e(ve,zo),e(M,ko),e(M,Qe),e(Qe,jo),e(M,Do),u(t,Vt,p),u(t,Xe,p),e(Xe,Co),u(t,Ut,p),u(t,Ke,p),e(Ke,$t),e($t,Po),u(t,Ht,p),u(t,Ze,p),e(Ze,Lo),u(t,Jt,p),u(t,Q,p),e(Q,P),e(P,qo),e(P,et),e(et,Mo),e(P,Io),e(P,tt),e(tt,So),e(P,Ao),e(P,Tt),e(Tt,No),e(P,Ro),e(Q,Wo),e(Q,ye),e(ye,Bo),e(ye,xe),e(xe,Vo),e(ye,Uo),u(t,Gt,p),u(t,X,p),u(t,Qt,p),u(t,K,p),e(K,Ho),e(K,ot),e(ot,Jo),e(K,Go),u(t,Xt,p),u(t,I,p),e(I,Qo),e(I,we),e(we,Xo),e(I,Ko),e(I,$e),e($e,Zo),e(I,er),u(t,Kt,p),u(t,N,p),e(N,Z),e(Z,Yt),w(Te,Yt,null),e(N,tr),e(N,Et),e(Et,or),u(t,Zt,p),u(t,z,p),w(Ye,z,null),e(z,rr),e(z,R),e(R,sr),e(R,rt),e(rt,ar),e(R,nr),e(R,Ee),e(Ee,ir),e(R,lr),e(z,cr),e(z,W),e(W,dr),e(W,st),e(st,hr),e(W,mr),e(W,at),e(at,pr),e(W,fr),e(z,ur),w(ee,z,null),u(t,eo,p),u(t,B,p),e(B,te),e(te,Ot),w(Oe,Ot,null),e(B,gr),e(B,Ft),e(Ft,_r),u(t,to,p),u(t,E,p),w(Fe,E,null),e(E,br),e(E,zt),e(zt,vr),e(E,yr),e(E,ze),e(ze,xr),e(ze,nt),e(nt,wr),e(ze,$r),e(E,Tr),e(E,S),w(ke,S,null),e(S,Yr),e(S,kt),e(kt,Er),e(S,Or),w(oe,S,null),e(E,Fr),e(E,re),w(je,re,null),e(re,zr),e(re,jt),e(jt,kr),e(E,jr),e(E,se),w(De,se,null),e(se,Dr),e(se,Ce),e(Ce,Cr),e(Ce,it),e(it,Pr),e(Ce,Lr),e(E,qr),e(E,ae),w(Pe,ae,null),e(ae,Mr),e(ae,Le),e(Le,Ir),e(Le,lt),e(lt,Sr),e(Le,Ar),e(E,Nr),e(E,ne),w(qe,ne,null),e(ne,Rr),e(ne,Me),e(Me,Wr),e(Me,ct),e(ct,Br),e(Me,Vr),u(t,oo,p),u(t,V,p),e(V,ie),e(ie,Dt),w(Ie,Dt,null),e(V,Ur),e(V,Ct),e(Ct,Hr),u(t,ro,p),u(t,L,p),w(Se,L,null),e(L,Jr),e(L,Ae),e(Ae,Gr),e(Ae,Ne),e(Ne,Qr),e(Ae,Xr),e(L,Kr),e(L,j),w(Re,j,null),e(j,Zr),e(j,U),e(U,es),e(U,dt),e(dt,ts),e(U,os),e(U,Pt),e(Pt,rs),e(U,ss),e(j,as),w(le,j,null),e(j,ns),w(ce,j,null),u(t,so,p),u(t,H,p),e(H,de),e(de,Lt),w(We,Lt,null),e(H,is),e(H,qt),e(qt,ls),u(t,ao,p),u(t,k,p),w(Be,k,null),e(k,cs),e(k,Mt),e(Mt,ds),e(k,hs),e(k,Ve),e(Ve,ms),e(Ve,Ue),e(Ue,ps),e(Ve,fs),e(k,us),e(k,D),w(He,D,null),e(D,gs),e(D,J),e(J,_s),e(J,ht),e(ht,bs),e(J,vs),e(J,It),e(It,ys),e(J,xs),e(D,ws),w(he,D,null),e(D,$s),w(me,D,null),no=!0},p(t,[p]){const Je={};p&2&&(Je.$$scope={dirty:p,ctx:t}),ee.$set(Je);const St={};p&2&&(St.$$scope={dirty:p,ctx:t}),oe.$set(St);const At={};p&2&&(At.$$scope={dirty:p,ctx:t}),le.$set(At);const Nt={};p&2&&(Nt.$$scope={dirty:p,ctx:t}),ce.$set(Nt);const Ge={};p&2&&(Ge.$$scope={dirty:p,ctx:t}),he.$set(Ge);const Rt={};p&2&&(Rt.$$scope={dirty:p,ctx:t}),me.$set(Rt)},i(t){no||($(l.$$.fragment,t),$(be.$$.fragment,t),$(Te.$$.fragment,t),$(Ye.$$.fragment,t),$(ee.$$.fragment,t),$(Oe.$$.fragment,t),$(Fe.$$.fragment,t),$(ke.$$.fragment,t),$(oe.$$.fragment,t),$(je.$$.fragment,t),$(De.$$.fragment,t),$(Pe.$$.fragment,t),$(qe.$$.fragment,t),$(Ie.$$.fragment,t),$(Se.$$.fragment,t),$(Re.$$.fragment,t),$(le.$$.fragment,t),$(ce.$$.fragment,t),$(We.$$.fragment,t),$(Be.$$.fragment,t),$(He.$$.fragment,t),$(he.$$.fragment,t),$(me.$$.fragment,t),no=!0)},o(t){T(l.$$.fragment,t),T(be.$$.fragment,t),T(Te.$$.fragment,t),T(Ye.$$.fragment,t),T(ee.$$.fragment,t),T(Oe.$$.fragment,t),T(Fe.$$.fragment,t),T(ke.$$.fragment,t),T(oe.$$.fragment,t),T(je.$$.fragment,t),T(De.$$.fragment,t),T(Pe.$$.fragment,t),T(qe.$$.fragment,t),T(Ie.$$.fragment,t),T(Se.$$.fragment,t),T(Re.$$.fragment,t),T(le.$$.fragment,t),T(ce.$$.fragment,t),T(We.$$.fragment,t),T(Be.$$.fragment,t),T(He.$$.fragment,t),T(he.$$.fragment,t),T(me.$$.fragment,t),no=!1},d(t){o(d),t&&o(b),t&&o(g),Y(l),t&&o(Wt),t&&o(A),Y(be),t&&o(Bt),t&&o(M),t&&o(Vt),t&&o(Xe),t&&o(Ut),t&&o(Ke),t&&o(Ht),t&&o(Ze),t&&o(Jt),t&&o(Q),t&&o(Gt),t&&o(X),t&&o(Qt),t&&o(K),t&&o(Xt),t&&o(I),t&&o(Kt),t&&o(N),Y(Te),t&&o(Zt),t&&o(z),Y(Ye),Y(ee),t&&o(eo),t&&o(B),Y(Oe),t&&o(to),t&&o(E),Y(Fe),Y(ke),Y(oe),Y(je),Y(De),Y(Pe),Y(qe),t&&o(oo),t&&o(V),Y(Ie),t&&o(ro),t&&o(L),Y(Se),Y(Re),Y(le),Y(ce),t&&o(so),t&&o(H),Y(We),t&&o(ao),t&&o(k),Y(Be),Y(He),Y(he),Y(me)}}}const Ca={local:"yolos",sections:[{local:"overview",title:"Overview"},{local:"transformers.YolosConfig",title:"YolosConfig"},{local:"transformers.YolosFeatureExtractor",title:"YolosFeatureExtractor"},{local:"transformers.YolosModel",title:"YolosModel"},{local:"transformers.YolosForObjectDetection",title:"YolosForObjectDetection"}],title:"YOLOS"};function Pa(F){return Ya(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Na extends ya{constructor(d){super();xa(this,d,Pa,Da,wa,{})}}export{Na as default,Ca as metadata};
