import{S as Bn,i as Gn,s as Vn,e as r,k as f,w as v,t as s,M as Jn,c as n,d as t,m as h,a,x as w,h as i,b as d,N as Xn,G as e,g as p,y,q as x,o as $,B as j,v as Yn,L as Yr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Un}from"../../chunks/Tip-hf-doc-builder.js";import{D as Po}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Kr}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as lo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Xr}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Kn}from"../../chunks/PipelineTag-hf-doc-builder.js";function Qn(E){let m,T,_,u,b;return u=new Kr({props:{code:`from transformers import TableTransformerModel, TableTransformerConfig

# Initializing a Table Transformer microsoft/table-transformer-detection style configuration
configuration = TableTransformerConfig()

# Initializing a model from the microsoft/table-transformer-detection style configuration
model = TableTransformerModel(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> TableTransformerModel, TableTransformerConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Table Transformer microsoft/table-transformer-detection style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = TableTransformerConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the microsoft/table-transformer-detection style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TableTransformerModel(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(){m=r("p"),T=s("Examples:"),_=f(),v(u.$$.fragment)},l(l){m=n(l,"P",{});var g=a(m);T=i(g,"Examples:"),g.forEach(t),_=h(l),w(u.$$.fragment,l)},m(l,g){p(l,m,g),e(m,T),p(l,_,g),y(u,l,g),b=!0},p:Yr,i(l){b||(x(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(m),l&&t(_),j(u,l)}}}function Zn(E){let m,T,_,u,b;return{c(){m=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),b=s(`
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){m=n(l,"P",{});var g=a(m);T=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var F=a(_);u=i(F,"Module"),F.forEach(t),b=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(l,g){p(l,m,g),e(m,T),e(m,_),e(_,u),e(m,b)},d(l){l&&t(m)}}}function ea(E){let m,T,_,u,b;return u=new Kr({props:{code:`from transformers import AutoImageProcessor, TableTransformerModel
from huggingface_hub import hf_hub_download
from PIL import Image

file_path = hf_hub_download(repo_id="nielsr/example-pdf", repo_type="dataset", filename="example_pdf.png")
image = Image.open(file_path).convert("RGB")

image_processor = AutoImageProcessor.from_pretrained("microsoft/table-transformer-detection")
model = TableTransformerModel.from_pretrained("microsoft/table-transformer-detection")

# prepare image for the model
inputs = image_processor(images=image, return_tensors="pt")

# forward pass
outputs = model(**inputs)

# the last hidden states are the final query embeddings of the Transformer decoder
# these are of shape (batch_size, num_queries, hidden_size)
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> AutoImageProcessor, TableTransformerModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<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>file_path = hf_hub_download(repo_id=<span class="hljs-string">&quot;nielsr/example-pdf&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>, filename=<span class="hljs-string">&quot;example_pdf.png&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(file_path).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/table-transformer-detection&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TableTransformerModel.from_pretrained(<span class="hljs-string">&quot;microsoft/table-transformer-detection&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the last hidden states are the final query embeddings of the Transformer decoder</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># these are of shape (batch_size, num_queries, hidden_size)</span>
<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">15</span>, <span class="hljs-number">256</span>]`}}),{c(){m=r("p"),T=s("Examples:"),_=f(),v(u.$$.fragment)},l(l){m=n(l,"P",{});var g=a(m);T=i(g,"Examples:"),g.forEach(t),_=h(l),w(u.$$.fragment,l)},m(l,g){p(l,m,g),e(m,T),p(l,_,g),y(u,l,g),b=!0},p:Yr,i(l){b||(x(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(m),l&&t(_),j(u,l)}}}function oa(E){let m,T,_,u,b;return{c(){m=r("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r("code"),u=s("Module"),b=s(`
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){m=n(l,"P",{});var g=a(m);T=i(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n(g,"CODE",{});var F=a(_);u=i(F,"Module"),F.forEach(t),b=i(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(t)},m(l,g){p(l,m,g),e(m,T),e(m,_),e(_,u),e(m,b)},d(l){l&&t(m)}}}function ta(E){let m,T,_,u,b;return u=new Kr({props:{code:`from huggingface_hub import hf_hub_download
from transformers import AutoImageProcessor, TableTransformerForObjectDetection
import torch
from PIL import Image

file_path = hf_hub_download(repo_id="nielsr/example-pdf", repo_type="dataset", filename="example_pdf.png")
image = Image.open(file_path).convert("RGB")

image_processor = AutoImageProcessor.from_pretrained("microsoft/table-transformer-detection")
model = TableTransformerForObjectDetection.from_pretrained("microsoft/table-transformer-detection")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)

# convert outputs (bounding boxes and class logits) to COCO API
target_sizes = torch.tensor([image.size[::-1]])
results = image_processor.post_process_object_detection(outputs, threshold=0.9, target_sizes=target_sizes)[
    0
]

for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    box = [round(i, 2) for i in box.tolist()]
    print(
        f"Detected {model.config.id2label[label.item()]} with confidence "
        f"{round(score.item(), 3)} at location {box}"
    )`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TableTransformerForObjectDetection
<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> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(repo_id=<span class="hljs-string">&quot;nielsr/example-pdf&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>, filename=<span class="hljs-string">&quot;example_pdf.png&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(file_path).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/table-transformer-detection&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TableTransformerForObjectDetection.from_pretrained(<span class="hljs-string">&quot;microsoft/table-transformer-detection&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_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><span class="hljs-comment"># convert outputs (bounding boxes and class logits) to COCO API</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>results = image_processor.post_process_object_detection(outputs, threshold=<span class="hljs-number">0.9</span>, target_sizes=target_sizes)[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> score, label, box <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(results[<span class="hljs-string">&quot;scores&quot;</span>], results[<span class="hljs-string">&quot;labels&quot;</span>], results[<span class="hljs-string">&quot;boxes&quot;</span>]):
<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-meta">... </span>        <span class="hljs-string">f&quot;Detected <span class="hljs-subst">{model.config.id2label[label.item()]}</span> with confidence &quot;</span>
<span class="hljs-meta">... </span>        <span class="hljs-string">f&quot;<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>
<span class="hljs-meta">... </span>    )
Detected table <span class="hljs-keyword">with</span> confidence <span class="hljs-number">1.0</span> at location [<span class="hljs-number">202.1</span>, <span class="hljs-number">210.59</span>, <span class="hljs-number">1119.22</span>, <span class="hljs-number">385.09</span>]`}}),{c(){m=r("p"),T=s("Examples:"),_=f(),v(u.$$.fragment)},l(l){m=n(l,"P",{});var g=a(m);T=i(g,"Examples:"),g.forEach(t),_=h(l),w(u.$$.fragment,l)},m(l,g){p(l,m,g),e(m,T),p(l,_,g),y(u,l,g),b=!0},p:Yr,i(l){b||(x(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(m),l&&t(_),j(u,l)}}}function ra(E){let m,T,_,u,b,l,g,F,it,Eo,O,J,co,me,lt,mo,dt,Co,z,ct,fe,mt,ft,Se,ht,pt,Mo,Re,ut,Fo,He,fo,gt,zo,We,_t,Ao,X,N,bt,he,Tt,vt,pe,wt,yt,xt,L,$t,Ue,jt,kt,Be,qt,Pt,Do,Y,Qr,Io,K,Et,Ge,Ct,Mt,Oo,A,Ft,ue,zt,At,ge,Dt,It,No,S,Q,ho,_e,Ot,po,Nt,Lo,be,So,Z,Te,Lt,ve,St,Rt,Ht,we,Wt,ye,Ut,Bt,Ro,R,ee,uo,xe,Gt,go,Vt,Ho,P,$e,Jt,H,Xt,Ve,Yt,Kt,je,Qt,Zt,er,W,or,Je,tr,rr,Xe,nr,ar,sr,oe,Wo,U,te,_o,ke,ir,bo,lr,Uo,k,qe,dr,To,cr,mr,Pe,fr,Ye,hr,pr,ur,Ee,gr,Ce,_r,br,Tr,C,Me,vr,B,wr,Ke,yr,xr,vo,$r,jr,kr,re,qr,ne,Bo,G,ae,wo,Fe,Pr,yo,Er,Go,q,ze,Cr,xo,Mr,Fr,Ae,zr,Qe,Ar,Dr,Ir,De,Or,Ie,Nr,Lr,Sr,M,Oe,Rr,V,Hr,Ze,Wr,Ur,$o,Br,Gr,Vr,se,Jr,ie,Vo;return l=new lo({}),me=new lo({}),_e=new lo({}),be=new Kn({props:{pipeline:"object-detection"}}),xe=new lo({}),$e=new Po({props:{name:"class transformers.TableTransformerConfig",anchor:"transformers.TableTransformerConfig",parameters:[{name:"use_timm_backbone",val:" = True"},{name:"backbone_config",val:" = None"},{name:"num_channels",val:" = 3"},{name:"num_queries",val:" = 100"},{name:"encoder_layers",val:" = 6"},{name:"encoder_ffn_dim",val:" = 2048"},{name:"encoder_attention_heads",val:" = 8"},{name:"decoder_layers",val:" = 6"},{name:"decoder_ffn_dim",val:" = 2048"},{name:"decoder_attention_heads",val:" = 8"},{name:"encoder_layerdrop",val:" = 0.0"},{name:"decoder_layerdrop",val:" = 0.0"},{name:"is_encoder_decoder",val:" = True"},{name:"activation_function",val:" = 'relu'"},{name:"d_model",val:" = 256"},{name:"dropout",val:" = 0.1"},{name:"attention_dropout",val:" = 0.0"},{name:"activation_dropout",val:" = 0.0"},{name:"init_std",val:" = 0.02"},{name:"init_xavier_std",val:" = 1.0"},{name:"classifier_dropout",val:" = 0.0"},{name:"scale_embedding",val:" = False"},{name:"auxiliary_loss",val:" = False"},{name:"position_embedding_type",val:" = 'sine'"},{name:"backbone",val:" = 'resnet50'"},{name:"use_pretrained_backbone",val:" = True"},{name:"dilation",val:" = False"},{name:"class_cost",val:" = 1"},{name:"bbox_cost",val:" = 5"},{name:"giou_cost",val:" = 2"},{name:"mask_loss_coefficient",val:" = 1"},{name:"dice_loss_coefficient",val:" = 1"},{name:"bbox_loss_coefficient",val:" = 5"},{name:"giou_loss_coefficient",val:" = 2"},{name:"eos_coefficient",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TableTransformerConfig.use_timm_backbone",description:`<strong>use_timm_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use the <code>timm</code> library for the backbone. If set to <code>False</code>, will use the <code>AutoBackbone</code>
API.`,name:"use_timm_backbone"},{anchor:"transformers.TableTransformerConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>) &#x2014;
The configuration of the backbone model. Only used in case <code>use_timm_backbone</code> is set to <code>False</code> in which
case it will default to <code>ResNetConfig()</code>.`,name:"backbone_config"},{anchor:"transformers.TableTransformerConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.TableTransformerConfig.num_queries",description:`<strong>num_queries</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
Number of object queries, i.e. detection slots. This is the maximal number of objects
<a href="/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerModel">TableTransformerModel</a> can detect in a single image. For COCO, we recommend 100 queries.`,name:"num_queries"},{anchor:"transformers.TableTransformerConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimension of the layers.`,name:"d_model"},{anchor:"transformers.TableTransformerConfig.encoder_layers",description:`<strong>encoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of encoder layers.`,name:"encoder_layers"},{anchor:"transformers.TableTransformerConfig.decoder_layers",description:`<strong>decoder_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of decoder layers.`,name:"decoder_layers"},{anchor:"transformers.TableTransformerConfig.encoder_attention_heads",description:`<strong>encoder_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:"encoder_attention_heads"},{anchor:"transformers.TableTransformerConfig.decoder_attention_heads",description:`<strong>decoder_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"decoder_attention_heads"},{anchor:"transformers.TableTransformerConfig.decoder_ffn_dim",description:`<strong>decoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"decoder_ffn_dim"},{anchor:"transformers.TableTransformerConfig.encoder_ffn_dim",description:`<strong>encoder_ffn_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in decoder.`,name:"encoder_ffn_dim"},{anchor:"transformers.TableTransformerConfig.activation_function",description:`<strong>activation_function</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;relu&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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"activation_function"},{anchor:"transformers.TableTransformerConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.TableTransformerConfig.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.TableTransformerConfig.activation_dropout",description:`<strong>activation_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for activations inside the fully connected layer.`,name:"activation_dropout"},{anchor:"transformers.TableTransformerConfig.init_std",description:`<strong>init_std</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:"init_std"},{anchor:"transformers.TableTransformerConfig.init_xavier_std",description:`<strong>init_xavier_std</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
The scaling factor used for the Xavier initialization gain in the HM Attention map module.`,name:"init_xavier_std"},{anchor:"transformers.TableTransformerConfig.encoder_layerdrop",description:`<strong>encoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the encoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"encoder_layerdrop"},{anchor:"transformers.TableTransformerConfig.decoder_layerdrop",description:`<strong>decoder_layerdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The LayerDrop probability for the decoder. See the [LayerDrop paper](see <a href="https://arxiv.org/abs/1909.11556" rel="nofollow">https://arxiv.org/abs/1909.11556</a>)
for more details.`,name:"decoder_layerdrop"},{anchor:"transformers.TableTransformerConfig.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.TableTransformerConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;sine&quot;</code>) &#x2014;
Type of position embeddings to be used on top of the image features. One of <code>&quot;sine&quot;</code> or <code>&quot;learned&quot;</code>.`,name:"position_embedding_type"},{anchor:"transformers.TableTransformerConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;resnet50&quot;</code>) &#x2014;
Name of convolutional backbone to use in case <code>use_timm_backbone</code> = <code>True</code>. Supports any convolutional
backbone from the timm package. For a list of all available models, see <a href="https://rwightman.github.io/pytorch-image-models/#load-a-pretrained-model" rel="nofollow">this
page</a>.`,name:"backbone"},{anchor:"transformers.TableTransformerConfig.use_pretrained_backbone",description:`<strong>use_pretrained_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use pretrained weights for the backbone. Only supported when <code>use_timm_backbone</code> = <code>True</code>.`,name:"use_pretrained_backbone"},{anchor:"transformers.TableTransformerConfig.dilation",description:`<strong>dilation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to replace stride with dilation in the last convolutional block (DC5). Only supported when
<code>use_timm_backbone</code> = <code>True</code>.`,name:"dilation"},{anchor:"transformers.TableTransformerConfig.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.TableTransformerConfig.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.TableTransformerConfig.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.TableTransformerConfig.mask_loss_coefficient",description:`<strong>mask_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the Focal loss in the panoptic segmentation loss.`,name:"mask_loss_coefficient"},{anchor:"transformers.TableTransformerConfig.dice_loss_coefficient",description:`<strong>dice_loss_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
Relative weight of the DICE/F-1 loss in the panoptic segmentation loss.`,name:"dice_loss_coefficient"},{anchor:"transformers.TableTransformerConfig.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.TableTransformerConfig.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.TableTransformerConfig.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/main/src/transformers/models/table_transformer/configuration_table_transformer.py#L37"}}),oe=new Xr({props:{anchor:"transformers.TableTransformerConfig.example",$$slots:{default:[Qn]},$$scope:{ctx:E}}}),ke=new lo({}),qe=new Po({props:{name:"class transformers.TableTransformerModel",anchor:"transformers.TableTransformerModel",parameters:[{name:"config",val:": TableTransformerConfig"}],parametersDescription:[{anchor:"transformers.TableTransformerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerConfig">TableTransformerConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/table_transformer/modeling_table_transformer.py#L1145"}}),Me=new Po({props:{name:"forward",anchor:"transformers.TableTransformerModel.forward",parameters:[{name:"pixel_values",val:""},{name:"pixel_mask",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.TableTransformerModel.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. Padding will be ignored by default should you provide it.</p>
<p>Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/detr#transformers.DetrImageProcessor">DetrImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TableTransformerModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.TableTransformerModel.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) &#x2014;
Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.TableTransformerModel.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.TableTransformerModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing the flattened feature map (output of the backbone + projection layer), you
can choose to directly pass a flattened representation of an image.`,name:"inputs_embeds"},{anchor:"transformers.TableTransformerModel.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of initializing the queries with a tensor of zeros, you can choose to directly pass an
embedded representation.`,name:"decoder_inputs_embeds"},{anchor:"transformers.TableTransformerModel.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.TableTransformerModel.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.TableTransformerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/table_transformer/modeling_table_transformer.py#L1180",returnDescription:`
<p>A <code>transformers.models.table_transformer.modeling_table_transformer.TableTransformerModelOutput</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/main/en/model_doc/table-transformer#transformers.TableTransformerConfig"
>TableTransformerConfig</a>) and inputs.</p>
<ul>
<li><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 decoder of the model.</li>
<li><strong>decoder_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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>decoder_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 of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>cross_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 of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
<li><strong>encoder_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 encoder of the model.</li>
<li><strong>encoder_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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_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 of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>intermediate_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(config.decoder_layers, batch_size, sequence_length, hidden_size)</code>, <em>optional</em>, returned when <code>config.auxiliary_loss=True</code>) \u2014 Intermediate decoder activations, i.e. the output of each decoder layer, each of them gone through a
layernorm.</li>
</ul>
`,returnType:`
<p><code>transformers.models.table_transformer.modeling_table_transformer.TableTransformerModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),re=new Un({props:{$$slots:{default:[Zn]},$$scope:{ctx:E}}}),ne=new Xr({props:{anchor:"transformers.TableTransformerModel.forward.example",$$slots:{default:[ea]},$$scope:{ctx:E}}}),Fe=new lo({}),ze=new Po({props:{name:"class transformers.TableTransformerForObjectDetection",anchor:"transformers.TableTransformerForObjectDetection",parameters:[{name:"config",val:": TableTransformerConfig"}],parametersDescription:[{anchor:"transformers.TableTransformerForObjectDetection.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerConfig">TableTransformerConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/table_transformer/modeling_table_transformer.py#L1314"}}),Oe=new Po({props:{name:"forward",anchor:"transformers.TableTransformerForObjectDetection.forward",parameters:[{name:"pixel_values",val:""},{name:"pixel_mask",val:" = None"},{name:"decoder_attention_mask",val:" = None"},{name:"encoder_outputs",val:" = None"},{name:"inputs_embeds",val:" = None"},{name:"decoder_inputs_embeds",val:" = None"},{name:"labels",val:" = None"},{name:"output_attentions",val:" = None"},{name:"output_hidden_states",val:" = None"},{name:"return_dict",val:" = None"}],parametersDescription:[{anchor:"transformers.TableTransformerForObjectDetection.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. Padding will be ignored by default should you provide it.</p>
<p>Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/detr#transformers.DetrImageProcessor">DetrImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TableTransformerForObjectDetection.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, height, width)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel values. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for pixels that are real (i.e. <strong>not masked</strong>),</li>
<li>0 for pixels that are padding (i.e. <strong>masked</strong>).</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"pixel_mask"},{anchor:"transformers.TableTransformerForObjectDetection.forward.decoder_attention_mask",description:`<strong>decoder_attention_mask</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_queries)</code>, <em>optional</em>) &#x2014;
Not used by default. Can be used to mask object queries.`,name:"decoder_attention_mask"},{anchor:"transformers.TableTransformerForObjectDetection.forward.encoder_outputs",description:`<strong>encoder_outputs</strong> (<code>tuple(tuple(torch.FloatTensor)</code>, <em>optional</em>) &#x2014;
Tuple consists of (<code>last_hidden_state</code>, <em>optional</em>: <code>hidden_states</code>, <em>optional</em>: <code>attentions</code>)
<code>last_hidden_state</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) is a sequence of
hidden-states at the output of the last layer of the encoder. Used in the cross-attention of the decoder.`,name:"encoder_outputs"},{anchor:"transformers.TableTransformerForObjectDetection.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing the flattened feature map (output of the backbone + projection layer), you
can choose to directly pass a flattened representation of an image.`,name:"inputs_embeds"},{anchor:"transformers.TableTransformerForObjectDetection.forward.decoder_inputs_embeds",description:`<strong>decoder_inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_queries, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of initializing the queries with a tensor of zeros, you can choose to directly pass an
embedded representation.`,name:"decoder_inputs_embeds"},{anchor:"transformers.TableTransformerForObjectDetection.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.TableTransformerForObjectDetection.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.TableTransformerForObjectDetection.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TableTransformerForObjectDetection.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: &#x2018;class_labels&#x2019; and &#x2018;boxes&#x2019; (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/main/src/transformers/models/table_transformer/modeling_table_transformer.py#L1341",returnDescription:`
<p>A <code>transformers.models.table_transformer.modeling_table_transformer.TableTransformerObjectDetectionOutput</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/main/en/model_doc/table-transformer#transformers.TableTransformerConfig"
>TableTransformerConfig</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 <code>~TableTransformerImageProcessor.post_process_object_detection</code> 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>decoder_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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the decoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>decoder_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 of the decoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
<li><strong>cross_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 of the decoder\u2019s cross-attention layer, after the attention softmax,
used to compute the weighted average in the cross-attention heads.</li>
<li><strong>encoder_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 encoder of the model.</li>
<li><strong>encoder_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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the encoder at the output of each
layer plus the initial embedding outputs.</li>
<li><strong>encoder_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 of the encoder, after the attention softmax, used to compute the
weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.table_transformer.modeling_table_transformer.TableTransformerObjectDetectionOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),se=new Un({props:{$$slots:{default:[oa]},$$scope:{ctx:E}}}),ie=new Xr({props:{anchor:"transformers.TableTransformerForObjectDetection.forward.example",$$slots:{default:[ta]},$$scope:{ctx:E}}}),{c(){m=r("meta"),T=f(),_=r("h1"),u=r("a"),b=r("span"),v(l.$$.fragment),g=f(),F=r("span"),it=s("Table Transformer"),Eo=f(),O=r("h2"),J=r("a"),co=r("span"),v(me.$$.fragment),lt=f(),mo=r("span"),dt=s("Overview"),Co=f(),z=r("p"),ct=s("The Table Transformer model was proposed in "),fe=r("a"),mt=s("PubTables-1M: Towards comprehensive table extraction from unstructured documents"),ft=s(` by
Brandon Smock, Rohith Pesala, Robin Abraham. The authors introduce a new dataset, PubTables-1M, to benchmark progress in table extraction from unstructured documents,
as well as table structure recognition and functional analysis. The authors train 2 `),Se=r("a"),ht=s("DETR"),pt=s(" models, one for table detection and one for table structure recognition, dubbed Table Transformers."),Mo=f(),Re=r("p"),ut=s("The abstract from the paper is the following:"),Fo=f(),He=r("p"),fo=r("em"),gt=s(`Recently, significant progress has been made applying machine learning to the problem of table structure inference and extraction from unstructured documents.
However, one of the greatest challenges remains the creation of datasets with complete, unambiguous ground truth at scale. To address this, we develop a new, more
comprehensive dataset for table extraction, called PubTables-1M. PubTables-1M contains nearly one million tables from scientific articles, supports multiple input
modalities, and contains detailed header and location information for table structures, making it useful for a wide variety of modeling approaches. It also addresses a significant
source of ground truth inconsistency observed in prior datasets called oversegmentation, using a novel canonicalization procedure. We demonstrate that these improvements lead to a
significant increase in training performance and a more reliable estimate of model performance at evaluation for table structure recognition. Further, we show that transformer-based
object detection models trained on PubTables-1M produce excellent results for all three tasks of detection, structure recognition, and functional analysis without the need for any
special customization for these tasks.`),zo=f(),We=r("p"),_t=s("Tips:"),Ao=f(),X=r("ul"),N=r("li"),bt=s("The authors released 2 models, one for "),he=r("a"),Tt=s("table detection"),vt=s(" in documents, one for "),pe=r("a"),wt=s("table structure recognition"),yt=s(" (the task of recognizing the individual rows, columns etc. in a table)."),xt=f(),L=r("li"),$t=s("One can use the "),Ue=r("a"),jt=s("AutoImageProcessor"),kt=s(" API to prepare images and optional targets for the model. This will load a "),Be=r("a"),qt=s("DetrImageProcessor"),Pt=s(" behind the scenes."),Do=f(),Y=r("img"),Io=f(),K=r("small"),Et=s("Table detection and table structure recognition clarified. Taken from the "),Ge=r("a"),Ct=s("original paper"),Mt=s("."),Oo=f(),A=r("p"),Ft=s("This model was contributed by "),ue=r("a"),zt=s("nielsr"),At=s(`. The original code can be
found `),ge=r("a"),Dt=s("here"),It=s("."),No=f(),S=r("h2"),Q=r("a"),ho=r("span"),v(_e.$$.fragment),Ot=f(),po=r("span"),Nt=s("Resources"),Lo=f(),v(be.$$.fragment),So=f(),Z=r("ul"),Te=r("li"),Lt=s("A demo notebook for the Table Transformer can be found "),ve=r("a"),St=s("here"),Rt=s("."),Ht=f(),we=r("li"),Wt=s("It turns out padding of images is quite important for detection. An interesting Github thread with replies from the authors can be found "),ye=r("a"),Ut=s("here"),Bt=s("."),Ro=f(),R=r("h2"),ee=r("a"),uo=r("span"),v(xe.$$.fragment),Gt=f(),go=r("span"),Vt=s("TableTransformerConfig"),Ho=f(),P=r("div"),v($e.$$.fragment),Jt=f(),H=r("p"),Xt=s("This is the configuration class to store the configuration of a "),Ve=r("a"),Yt=s("TableTransformerModel"),Kt=s(`. It is used to
instantiate a Table Transformer 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 Table Transformer
`),je=r("a"),Qt=s("microsoft/table-transformer-detection"),Zt=s(" architecture."),er=f(),W=r("p"),or=s("Configuration objects inherit from "),Je=r("a"),tr=s("PretrainedConfig"),rr=s(` and can be used to control the model outputs. Read the
documentation from `),Xe=r("a"),nr=s("PretrainedConfig"),ar=s(" for more information."),sr=f(),v(oe.$$.fragment),Wo=f(),U=r("h2"),te=r("a"),_o=r("span"),v(ke.$$.fragment),ir=f(),bo=r("span"),lr=s("TableTransformerModel"),Uo=f(),k=r("div"),v(qe.$$.fragment),dr=f(),To=r("p"),cr=s(`The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),mr=f(),Pe=r("p"),fr=s("This model inherits from "),Ye=r("a"),hr=s("PreTrainedModel"),pr=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ur=f(),Ee=r("p"),gr=s("This model is also a PyTorch "),Ce=r("a"),_r=s("torch.nn.Module"),br=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tr=f(),C=r("div"),v(Me.$$.fragment),vr=f(),B=r("p"),wr=s("The "),Ke=r("a"),yr=s("TableTransformerModel"),xr=s(" forward method, overrides the "),vo=r("code"),$r=s("__call__"),jr=s(" special method."),kr=f(),v(re.$$.fragment),qr=f(),v(ne.$$.fragment),Bo=f(),G=r("h2"),ae=r("a"),wo=r("span"),v(Fe.$$.fragment),Pr=f(),yo=r("span"),Er=s("TableTransformerForObjectDetection"),Go=f(),q=r("div"),v(ze.$$.fragment),Cr=f(),xo=r("p"),Mr=s(`Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Fr=f(),Ae=r("p"),zr=s("This model inherits from "),Qe=r("a"),Ar=s("PreTrainedModel"),Dr=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ir=f(),De=r("p"),Or=s("This model is also a PyTorch "),Ie=r("a"),Nr=s("torch.nn.Module"),Lr=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sr=f(),M=r("div"),v(Oe.$$.fragment),Rr=f(),V=r("p"),Hr=s("The "),Ze=r("a"),Wr=s("TableTransformerForObjectDetection"),Ur=s(" forward method, overrides the "),$o=r("code"),Br=s("__call__"),Gr=s(" special method."),Vr=f(),v(se.$$.fragment),Jr=f(),v(ie.$$.fragment),this.h()},l(o){const c=Jn('[data-svelte="svelte-1phssyn"]',document.head);m=n(c,"META",{name:!0,content:!0}),c.forEach(t),T=h(o),_=n(o,"H1",{class:!0});var Ne=a(_);u=n(Ne,"A",{id:!0,class:!0,href:!0});var jo=a(u);b=n(jo,"SPAN",{});var ko=a(b);w(l.$$.fragment,ko),ko.forEach(t),jo.forEach(t),g=h(Ne),F=n(Ne,"SPAN",{});var qo=a(F);it=i(qo,"Table Transformer"),qo.forEach(t),Ne.forEach(t),Eo=h(o),O=n(o,"H2",{class:!0});var Le=a(O);J=n(Le,"A",{id:!0,class:!0,href:!0});var Zr=a(J);co=n(Zr,"SPAN",{});var en=a(co);w(me.$$.fragment,en),en.forEach(t),Zr.forEach(t),lt=h(Le),mo=n(Le,"SPAN",{});var on=a(mo);dt=i(on,"Overview"),on.forEach(t),Le.forEach(t),Co=h(o),z=n(o,"P",{});var eo=a(z);ct=i(eo,"The Table Transformer model was proposed in "),fe=n(eo,"A",{href:!0,rel:!0});var tn=a(fe);mt=i(tn,"PubTables-1M: Towards comprehensive table extraction from unstructured documents"),tn.forEach(t),ft=i(eo,` by
Brandon Smock, Rohith Pesala, Robin Abraham. The authors introduce a new dataset, PubTables-1M, to benchmark progress in table extraction from unstructured documents,
as well as table structure recognition and functional analysis. The authors train 2 `),Se=n(eo,"A",{href:!0});var rn=a(Se);ht=i(rn,"DETR"),rn.forEach(t),pt=i(eo," models, one for table detection and one for table structure recognition, dubbed Table Transformers."),eo.forEach(t),Mo=h(o),Re=n(o,"P",{});var nn=a(Re);ut=i(nn,"The abstract from the paper is the following:"),nn.forEach(t),Fo=h(o),He=n(o,"P",{});var an=a(He);fo=n(an,"EM",{});var sn=a(fo);gt=i(sn,`Recently, significant progress has been made applying machine learning to the problem of table structure inference and extraction from unstructured documents.
However, one of the greatest challenges remains the creation of datasets with complete, unambiguous ground truth at scale. To address this, we develop a new, more
comprehensive dataset for table extraction, called PubTables-1M. PubTables-1M contains nearly one million tables from scientific articles, supports multiple input
modalities, and contains detailed header and location information for table structures, making it useful for a wide variety of modeling approaches. It also addresses a significant
source of ground truth inconsistency observed in prior datasets called oversegmentation, using a novel canonicalization procedure. We demonstrate that these improvements lead to a
significant increase in training performance and a more reliable estimate of model performance at evaluation for table structure recognition. Further, we show that transformer-based
object detection models trained on PubTables-1M produce excellent results for all three tasks of detection, structure recognition, and functional analysis without the need for any
special customization for these tasks.`),sn.forEach(t),an.forEach(t),zo=h(o),We=n(o,"P",{});var ln=a(We);_t=i(ln,"Tips:"),ln.forEach(t),Ao=h(o),X=n(o,"UL",{});var Jo=a(X);N=n(Jo,"LI",{});var oo=a(N);bt=i(oo,"The authors released 2 models, one for "),he=n(oo,"A",{href:!0,rel:!0});var dn=a(he);Tt=i(dn,"table detection"),dn.forEach(t),vt=i(oo," in documents, one for "),pe=n(oo,"A",{href:!0,rel:!0});var cn=a(pe);wt=i(cn,"table structure recognition"),cn.forEach(t),yt=i(oo," (the task of recognizing the individual rows, columns etc. in a table)."),oo.forEach(t),xt=h(Jo),L=n(Jo,"LI",{});var to=a(L);$t=i(to,"One can use the "),Ue=n(to,"A",{href:!0});var mn=a(Ue);jt=i(mn,"AutoImageProcessor"),mn.forEach(t),kt=i(to," API to prepare images and optional targets for the model. This will load a "),Be=n(to,"A",{href:!0});var fn=a(Be);qt=i(fn,"DetrImageProcessor"),fn.forEach(t),Pt=i(to," behind the scenes."),to.forEach(t),Jo.forEach(t),Do=h(o),Y=n(o,"IMG",{src:!0,alt:!0,width:!0}),Io=h(o),K=n(o,"SMALL",{});var Xo=a(K);Et=i(Xo,"Table detection and table structure recognition clarified. Taken from the "),Ge=n(Xo,"A",{href:!0});var hn=a(Ge);Ct=i(hn,"original paper"),hn.forEach(t),Mt=i(Xo,"."),Xo.forEach(t),Oo=h(o),A=n(o,"P",{});var ro=a(A);Ft=i(ro,"This model was contributed by "),ue=n(ro,"A",{href:!0,rel:!0});var pn=a(ue);zt=i(pn,"nielsr"),pn.forEach(t),At=i(ro,`. The original code can be
found `),ge=n(ro,"A",{href:!0,rel:!0});var un=a(ge);Dt=i(un,"here"),un.forEach(t),It=i(ro,"."),ro.forEach(t),No=h(o),S=n(o,"H2",{class:!0});var Yo=a(S);Q=n(Yo,"A",{id:!0,class:!0,href:!0});var gn=a(Q);ho=n(gn,"SPAN",{});var _n=a(ho);w(_e.$$.fragment,_n),_n.forEach(t),gn.forEach(t),Ot=h(Yo),po=n(Yo,"SPAN",{});var bn=a(po);Nt=i(bn,"Resources"),bn.forEach(t),Yo.forEach(t),Lo=h(o),w(be.$$.fragment,o),So=h(o),Z=n(o,"UL",{});var Ko=a(Z);Te=n(Ko,"LI",{});var Qo=a(Te);Lt=i(Qo,"A demo notebook for the Table Transformer can be found "),ve=n(Qo,"A",{href:!0,rel:!0});var Tn=a(ve);St=i(Tn,"here"),Tn.forEach(t),Rt=i(Qo,"."),Qo.forEach(t),Ht=h(Ko),we=n(Ko,"LI",{});var Zo=a(we);Wt=i(Zo,"It turns out padding of images is quite important for detection. An interesting Github thread with replies from the authors can be found "),ye=n(Zo,"A",{href:!0,rel:!0});var vn=a(ye);Ut=i(vn,"here"),vn.forEach(t),Bt=i(Zo,"."),Zo.forEach(t),Ko.forEach(t),Ro=h(o),R=n(o,"H2",{class:!0});var et=a(R);ee=n(et,"A",{id:!0,class:!0,href:!0});var wn=a(ee);uo=n(wn,"SPAN",{});var yn=a(uo);w(xe.$$.fragment,yn),yn.forEach(t),wn.forEach(t),Gt=h(et),go=n(et,"SPAN",{});var xn=a(go);Vt=i(xn,"TableTransformerConfig"),xn.forEach(t),et.forEach(t),Ho=h(o),P=n(o,"DIV",{class:!0});var le=a(P);w($e.$$.fragment,le),Jt=h(le),H=n(le,"P",{});var no=a(H);Xt=i(no,"This is the configuration class to store the configuration of a "),Ve=n(no,"A",{href:!0});var $n=a(Ve);Yt=i($n,"TableTransformerModel"),$n.forEach(t),Kt=i(no,`. It is used to
instantiate a Table Transformer 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 Table Transformer
`),je=n(no,"A",{href:!0,rel:!0});var jn=a(je);Qt=i(jn,"microsoft/table-transformer-detection"),jn.forEach(t),Zt=i(no," architecture."),no.forEach(t),er=h(le),W=n(le,"P",{});var ao=a(W);or=i(ao,"Configuration objects inherit from "),Je=n(ao,"A",{href:!0});var kn=a(Je);tr=i(kn,"PretrainedConfig"),kn.forEach(t),rr=i(ao,` and can be used to control the model outputs. Read the
documentation from `),Xe=n(ao,"A",{href:!0});var qn=a(Xe);nr=i(qn,"PretrainedConfig"),qn.forEach(t),ar=i(ao," for more information."),ao.forEach(t),sr=h(le),w(oe.$$.fragment,le),le.forEach(t),Wo=h(o),U=n(o,"H2",{class:!0});var ot=a(U);te=n(ot,"A",{id:!0,class:!0,href:!0});var Pn=a(te);_o=n(Pn,"SPAN",{});var En=a(_o);w(ke.$$.fragment,En),En.forEach(t),Pn.forEach(t),ir=h(ot),bo=n(ot,"SPAN",{});var Cn=a(bo);lr=i(Cn,"TableTransformerModel"),Cn.forEach(t),ot.forEach(t),Uo=h(o),k=n(o,"DIV",{class:!0});var D=a(k);w(qe.$$.fragment,D),dr=h(D),To=n(D,"P",{});var Mn=a(To);cr=i(Mn,`The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),Mn.forEach(t),mr=h(D),Pe=n(D,"P",{});var tt=a(Pe);fr=i(tt,"This model inherits from "),Ye=n(tt,"A",{href:!0});var Fn=a(Ye);hr=i(Fn,"PreTrainedModel"),Fn.forEach(t),pr=i(tt,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),tt.forEach(t),ur=h(D),Ee=n(D,"P",{});var rt=a(Ee);gr=i(rt,"This model is also a PyTorch "),Ce=n(rt,"A",{href:!0,rel:!0});var zn=a(Ce);_r=i(zn,"torch.nn.Module"),zn.forEach(t),br=i(rt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rt.forEach(t),Tr=h(D),C=n(D,"DIV",{class:!0});var de=a(C);w(Me.$$.fragment,de),vr=h(de),B=n(de,"P",{});var so=a(B);wr=i(so,"The "),Ke=n(so,"A",{href:!0});var An=a(Ke);yr=i(An,"TableTransformerModel"),An.forEach(t),xr=i(so," forward method, overrides the "),vo=n(so,"CODE",{});var Dn=a(vo);$r=i(Dn,"__call__"),Dn.forEach(t),jr=i(so," special method."),so.forEach(t),kr=h(de),w(re.$$.fragment,de),qr=h(de),w(ne.$$.fragment,de),de.forEach(t),D.forEach(t),Bo=h(o),G=n(o,"H2",{class:!0});var nt=a(G);ae=n(nt,"A",{id:!0,class:!0,href:!0});var In=a(ae);wo=n(In,"SPAN",{});var On=a(wo);w(Fe.$$.fragment,On),On.forEach(t),In.forEach(t),Pr=h(nt),yo=n(nt,"SPAN",{});var Nn=a(yo);Er=i(Nn,"TableTransformerForObjectDetection"),Nn.forEach(t),nt.forEach(t),Go=h(o),q=n(o,"DIV",{class:!0});var I=a(q);w(ze.$$.fragment,I),Cr=h(I),xo=n(I,"P",{});var Ln=a(xo);Mr=i(Ln,`Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Ln.forEach(t),Fr=h(I),Ae=n(I,"P",{});var at=a(Ae);zr=i(at,"This model inherits from "),Qe=n(at,"A",{href:!0});var Sn=a(Qe);Ar=i(Sn,"PreTrainedModel"),Sn.forEach(t),Dr=i(at,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),at.forEach(t),Ir=h(I),De=n(I,"P",{});var st=a(De);Or=i(st,"This model is also a PyTorch "),Ie=n(st,"A",{href:!0,rel:!0});var Rn=a(Ie);Nr=i(Rn,"torch.nn.Module"),Rn.forEach(t),Lr=i(st,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),st.forEach(t),Sr=h(I),M=n(I,"DIV",{class:!0});var ce=a(M);w(Oe.$$.fragment,ce),Rr=h(ce),V=n(ce,"P",{});var io=a(V);Hr=i(io,"The "),Ze=n(io,"A",{href:!0});var Hn=a(Ze);Wr=i(Hn,"TableTransformerForObjectDetection"),Hn.forEach(t),Ur=i(io," forward method, overrides the "),$o=n(io,"CODE",{});var Wn=a($o);Br=i(Wn,"__call__"),Wn.forEach(t),Gr=i(io," special method."),io.forEach(t),Vr=h(ce),w(se.$$.fragment,ce),Jr=h(ce),w(ie.$$.fragment,ce),ce.forEach(t),I.forEach(t),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(na)),d(u,"id","table-transformer"),d(u,"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(u,"href","#table-transformer"),d(_,"class","relative group"),d(J,"id","overview"),d(J,"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(J,"href","#overview"),d(O,"class","relative group"),d(fe,"href","https://arxiv.org/abs/2110.00061"),d(fe,"rel","nofollow"),d(Se,"href","detr"),d(he,"href","https://huggingface.co/microsoft/table-transformer-detection"),d(he,"rel","nofollow"),d(pe,"href","https://huggingface.co/microsoft/table-transformer-structure-recognition"),d(pe,"rel","nofollow"),d(Ue,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor"),d(Be,"href","/docs/transformers/main/en/model_doc/detr#transformers.DetrImageProcessor"),Xn(Y.src,Qr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/table_transformer_architecture.jpeg")||d(Y,"src",Qr),d(Y,"alt","drawing"),d(Y,"width","600"),d(Ge,"href","https://arxiv.org/abs/2110.00061"),d(ue,"href","https://huggingface.co/nielsr"),d(ue,"rel","nofollow"),d(ge,"href","https://github.com/microsoft/table-transformer"),d(ge,"rel","nofollow"),d(Q,"id","resources"),d(Q,"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(Q,"href","#resources"),d(S,"class","relative group"),d(ve,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Table%20Transformer"),d(ve,"rel","nofollow"),d(ye,"href","https://github.com/microsoft/table-transformer/issues/68"),d(ye,"rel","nofollow"),d(ee,"id","transformers.TableTransformerConfig"),d(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ee,"href","#transformers.TableTransformerConfig"),d(R,"class","relative group"),d(Ve,"href","/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerModel"),d(je,"href","https://huggingface.co/microsoft/table-transformer-detection"),d(je,"rel","nofollow"),d(Je,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Xe,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),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(te,"id","transformers.TableTransformerModel"),d(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"),d(te,"href","#transformers.TableTransformerModel"),d(U,"class","relative group"),d(Ye,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ce,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ce,"rel","nofollow"),d(Ke,"href","/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerModel"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"id","transformers.TableTransformerForObjectDetection"),d(ae,"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(ae,"href","#transformers.TableTransformerForObjectDetection"),d(G,"class","relative group"),d(Qe,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ie,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ie,"rel","nofollow"),d(Ze,"href","/docs/transformers/main/en/model_doc/table-transformer#transformers.TableTransformerForObjectDetection"),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(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,c){e(document.head,m),p(o,T,c),p(o,_,c),e(_,u),e(u,b),y(l,b,null),e(_,g),e(_,F),e(F,it),p(o,Eo,c),p(o,O,c),e(O,J),e(J,co),y(me,co,null),e(O,lt),e(O,mo),e(mo,dt),p(o,Co,c),p(o,z,c),e(z,ct),e(z,fe),e(fe,mt),e(z,ft),e(z,Se),e(Se,ht),e(z,pt),p(o,Mo,c),p(o,Re,c),e(Re,ut),p(o,Fo,c),p(o,He,c),e(He,fo),e(fo,gt),p(o,zo,c),p(o,We,c),e(We,_t),p(o,Ao,c),p(o,X,c),e(X,N),e(N,bt),e(N,he),e(he,Tt),e(N,vt),e(N,pe),e(pe,wt),e(N,yt),e(X,xt),e(X,L),e(L,$t),e(L,Ue),e(Ue,jt),e(L,kt),e(L,Be),e(Be,qt),e(L,Pt),p(o,Do,c),p(o,Y,c),p(o,Io,c),p(o,K,c),e(K,Et),e(K,Ge),e(Ge,Ct),e(K,Mt),p(o,Oo,c),p(o,A,c),e(A,Ft),e(A,ue),e(ue,zt),e(A,At),e(A,ge),e(ge,Dt),e(A,It),p(o,No,c),p(o,S,c),e(S,Q),e(Q,ho),y(_e,ho,null),e(S,Ot),e(S,po),e(po,Nt),p(o,Lo,c),y(be,o,c),p(o,So,c),p(o,Z,c),e(Z,Te),e(Te,Lt),e(Te,ve),e(ve,St),e(Te,Rt),e(Z,Ht),e(Z,we),e(we,Wt),e(we,ye),e(ye,Ut),e(we,Bt),p(o,Ro,c),p(o,R,c),e(R,ee),e(ee,uo),y(xe,uo,null),e(R,Gt),e(R,go),e(go,Vt),p(o,Ho,c),p(o,P,c),y($e,P,null),e(P,Jt),e(P,H),e(H,Xt),e(H,Ve),e(Ve,Yt),e(H,Kt),e(H,je),e(je,Qt),e(H,Zt),e(P,er),e(P,W),e(W,or),e(W,Je),e(Je,tr),e(W,rr),e(W,Xe),e(Xe,nr),e(W,ar),e(P,sr),y(oe,P,null),p(o,Wo,c),p(o,U,c),e(U,te),e(te,_o),y(ke,_o,null),e(U,ir),e(U,bo),e(bo,lr),p(o,Uo,c),p(o,k,c),y(qe,k,null),e(k,dr),e(k,To),e(To,cr),e(k,mr),e(k,Pe),e(Pe,fr),e(Pe,Ye),e(Ye,hr),e(Pe,pr),e(k,ur),e(k,Ee),e(Ee,gr),e(Ee,Ce),e(Ce,_r),e(Ee,br),e(k,Tr),e(k,C),y(Me,C,null),e(C,vr),e(C,B),e(B,wr),e(B,Ke),e(Ke,yr),e(B,xr),e(B,vo),e(vo,$r),e(B,jr),e(C,kr),y(re,C,null),e(C,qr),y(ne,C,null),p(o,Bo,c),p(o,G,c),e(G,ae),e(ae,wo),y(Fe,wo,null),e(G,Pr),e(G,yo),e(yo,Er),p(o,Go,c),p(o,q,c),y(ze,q,null),e(q,Cr),e(q,xo),e(xo,Mr),e(q,Fr),e(q,Ae),e(Ae,zr),e(Ae,Qe),e(Qe,Ar),e(Ae,Dr),e(q,Ir),e(q,De),e(De,Or),e(De,Ie),e(Ie,Nr),e(De,Lr),e(q,Sr),e(q,M),y(Oe,M,null),e(M,Rr),e(M,V),e(V,Hr),e(V,Ze),e(Ze,Wr),e(V,Ur),e(V,$o),e($o,Br),e(V,Gr),e(M,Vr),y(se,M,null),e(M,Jr),y(ie,M,null),Vo=!0},p(o,[c]){const Ne={};c&2&&(Ne.$$scope={dirty:c,ctx:o}),oe.$set(Ne);const jo={};c&2&&(jo.$$scope={dirty:c,ctx:o}),re.$set(jo);const ko={};c&2&&(ko.$$scope={dirty:c,ctx:o}),ne.$set(ko);const qo={};c&2&&(qo.$$scope={dirty:c,ctx:o}),se.$set(qo);const Le={};c&2&&(Le.$$scope={dirty:c,ctx:o}),ie.$set(Le)},i(o){Vo||(x(l.$$.fragment,o),x(me.$$.fragment,o),x(_e.$$.fragment,o),x(be.$$.fragment,o),x(xe.$$.fragment,o),x($e.$$.fragment,o),x(oe.$$.fragment,o),x(ke.$$.fragment,o),x(qe.$$.fragment,o),x(Me.$$.fragment,o),x(re.$$.fragment,o),x(ne.$$.fragment,o),x(Fe.$$.fragment,o),x(ze.$$.fragment,o),x(Oe.$$.fragment,o),x(se.$$.fragment,o),x(ie.$$.fragment,o),Vo=!0)},o(o){$(l.$$.fragment,o),$(me.$$.fragment,o),$(_e.$$.fragment,o),$(be.$$.fragment,o),$(xe.$$.fragment,o),$($e.$$.fragment,o),$(oe.$$.fragment,o),$(ke.$$.fragment,o),$(qe.$$.fragment,o),$(Me.$$.fragment,o),$(re.$$.fragment,o),$(ne.$$.fragment,o),$(Fe.$$.fragment,o),$(ze.$$.fragment,o),$(Oe.$$.fragment,o),$(se.$$.fragment,o),$(ie.$$.fragment,o),Vo=!1},d(o){t(m),o&&t(T),o&&t(_),j(l),o&&t(Eo),o&&t(O),j(me),o&&t(Co),o&&t(z),o&&t(Mo),o&&t(Re),o&&t(Fo),o&&t(He),o&&t(zo),o&&t(We),o&&t(Ao),o&&t(X),o&&t(Do),o&&t(Y),o&&t(Io),o&&t(K),o&&t(Oo),o&&t(A),o&&t(No),o&&t(S),j(_e),o&&t(Lo),j(be,o),o&&t(So),o&&t(Z),o&&t(Ro),o&&t(R),j(xe),o&&t(Ho),o&&t(P),j($e),j(oe),o&&t(Wo),o&&t(U),j(ke),o&&t(Uo),o&&t(k),j(qe),j(Me),j(re),j(ne),o&&t(Bo),o&&t(G),j(Fe),o&&t(Go),o&&t(q),j(ze),j(Oe),j(se),j(ie)}}}const na={local:"table-transformer",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.TableTransformerConfig",title:"TableTransformerConfig"},{local:"transformers.TableTransformerModel",title:"TableTransformerModel"},{local:"transformers.TableTransformerForObjectDetection",title:"TableTransformerForObjectDetection"}],title:"Table Transformer"};function aa(E){return Yn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ha extends Bn{constructor(m){super();Gn(this,m,aa,ra,Vn,{})}}export{ha as default,na as metadata};
