import{S as Dr,i as Or,s as Sr,e as n,k as f,w as y,t as s,M as Xr,c as r,d as t,m as h,a,x as v,h as l,b as c,N as Qr,G as e,g as p,y as w,q as M,o as j,B as x,v as Yr,L as Hn}from"../../chunks/vendor-hf-doc-builder.js";import{T as Vr}from"../../chunks/Tip-hf-doc-builder.js";import{D as ko}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ln}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as io}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Yn}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Hr}from"../../chunks/PipelineTag-hf-doc-builder.js";function Lr(J){let m,T,b,u,_;return u=new Ln({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRhYmxlVHJhbnNmb3JtZXJNb2RlbCUyQyUyMFRhYmxlVHJhbnNmb3JtZXJDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwVGFibGUlMjBUcmFuc2Zvcm1lciUyMG1pY3Jvc29mdCUyRnRhYmxlLXRyYW5zZm9ybWVyLWRldGVjdGlvbiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBUYWJsZVRyYW5zZm9ybWVyQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbWljcm9zb2Z0JTJGdGFibGUtdHJhbnNmb3JtZXItZGV0ZWN0aW9uJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBUYWJsZVRyYW5zZm9ybWVyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",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=n("p"),T=s("Examples:"),b=f(),y(u.$$.fragment)},l(i){m=r(i,"P",{});var g=a(m);T=l(g,"Examples:"),g.forEach(t),b=h(i),v(u.$$.fragment,i)},m(i,g){p(i,m,g),e(m,T),p(i,b,g),w(u,i,g),_=!0},p:Hn,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){j(u.$$.fragment,i),_=!1},d(i){i&&t(m),i&&t(b),x(u,i)}}}function Kr(J){let m,T,b,u,_;return{c(){m=n("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=n("code"),u=s("Module"),_=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(i){m=r(i,"P",{});var g=a(m);T=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=r(g,"CODE",{});var E=a(b);u=l(E,"Module"),E.forEach(t),_=l(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(i,g){p(i,m,g),e(m,T),e(m,b),e(b,u),e(m,_)},d(i){i&&t(m)}}}function ea(J){let m,T,b,u,_;return u=new Ln({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRhYmxlVHJhbnNmb3JtZXJNb2RlbCUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBoZl9odWJfZG93bmxvYWQlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmaWxlX3BhdGglMjAlM0QlMjBoZl9odWJfZG93bmxvYWQocmVwb19pZCUzRCUyMm5pZWxzciUyRmV4YW1wbGUtcGRmJTIyJTJDJTIwcmVwb190eXBlJTNEJTIyZGF0YXNldCUyMiUyQyUyMGZpbGVuYW1lJTNEJTIyZXhhbXBsZV9wZGYucG5nJTIyKSUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihmaWxlX3BhdGgpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGdGFibGUtdHJhbnNmb3JtZXItZGV0ZWN0aW9uJTIyKSUwQW1vZGVsJTIwJTNEJTIwVGFibGVUcmFuc2Zvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZ0YWJsZS10cmFuc2Zvcm1lci1kZXRlY3Rpb24lMjIpJTBBJTBBJTIzJTIwcHJlcGFyZSUyMGltYWdlJTIwZm9yJTIwdGhlJTIwbW9kZWwlMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMHRoZSUyMGxhc3QlMjBoaWRkZW4lMjBzdGF0ZXMlMjBhcmUlMjB0aGUlMjBmaW5hbCUyMHF1ZXJ5JTIwZW1iZWRkaW5ncyUyMG9mJTIwdGhlJTIwVHJhbnNmb3JtZXIlMjBkZWNvZGVyJTBBJTIzJTIwdGhlc2UlMjBhcmUlMjBvZiUyMHNoYXBlJTIwKGJhdGNoX3NpemUlMkMlMjBudW1fcXVlcmllcyUyQyUyMGhpZGRlbl9zaXplKSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",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=n("p"),T=s("Examples:"),b=f(),y(u.$$.fragment)},l(i){m=r(i,"P",{});var g=a(m);T=l(g,"Examples:"),g.forEach(t),b=h(i),v(u.$$.fragment,i)},m(i,g){p(i,m,g),e(m,T),p(i,b,g),w(u,i,g),_=!0},p:Hn,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){j(u.$$.fragment,i),_=!1},d(i){i&&t(m),i&&t(b),x(u,i)}}}function oa(J){let m,T,b,u,_;return{c(){m=n("p"),T=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),b=n("code"),u=s("Module"),_=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(i){m=r(i,"P",{});var g=a(m);T=l(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),b=r(g,"CODE",{});var E=a(b);u=l(E,"Module"),E.forEach(t),_=l(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(i,g){p(i,m,g),e(m,T),e(m,b),e(b,u),e(m,_)},d(i){i&&t(m)}}}function ta(J){let m,T,b,u,_;return u=new Ln({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvSW1hZ2VQcm9jZXNzb3IlMkMlMjBUYWJsZVRyYW5zZm9ybWVyRm9yT2JqZWN0RGV0ZWN0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmaWxlX3BhdGglMjAlM0QlMjBoZl9odWJfZG93bmxvYWQocmVwb19pZCUzRCUyMm5pZWxzciUyRmV4YW1wbGUtcGRmJTIyJTJDJTIwcmVwb190eXBlJTNEJTIyZGF0YXNldCUyMiUyQyUyMGZpbGVuYW1lJTNEJTIyZXhhbXBsZV9wZGYucG5nJTIyKSUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihmaWxlX3BhdGgpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGdGFibGUtdHJhbnNmb3JtZXItZGV0ZWN0aW9uJTIyKSUwQW1vZGVsJTIwJTNEJTIwVGFibGVUcmFuc2Zvcm1lckZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGdGFibGUtdHJhbnNmb3JtZXItZGV0ZWN0aW9uJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQSUyMyUyMGNvbnZlcnQlMjBvdXRwdXRzJTIwKGJvdW5kaW5nJTIwYm94ZXMlMjBhbmQlMjBjbGFzcyUyMGxvZ2l0cyklMjB0byUyMENPQ08lMjBBUEklMEF0YXJnZXRfc2l6ZXMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCaW1hZ2Uuc2l6ZSU1QiUzQSUzQS0xJTVEJTVEKSUwQXJlc3VsdHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IucG9zdF9wcm9jZXNzX29iamVjdF9kZXRlY3Rpb24ob3V0cHV0cyUyQyUyMHRocmVzaG9sZCUzRDAuOSUyQyUyMHRhcmdldF9zaXplcyUzRHRhcmdldF9zaXplcyklNUIlMEElMjAlMjAlMjAlMjAwJTBBJTVEJTBBJTBBZm9yJTIwc2NvcmUlMkMlMjBsYWJlbCUyQyUyMGJveCUyMGluJTIwemlwKHJlc3VsdHMlNUIlMjJzY29yZXMlMjIlNUQlMkMlMjByZXN1bHRzJTVCJTIybGFiZWxzJTIyJTVEJTJDJTIwcmVzdWx0cyU1QiUyMmJveGVzJTIyJTVEKSUzQSUwQSUyMCUyMCUyMCUyMGJveCUyMCUzRCUyMCU1QnJvdW5kKGklMkMlMjAyKSUyMGZvciUyMGklMjBpbiUyMGJveC50b2xpc3QoKSU1RCUwQSUyMCUyMCUyMCUyMHByaW50KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGYlMjJEZXRlY3RlZCUyMCU3Qm1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmxhYmVsLml0ZW0oKSU1RCU3RCUyMHdpdGglMjBjb25maWRlbmNlJTIwJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMiU3QnJvdW5kKHNjb3JlLml0ZW0oKSUyQyUyMDMpJTdEJTIwYXQlMjBsb2NhdGlvbiUyMCU3QmJveCU3RCUyMiUwQSUyMCUyMCUyMCUyMCk=",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=n("p"),T=s("Examples:"),b=f(),y(u.$$.fragment)},l(i){m=r(i,"P",{});var g=a(m);T=l(g,"Examples:"),g.forEach(t),b=h(i),v(u.$$.fragment,i)},m(i,g){p(i,m,g),e(m,T),p(i,b,g),w(u,i,g),_=!0},p:Hn,i(i){_||(M(u.$$.fragment,i),_=!0)},o(i){j(u.$$.fragment,i),_=!1},d(i){i&&t(m),i&&t(b),x(u,i)}}}function na(J){let m,T,b,u,_,i,g,E,lt,Jo,G,X,co,me,it,mo,ct,Co,F,dt,fe,mt,ft,Pe,ht,pt,Zo,Be,ut,Eo,Re,fo,gt,Fo,Ae,bt,Wo,Q,N,_t,he,Tt,yt,pe,vt,wt,Mt,q,jt,Ve,xt,Ut,De,$t,kt,Io,Y,Kn,zo,H,Jt,Oe,Ct,Zt,Go,W,Et,ue,Ft,Wt,ge,It,zt,No,P,L,ho,be,Gt,po,Nt,qo,_e,Po,K,Te,qt,ye,Pt,Bt,Rt,ve,At,we,Vt,Dt,Bo,B,ee,uo,Me,Ot,go,St,Ro,k,je,Xt,R,Qt,Se,Yt,Ht,xe,Lt,Kt,en,A,on,Xe,tn,nn,Qe,rn,an,sn,oe,Ao,V,te,bo,Ue,ln,_o,cn,Vo,U,$e,dn,To,mn,fn,ke,hn,Ye,pn,un,gn,Je,bn,Ce,_n,Tn,yn,C,Ze,vn,D,wn,He,Mn,jn,yo,xn,Un,$n,ne,kn,re,Do,O,ae,vo,Ee,Jn,wo,Cn,Oo,$,Fe,Zn,Mo,En,Fn,We,Wn,Le,In,zn,Gn,Ie,Nn,ze,qn,Pn,Bn,Z,Ge,Rn,S,An,Ke,Vn,Dn,jo,On,Sn,Xn,se,Qn,le,So;return i=new io({}),me=new io({}),be=new io({}),_e=new Hr({props:{pipeline:"object-detection"}}),Me=new io({}),je=new ko({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:"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/v4.33.0/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/v4.33.0/src/transformers/models/table_transformer/configuration_table_transformer.py#L36"}}),oe=new Yn({props:{anchor:"transformers.TableTransformerConfig.example",$$slots:{default:[Lr]},$$scope:{ctx:J}}}),Ue=new io({}),$e=new ko({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/v4.33.0/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/v4.33.0/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/v4.33.0/src/transformers/models/table_transformer/modeling_table_transformer.py#L1217"}}),Ze=new ko({props:{name:"forward",anchor:"transformers.TableTransformerModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.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/v4.33.0/en/model_doc/detr#transformers.DetrImageProcessor">DetrImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TableTransformerModel.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.FloatTensor</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.FloatTensor</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/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/table_transformer/modeling_table_transformer.py#L1252",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/v4.33.0/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>
`}}),ne=new Vr({props:{$$slots:{default:[Kr]},$$scope:{ctx:J}}}),re=new Yn({props:{anchor:"transformers.TableTransformerModel.forward.example",$$slots:{default:[ea]},$$scope:{ctx:J}}}),Ee=new io({}),Fe=new ko({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/v4.33.0/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/v4.33.0/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/v4.33.0/src/transformers/models/table_transformer/modeling_table_transformer.py#L1386"}}),Ge=new ko({props:{name:"forward",anchor:"transformers.TableTransformerForObjectDetection.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_outputs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"decoder_inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[typing.List[typing.Dict]] = 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.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/v4.33.0/en/model_doc/detr#transformers.DetrImageProcessor">DetrImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">DetrImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TableTransformerForObjectDetection.forward.pixel_mask",description:`<strong>pixel_mask</strong> (<code>torch.FloatTensor</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.FloatTensor</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/v4.33.0/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/v4.33.0/src/transformers/models/table_transformer/modeling_table_transformer.py#L1413",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/v4.33.0/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 Vr({props:{$$slots:{default:[oa]},$$scope:{ctx:J}}}),le=new Yn({props:{anchor:"transformers.TableTransformerForObjectDetection.forward.example",$$slots:{default:[ta]},$$scope:{ctx:J}}}),{c(){m=n("meta"),T=f(),b=n("h1"),u=n("a"),_=n("span"),y(i.$$.fragment),g=f(),E=n("span"),lt=s("Table Transformer"),Jo=f(),G=n("h2"),X=n("a"),co=n("span"),y(me.$$.fragment),it=f(),mo=n("span"),ct=s("Overview"),Co=f(),F=n("p"),dt=s("The Table Transformer model was proposed in "),fe=n("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 `),Pe=n("a"),ht=s("DETR"),pt=s(" models, one for table detection and one for table structure recognition, dubbed Table Transformers."),Zo=f(),Be=n("p"),ut=s("The abstract from the paper is the following:"),Eo=f(),Re=n("p"),fo=n("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.`),Fo=f(),Ae=n("p"),bt=s("Tips:"),Wo=f(),Q=n("ul"),N=n("li"),_t=s("The authors released 2 models, one for "),he=n("a"),Tt=s("table detection"),yt=s(" in documents, one for "),pe=n("a"),vt=s("table structure recognition"),wt=s(" (the task of recognizing the individual rows, columns etc. in a table)."),Mt=f(),q=n("li"),jt=s("One can use the "),Ve=n("a"),xt=s("AutoImageProcessor"),Ut=s(" API to prepare images and optional targets for the model. This will load a "),De=n("a"),$t=s("DetrImageProcessor"),kt=s(" behind the scenes."),Io=f(),Y=n("img"),zo=f(),H=n("small"),Jt=s("Table detection and table structure recognition clarified. Taken from the "),Oe=n("a"),Ct=s("original paper"),Zt=s("."),Go=f(),W=n("p"),Et=s("This model was contributed by "),ue=n("a"),Ft=s("nielsr"),Wt=s(`. The original code can be
found `),ge=n("a"),It=s("here"),zt=s("."),No=f(),P=n("h2"),L=n("a"),ho=n("span"),y(be.$$.fragment),Gt=f(),po=n("span"),Nt=s("Resources"),qo=f(),y(_e.$$.fragment),Po=f(),K=n("ul"),Te=n("li"),qt=s("A demo notebook for the Table Transformer can be found "),ye=n("a"),Pt=s("here"),Bt=s("."),Rt=f(),ve=n("li"),At=s("It turns out padding of images is quite important for detection. An interesting Github thread with replies from the authors can be found "),we=n("a"),Vt=s("here"),Dt=s("."),Bo=f(),B=n("h2"),ee=n("a"),uo=n("span"),y(Me.$$.fragment),Ot=f(),go=n("span"),St=s("TableTransformerConfig"),Ro=f(),k=n("div"),y(je.$$.fragment),Xt=f(),R=n("p"),Qt=s("This is the configuration class to store the configuration of a "),Se=n("a"),Yt=s("TableTransformerModel"),Ht=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
`),xe=n("a"),Lt=s("microsoft/table-transformer-detection"),Kt=s(" architecture."),en=f(),A=n("p"),on=s("Configuration objects inherit from "),Xe=n("a"),tn=s("PretrainedConfig"),nn=s(` and can be used to control the model outputs. Read the
documentation from `),Qe=n("a"),rn=s("PretrainedConfig"),an=s(" for more information."),sn=f(),y(oe.$$.fragment),Ao=f(),V=n("h2"),te=n("a"),bo=n("span"),y(Ue.$$.fragment),ln=f(),_o=n("span"),cn=s("TableTransformerModel"),Vo=f(),U=n("div"),y($e.$$.fragment),dn=f(),To=n("p"),mn=s(`The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),fn=f(),ke=n("p"),hn=s("This model inherits from "),Ye=n("a"),pn=s("PreTrainedModel"),un=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.)`),gn=f(),Je=n("p"),bn=s("This model is also a PyTorch "),Ce=n("a"),_n=s("torch.nn.Module"),Tn=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yn=f(),C=n("div"),y(Ze.$$.fragment),vn=f(),D=n("p"),wn=s("The "),He=n("a"),Mn=s("TableTransformerModel"),jn=s(" forward method, overrides the "),yo=n("code"),xn=s("__call__"),Un=s(" special method."),$n=f(),y(ne.$$.fragment),kn=f(),y(re.$$.fragment),Do=f(),O=n("h2"),ae=n("a"),vo=n("span"),y(Ee.$$.fragment),Jn=f(),wo=n("span"),Cn=s("TableTransformerForObjectDetection"),Oo=f(),$=n("div"),y(Fe.$$.fragment),Zn=f(),Mo=n("p"),En=s(`Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),Fn=f(),We=n("p"),Wn=s("This model inherits from "),Le=n("a"),In=s("PreTrainedModel"),zn=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.)`),Gn=f(),Ie=n("p"),Nn=s("This model is also a PyTorch "),ze=n("a"),qn=s("torch.nn.Module"),Pn=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bn=f(),Z=n("div"),y(Ge.$$.fragment),Rn=f(),S=n("p"),An=s("The "),Ke=n("a"),Vn=s("TableTransformerForObjectDetection"),Dn=s(" forward method, overrides the "),jo=n("code"),On=s("__call__"),Sn=s(" special method."),Xn=f(),y(se.$$.fragment),Qn=f(),y(le.$$.fragment),this.h()},l(o){const d=Xr('[data-svelte="svelte-1phssyn"]',document.head);m=r(d,"META",{name:!0,content:!0}),d.forEach(t),T=h(o),b=r(o,"H1",{class:!0});var Ne=a(b);u=r(Ne,"A",{id:!0,class:!0,href:!0});var xo=a(u);_=r(xo,"SPAN",{});var Uo=a(_);v(i.$$.fragment,Uo),Uo.forEach(t),xo.forEach(t),g=h(Ne),E=r(Ne,"SPAN",{});var $o=a(E);lt=l($o,"Table Transformer"),$o.forEach(t),Ne.forEach(t),Jo=h(o),G=r(o,"H2",{class:!0});var qe=a(G);X=r(qe,"A",{id:!0,class:!0,href:!0});var er=a(X);co=r(er,"SPAN",{});var or=a(co);v(me.$$.fragment,or),or.forEach(t),er.forEach(t),it=h(qe),mo=r(qe,"SPAN",{});var tr=a(mo);ct=l(tr,"Overview"),tr.forEach(t),qe.forEach(t),Co=h(o),F=r(o,"P",{});var eo=a(F);dt=l(eo,"The Table Transformer model was proposed in "),fe=r(eo,"A",{href:!0,rel:!0});var nr=a(fe);mt=l(nr,"PubTables-1M: Towards comprehensive table extraction from unstructured documents"),nr.forEach(t),ft=l(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 `),Pe=r(eo,"A",{href:!0});var rr=a(Pe);ht=l(rr,"DETR"),rr.forEach(t),pt=l(eo," models, one for table detection and one for table structure recognition, dubbed Table Transformers."),eo.forEach(t),Zo=h(o),Be=r(o,"P",{});var ar=a(Be);ut=l(ar,"The abstract from the paper is the following:"),ar.forEach(t),Eo=h(o),Re=r(o,"P",{});var sr=a(Re);fo=r(sr,"EM",{});var lr=a(fo);gt=l(lr,`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.`),lr.forEach(t),sr.forEach(t),Fo=h(o),Ae=r(o,"P",{});var ir=a(Ae);bt=l(ir,"Tips:"),ir.forEach(t),Wo=h(o),Q=r(o,"UL",{});var Xo=a(Q);N=r(Xo,"LI",{});var oo=a(N);_t=l(oo,"The authors released 2 models, one for "),he=r(oo,"A",{href:!0,rel:!0});var cr=a(he);Tt=l(cr,"table detection"),cr.forEach(t),yt=l(oo," in documents, one for "),pe=r(oo,"A",{href:!0,rel:!0});var dr=a(pe);vt=l(dr,"table structure recognition"),dr.forEach(t),wt=l(oo," (the task of recognizing the individual rows, columns etc. in a table)."),oo.forEach(t),Mt=h(Xo),q=r(Xo,"LI",{});var to=a(q);jt=l(to,"One can use the "),Ve=r(to,"A",{href:!0});var mr=a(Ve);xt=l(mr,"AutoImageProcessor"),mr.forEach(t),Ut=l(to," API to prepare images and optional targets for the model. This will load a "),De=r(to,"A",{href:!0});var fr=a(De);$t=l(fr,"DetrImageProcessor"),fr.forEach(t),kt=l(to," behind the scenes."),to.forEach(t),Xo.forEach(t),Io=h(o),Y=r(o,"IMG",{src:!0,alt:!0,width:!0}),zo=h(o),H=r(o,"SMALL",{});var Qo=a(H);Jt=l(Qo,"Table detection and table structure recognition clarified. Taken from the "),Oe=r(Qo,"A",{href:!0});var hr=a(Oe);Ct=l(hr,"original paper"),hr.forEach(t),Zt=l(Qo,"."),Qo.forEach(t),Go=h(o),W=r(o,"P",{});var no=a(W);Et=l(no,"This model was contributed by "),ue=r(no,"A",{href:!0,rel:!0});var pr=a(ue);Ft=l(pr,"nielsr"),pr.forEach(t),Wt=l(no,`. The original code can be
found `),ge=r(no,"A",{href:!0,rel:!0});var ur=a(ge);It=l(ur,"here"),ur.forEach(t),zt=l(no,"."),no.forEach(t),No=h(o),P=r(o,"H2",{class:!0});var Yo=a(P);L=r(Yo,"A",{id:!0,class:!0,href:!0});var gr=a(L);ho=r(gr,"SPAN",{});var br=a(ho);v(be.$$.fragment,br),br.forEach(t),gr.forEach(t),Gt=h(Yo),po=r(Yo,"SPAN",{});var _r=a(po);Nt=l(_r,"Resources"),_r.forEach(t),Yo.forEach(t),qo=h(o),v(_e.$$.fragment,o),Po=h(o),K=r(o,"UL",{});var Ho=a(K);Te=r(Ho,"LI",{});var Lo=a(Te);qt=l(Lo,"A demo notebook for the Table Transformer can be found "),ye=r(Lo,"A",{href:!0,rel:!0});var Tr=a(ye);Pt=l(Tr,"here"),Tr.forEach(t),Bt=l(Lo,"."),Lo.forEach(t),Rt=h(Ho),ve=r(Ho,"LI",{});var Ko=a(ve);At=l(Ko,"It turns out padding of images is quite important for detection. An interesting Github thread with replies from the authors can be found "),we=r(Ko,"A",{href:!0,rel:!0});var yr=a(we);Vt=l(yr,"here"),yr.forEach(t),Dt=l(Ko,"."),Ko.forEach(t),Ho.forEach(t),Bo=h(o),B=r(o,"H2",{class:!0});var et=a(B);ee=r(et,"A",{id:!0,class:!0,href:!0});var vr=a(ee);uo=r(vr,"SPAN",{});var wr=a(uo);v(Me.$$.fragment,wr),wr.forEach(t),vr.forEach(t),Ot=h(et),go=r(et,"SPAN",{});var Mr=a(go);St=l(Mr,"TableTransformerConfig"),Mr.forEach(t),et.forEach(t),Ro=h(o),k=r(o,"DIV",{class:!0});var ie=a(k);v(je.$$.fragment,ie),Xt=h(ie),R=r(ie,"P",{});var ro=a(R);Qt=l(ro,"This is the configuration class to store the configuration of a "),Se=r(ro,"A",{href:!0});var jr=a(Se);Yt=l(jr,"TableTransformerModel"),jr.forEach(t),Ht=l(ro,`. 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
`),xe=r(ro,"A",{href:!0,rel:!0});var xr=a(xe);Lt=l(xr,"microsoft/table-transformer-detection"),xr.forEach(t),Kt=l(ro," architecture."),ro.forEach(t),en=h(ie),A=r(ie,"P",{});var ao=a(A);on=l(ao,"Configuration objects inherit from "),Xe=r(ao,"A",{href:!0});var Ur=a(Xe);tn=l(Ur,"PretrainedConfig"),Ur.forEach(t),nn=l(ao,` and can be used to control the model outputs. Read the
documentation from `),Qe=r(ao,"A",{href:!0});var $r=a(Qe);rn=l($r,"PretrainedConfig"),$r.forEach(t),an=l(ao," for more information."),ao.forEach(t),sn=h(ie),v(oe.$$.fragment,ie),ie.forEach(t),Ao=h(o),V=r(o,"H2",{class:!0});var ot=a(V);te=r(ot,"A",{id:!0,class:!0,href:!0});var kr=a(te);bo=r(kr,"SPAN",{});var Jr=a(bo);v(Ue.$$.fragment,Jr),Jr.forEach(t),kr.forEach(t),ln=h(ot),_o=r(ot,"SPAN",{});var Cr=a(_o);cn=l(Cr,"TableTransformerModel"),Cr.forEach(t),ot.forEach(t),Vo=h(o),U=r(o,"DIV",{class:!0});var I=a(U);v($e.$$.fragment,I),dn=h(I),To=r(I,"P",{});var Zr=a(To);mn=l(Zr,`The bare Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) outputting raw
hidden-states without any specific head on top.`),Zr.forEach(t),fn=h(I),ke=r(I,"P",{});var tt=a(ke);hn=l(tt,"This model inherits from "),Ye=r(tt,"A",{href:!0});var Er=a(Ye);pn=l(Er,"PreTrainedModel"),Er.forEach(t),un=l(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),gn=h(I),Je=r(I,"P",{});var nt=a(Je);bn=l(nt,"This model is also a PyTorch "),Ce=r(nt,"A",{href:!0,rel:!0});var Fr=a(Ce);_n=l(Fr,"torch.nn.Module"),Fr.forEach(t),Tn=l(nt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nt.forEach(t),yn=h(I),C=r(I,"DIV",{class:!0});var ce=a(C);v(Ze.$$.fragment,ce),vn=h(ce),D=r(ce,"P",{});var so=a(D);wn=l(so,"The "),He=r(so,"A",{href:!0});var Wr=a(He);Mn=l(Wr,"TableTransformerModel"),Wr.forEach(t),jn=l(so," forward method, overrides the "),yo=r(so,"CODE",{});var Ir=a(yo);xn=l(Ir,"__call__"),Ir.forEach(t),Un=l(so," special method."),so.forEach(t),$n=h(ce),v(ne.$$.fragment,ce),kn=h(ce),v(re.$$.fragment,ce),ce.forEach(t),I.forEach(t),Do=h(o),O=r(o,"H2",{class:!0});var rt=a(O);ae=r(rt,"A",{id:!0,class:!0,href:!0});var zr=a(ae);vo=r(zr,"SPAN",{});var Gr=a(vo);v(Ee.$$.fragment,Gr),Gr.forEach(t),zr.forEach(t),Jn=h(rt),wo=r(rt,"SPAN",{});var Nr=a(wo);Cn=l(Nr,"TableTransformerForObjectDetection"),Nr.forEach(t),rt.forEach(t),Oo=h(o),$=r(o,"DIV",{class:!0});var z=a($);v(Fe.$$.fragment,z),Zn=h(z),Mo=r(z,"P",{});var qr=a(Mo);En=l(qr,`Table Transformer Model (consisting of a backbone and encoder-decoder Transformer) with object detection heads on
top, for tasks such as COCO detection.`),qr.forEach(t),Fn=h(z),We=r(z,"P",{});var at=a(We);Wn=l(at,"This model inherits from "),Le=r(at,"A",{href:!0});var Pr=a(Le);In=l(Pr,"PreTrainedModel"),Pr.forEach(t),zn=l(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),Gn=h(z),Ie=r(z,"P",{});var st=a(Ie);Nn=l(st,"This model is also a PyTorch "),ze=r(st,"A",{href:!0,rel:!0});var Br=a(ze);qn=l(Br,"torch.nn.Module"),Br.forEach(t),Pn=l(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),Bn=h(z),Z=r(z,"DIV",{class:!0});var de=a(Z);v(Ge.$$.fragment,de),Rn=h(de),S=r(de,"P",{});var lo=a(S);An=l(lo,"The "),Ke=r(lo,"A",{href:!0});var Rr=a(Ke);Vn=l(Rr,"TableTransformerForObjectDetection"),Rr.forEach(t),Dn=l(lo," forward method, overrides the "),jo=r(lo,"CODE",{});var Ar=a(jo);On=l(Ar,"__call__"),Ar.forEach(t),Sn=l(lo," special method."),lo.forEach(t),Xn=h(de),v(se.$$.fragment,de),Qn=h(de),v(le.$$.fragment,de),de.forEach(t),z.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(ra)),c(u,"id","table-transformer"),c(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"),c(u,"href","#table-transformer"),c(b,"class","relative group"),c(X,"id","overview"),c(X,"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(X,"href","#overview"),c(G,"class","relative group"),c(fe,"href","https://arxiv.org/abs/2110.00061"),c(fe,"rel","nofollow"),c(Pe,"href","detr"),c(he,"href","https://huggingface.co/microsoft/table-transformer-detection"),c(he,"rel","nofollow"),c(pe,"href","https://huggingface.co/microsoft/table-transformer-structure-recognition"),c(pe,"rel","nofollow"),c(Ve,"href","/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor"),c(De,"href","/docs/transformers/v4.33.0/en/model_doc/detr#transformers.DetrImageProcessor"),Qr(Y.src,Kn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/table_transformer_architecture.jpeg")||c(Y,"src",Kn),c(Y,"alt","drawing"),c(Y,"width","600"),c(Oe,"href","https://arxiv.org/abs/2110.00061"),c(ue,"href","https://huggingface.co/nielsr"),c(ue,"rel","nofollow"),c(ge,"href","https://github.com/microsoft/table-transformer"),c(ge,"rel","nofollow"),c(L,"id","resources"),c(L,"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(L,"href","#resources"),c(P,"class","relative group"),c(ye,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Table%20Transformer"),c(ye,"rel","nofollow"),c(we,"href","https://github.com/microsoft/table-transformer/issues/68"),c(we,"rel","nofollow"),c(ee,"id","transformers.TableTransformerConfig"),c(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"),c(ee,"href","#transformers.TableTransformerConfig"),c(B,"class","relative group"),c(Se,"href","/docs/transformers/v4.33.0/en/model_doc/table-transformer#transformers.TableTransformerModel"),c(xe,"href","https://huggingface.co/microsoft/table-transformer-detection"),c(xe,"rel","nofollow"),c(Xe,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),c(Qe,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),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"),c(te,"id","transformers.TableTransformerModel"),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.TableTransformerModel"),c(V,"class","relative group"),c(Ye,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(Ce,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ce,"rel","nofollow"),c(He,"href","/docs/transformers/v4.33.0/en/model_doc/table-transformer#transformers.TableTransformerModel"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ae,"id","transformers.TableTransformerForObjectDetection"),c(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"),c(ae,"href","#transformers.TableTransformerForObjectDetection"),c(O,"class","relative group"),c(Le,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),c(ze,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ze,"rel","nofollow"),c(Ke,"href","/docs/transformers/v4.33.0/en/model_doc/table-transformer#transformers.TableTransformerForObjectDetection"),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($,"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,d){e(document.head,m),p(o,T,d),p(o,b,d),e(b,u),e(u,_),w(i,_,null),e(b,g),e(b,E),e(E,lt),p(o,Jo,d),p(o,G,d),e(G,X),e(X,co),w(me,co,null),e(G,it),e(G,mo),e(mo,ct),p(o,Co,d),p(o,F,d),e(F,dt),e(F,fe),e(fe,mt),e(F,ft),e(F,Pe),e(Pe,ht),e(F,pt),p(o,Zo,d),p(o,Be,d),e(Be,ut),p(o,Eo,d),p(o,Re,d),e(Re,fo),e(fo,gt),p(o,Fo,d),p(o,Ae,d),e(Ae,bt),p(o,Wo,d),p(o,Q,d),e(Q,N),e(N,_t),e(N,he),e(he,Tt),e(N,yt),e(N,pe),e(pe,vt),e(N,wt),e(Q,Mt),e(Q,q),e(q,jt),e(q,Ve),e(Ve,xt),e(q,Ut),e(q,De),e(De,$t),e(q,kt),p(o,Io,d),p(o,Y,d),p(o,zo,d),p(o,H,d),e(H,Jt),e(H,Oe),e(Oe,Ct),e(H,Zt),p(o,Go,d),p(o,W,d),e(W,Et),e(W,ue),e(ue,Ft),e(W,Wt),e(W,ge),e(ge,It),e(W,zt),p(o,No,d),p(o,P,d),e(P,L),e(L,ho),w(be,ho,null),e(P,Gt),e(P,po),e(po,Nt),p(o,qo,d),w(_e,o,d),p(o,Po,d),p(o,K,d),e(K,Te),e(Te,qt),e(Te,ye),e(ye,Pt),e(Te,Bt),e(K,Rt),e(K,ve),e(ve,At),e(ve,we),e(we,Vt),e(ve,Dt),p(o,Bo,d),p(o,B,d),e(B,ee),e(ee,uo),w(Me,uo,null),e(B,Ot),e(B,go),e(go,St),p(o,Ro,d),p(o,k,d),w(je,k,null),e(k,Xt),e(k,R),e(R,Qt),e(R,Se),e(Se,Yt),e(R,Ht),e(R,xe),e(xe,Lt),e(R,Kt),e(k,en),e(k,A),e(A,on),e(A,Xe),e(Xe,tn),e(A,nn),e(A,Qe),e(Qe,rn),e(A,an),e(k,sn),w(oe,k,null),p(o,Ao,d),p(o,V,d),e(V,te),e(te,bo),w(Ue,bo,null),e(V,ln),e(V,_o),e(_o,cn),p(o,Vo,d),p(o,U,d),w($e,U,null),e(U,dn),e(U,To),e(To,mn),e(U,fn),e(U,ke),e(ke,hn),e(ke,Ye),e(Ye,pn),e(ke,un),e(U,gn),e(U,Je),e(Je,bn),e(Je,Ce),e(Ce,_n),e(Je,Tn),e(U,yn),e(U,C),w(Ze,C,null),e(C,vn),e(C,D),e(D,wn),e(D,He),e(He,Mn),e(D,jn),e(D,yo),e(yo,xn),e(D,Un),e(C,$n),w(ne,C,null),e(C,kn),w(re,C,null),p(o,Do,d),p(o,O,d),e(O,ae),e(ae,vo),w(Ee,vo,null),e(O,Jn),e(O,wo),e(wo,Cn),p(o,Oo,d),p(o,$,d),w(Fe,$,null),e($,Zn),e($,Mo),e(Mo,En),e($,Fn),e($,We),e(We,Wn),e(We,Le),e(Le,In),e(We,zn),e($,Gn),e($,Ie),e(Ie,Nn),e(Ie,ze),e(ze,qn),e(Ie,Pn),e($,Bn),e($,Z),w(Ge,Z,null),e(Z,Rn),e(Z,S),e(S,An),e(S,Ke),e(Ke,Vn),e(S,Dn),e(S,jo),e(jo,On),e(S,Sn),e(Z,Xn),w(se,Z,null),e(Z,Qn),w(le,Z,null),So=!0},p(o,[d]){const Ne={};d&2&&(Ne.$$scope={dirty:d,ctx:o}),oe.$set(Ne);const xo={};d&2&&(xo.$$scope={dirty:d,ctx:o}),ne.$set(xo);const Uo={};d&2&&(Uo.$$scope={dirty:d,ctx:o}),re.$set(Uo);const $o={};d&2&&($o.$$scope={dirty:d,ctx:o}),se.$set($o);const qe={};d&2&&(qe.$$scope={dirty:d,ctx:o}),le.$set(qe)},i(o){So||(M(i.$$.fragment,o),M(me.$$.fragment,o),M(be.$$.fragment,o),M(_e.$$.fragment,o),M(Me.$$.fragment,o),M(je.$$.fragment,o),M(oe.$$.fragment,o),M(Ue.$$.fragment,o),M($e.$$.fragment,o),M(Ze.$$.fragment,o),M(ne.$$.fragment,o),M(re.$$.fragment,o),M(Ee.$$.fragment,o),M(Fe.$$.fragment,o),M(Ge.$$.fragment,o),M(se.$$.fragment,o),M(le.$$.fragment,o),So=!0)},o(o){j(i.$$.fragment,o),j(me.$$.fragment,o),j(be.$$.fragment,o),j(_e.$$.fragment,o),j(Me.$$.fragment,o),j(je.$$.fragment,o),j(oe.$$.fragment,o),j(Ue.$$.fragment,o),j($e.$$.fragment,o),j(Ze.$$.fragment,o),j(ne.$$.fragment,o),j(re.$$.fragment,o),j(Ee.$$.fragment,o),j(Fe.$$.fragment,o),j(Ge.$$.fragment,o),j(se.$$.fragment,o),j(le.$$.fragment,o),So=!1},d(o){t(m),o&&t(T),o&&t(b),x(i),o&&t(Jo),o&&t(G),x(me),o&&t(Co),o&&t(F),o&&t(Zo),o&&t(Be),o&&t(Eo),o&&t(Re),o&&t(Fo),o&&t(Ae),o&&t(Wo),o&&t(Q),o&&t(Io),o&&t(Y),o&&t(zo),o&&t(H),o&&t(Go),o&&t(W),o&&t(No),o&&t(P),x(be),o&&t(qo),x(_e,o),o&&t(Po),o&&t(K),o&&t(Bo),o&&t(B),x(Me),o&&t(Ro),o&&t(k),x(je),x(oe),o&&t(Ao),o&&t(V),x(Ue),o&&t(Vo),o&&t(U),x($e),x(Ze),x(ne),x(re),o&&t(Do),o&&t(O),x(Ee),o&&t(Oo),o&&t($),x(Fe),x(Ge),x(se),x(le)}}}const ra={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(J){return Yr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ha extends Dr{constructor(m){super();Or(this,m,aa,na,Sr,{})}}export{ha as default,ra as metadata};
