import{s as ue,f as be,o as Je,n as ae}from"../chunks/scheduler.25b97de1.js";import{S as we,i as Te,g as i,s as l,r as c,A as ge,h as p,f as a,c as t,j as ps,u as M,x as J,k as A,y as u,a as n,v as m,d as y,t as d,w as U}from"../chunks/index.d9030fc9.js";import{T as fe}from"../chunks/Tip.baa67368.js";import{D as bs}from"../chunks/Docstring.ffac8efa.js";import{C as js}from"../chunks/CodeBlock.e6cd0d95.js";import{E as je}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as V,E as Ce}from"../chunks/EditOnGithub.91d95064.js";function Ie(v){let r,T="Example:",j,h,b;return h=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpdFBvc2VDb25maWclMkMlMjBWaXRQb3NlRm9yUG9zZUVzdGltYXRpb24lMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwVml0UG9zZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwVml0UG9zZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBWaXRQb3NlRm9yUG9zZUVzdGltYXRpb24oY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitPoseConfig, VitPoseForPoseEstimation

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a VitPose configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = VitPoseConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VitPoseForPoseEstimation(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`,wrap:!1}}),{c(){r=i("p"),r.textContent=T,j=l(),c(h.$$.fragment)},l(o){r=p(o,"P",{"data-svelte-h":!0}),J(r)!=="svelte-11lpom8"&&(r.textContent=T),j=t(o),M(h.$$.fragment,o)},m(o,w){n(o,r,w),n(o,j,w),m(h,o,w),b=!0},p:ae,i(o){b||(y(h.$$.fragment,o),b=!0)},o(o){d(h.$$.fragment,o),b=!1},d(o){o&&(a(r),a(j)),U(h,o)}}}function _e(v){let r,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=T},l(j){r=p(j,"P",{"data-svelte-h":!0}),J(r)!=="svelte-fincs2"&&(r.innerHTML=T)},m(j,h){n(j,r,h)},p:ae,d(j){j&&a(r)}}}function Ae(v){let r,T="Examples:",j,h,b;return h=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFZpdFBvc2VGb3JQb3NlRXN0aW1hdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMnVzeWQtY29tbXVuaXR5JTJGdml0cG9zZS1iYXNlLXNpbXBsZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZpdFBvc2VGb3JQb3NlRXN0aW1hdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIydXN5ZC1jb21tdW5pdHklMkZ2aXRwb3NlLWJhc2Utc2ltcGxlJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFib3hlcyUyMCUzRCUyMCU1QiU1QiU1QjQxMi44JTJDJTIwMTU3LjYxJTJDJTIwNTMuMDUlMkMlMjAxMzguMDElNUQlMkMlMjAlNUIzODQuNDMlMkMlMjAxNzIuMjElMkMlMjAxNS4xMiUyQyUyMDM1Ljc0JTVEJTVEJTVEJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlJTJDJTIwYm94ZXMlM0Rib3hlcyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFoZWF0bWFwcyUyMCUzRCUyMG91dHB1dHMuaGVhdG1hcHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, VitPoseForPoseEstimation
<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><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;usyd-community/vitpose-base-simple&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VitPoseForPoseEstimation.from_pretrained(<span class="hljs-string">&quot;usyd-community/vitpose-base-simple&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = [[[<span class="hljs-number">412.8</span>, <span class="hljs-number">157.61</span>, <span class="hljs-number">53.05</span>, <span class="hljs-number">138.01</span>], [<span class="hljs-number">384.43</span>, <span class="hljs-number">172.21</span>, <span class="hljs-number">15.12</span>, <span class="hljs-number">35.74</span>]]]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, boxes=boxes, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>heatmaps = outputs.heatmaps`,wrap:!1}}),{c(){r=i("p"),r.textContent=T,j=l(),c(h.$$.fragment)},l(o){r=p(o,"P",{"data-svelte-h":!0}),J(r)!=="svelte-kvfsh7"&&(r.textContent=T),j=t(o),M(h.$$.fragment,o)},m(o,w){n(o,r,w),n(o,j,w),m(h,o,w),b=!0},p:ae,i(o){b||(y(h.$$.fragment,o),b=!0)},o(o){d(h.$$.fragment,o),b=!1},d(o){o&&(a(r),a(j)),U(h,o)}}}function ke(v){let r,T,j,h,b,o,w,Js,E,ne='The VitPose model was proposed in <a href="https://arxiv.org/abs/2204.12484" rel="nofollow">ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation</a> by Yufei Xu, Jing Zhang, Qiming Zhang, Dacheng Tao. VitPose employs a standard, non-hierarchical <a href="https://arxiv.org/pdf/2010.11929v2" rel="nofollow">Vision Transformer</a> as backbone for the task of keypoint estimation. A simple decoder head is added on top to predict the heatmaps from a given image. Despite its simplicity, the model gets state-of-the-art results on the challenging MS COCO Keypoint Detection benchmark.',ws,W,le="The abstract from the paper is the following:",Ts,z,te="<em>Although no specific domain knowledge is considered in the design, plain vision transformers have shown excellent performance in visual recognition tasks. However, little effort has been made to reveal the potential of such simple structures for pose estimation tasks. In this paper, we show the surprisingly good capabilities of plain vision transformers for pose estimation from various aspects, namely simplicity in model structure, scalability in model size, flexibility in training paradigm, and transferability of knowledge between models, through a simple baseline model called ViTPose. Specifically, ViTPose employs plain and non-hierarchical vision transformers as backbones to extract features for a given person instance and a lightweight decoder for pose estimation. It can be scaled up from 100M to 1B parameters by taking the advantages of the scalable model capacity and high parallelism of transformers, setting a new Pareto front between throughput and performance. Besides, ViTPose is very flexible regarding the attention type, input resolution, pre-training and finetuning strategy, as well as dealing with multiple pose tasks. We also empirically demonstrate that the knowledge of large ViTPose models can be easily transferred to small ones via a simple knowledge token. Experimental results show that our basic ViTPose model outperforms representative methods on the challenging MS COCO Keypoint Detection benchmark, while the largest model sets a new state-of-the-art.</em>",gs,x,oe='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vitpose-architecture.png" alt="vitpose-architecture"/>',fs,X,re=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a> and <a href="https://github.com/SangbumChoi" rel="nofollow">sangbumchoi</a>.
The original code can be found <a href="https://github.com/ViTAE-Transformer/ViTPose" rel="nofollow">here</a>.`,Cs,R,Is,F,ie='ViTPose is a so-called top-down keypoint detection model. This means that one first uses an object detector, like <a href="rt_detr.md">RT-DETR</a>, to detect people (or other instances) in an image. Next, ViTPose takes the cropped images as input and predicts the keypoints.',_s,$,As,P,ks,D,Vs,L,vs,H,Ss,S,pe,Bs,Y,Qs,K,ce="To enable MoE (Mixture of Experts) function in the backbone, user has to give appropriate configuration such as <code>num_experts</code> and input value <code>dataset_index</code> to the backbone model.  However, it is not used in default parameters. Below is the code snippet for usage of MoE function.",Zs,q,Ns,O,Gs,C,ss,$s,cs,Me="Constructs a VitPose image processor.",Ps,B,es,Ds,Ms,me="Preprocess an image or batch of images.",Es,as,Ws,g,ns,Ls,ms,ye=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30530/en/model_doc/vitpose#transformers.VitPoseForPoseEstimation">VitPoseForPoseEstimation</a>. It is used to instantiate a
VitPose 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 VitPose
<a href="https://huggingface.co/usyd-community/vitpose-base-simple" rel="nofollow">usyd-community/vitpose-base-simple</a> architecture.`,Hs,ys,de=`Configuration objects inherit from <a href="/docs/transformers/pr_30530/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_30530/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ys,Q,zs,ls,xs,I,ts,Ks,ds,Ue=`The VitPose model with a pose estimation head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,qs,f,os,Os,Us,he='The <a href="/docs/transformers/pr_30530/en/model_doc/vitpose#transformers.VitPoseForPoseEstimation">VitPoseForPoseEstimation</a> forward method, overrides the <code>__call__</code> special method.',se,Z,ee,N,Xs,rs,Rs,us,Fs;return b=new V({props:{title:"VitPose",local:"vitpose",headingTag:"h1"}}),w=new V({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new V({props:{title:"Usage Tips",local:"usage-tips",headingTag:"h2"}}),$=new js({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjAoJTBBJTIwJTIwJTIwJTIwQXV0b1Byb2Nlc3NvciUyQyUwQSUyMCUyMCUyMCUyMFJURGV0ckZvck9iamVjdERldGVjdGlvbiUyQyUwQSUyMCUyMCUyMCUyMFZpdFBvc2VGb3JQb3NlRXN0aW1hdGlvbiUyQyUwQSklMEElMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAwMDEzOS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEElMjMlMjAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lMEElMjMlMjBTdGFnZSUyMDEuJTIwRGV0ZWN0JTIwaHVtYW5zJTIwb24lMjB0aGUlMjBpbWFnZSUwQSUyMyUyMC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSUwQSUwQSUyMyUyMFlvdSUyMGNhbiUyMGNob29zZSUyMGRldGVjdG9yJTIwYnklMjB5b3VyJTIwY2hvaWNlJTBBcGVyc29uX2ltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlBla2luZ1UlMkZydGRldHJfcjUwdmRfY29jb19vMzY1JTIyKSUwQXBlcnNvbl9tb2RlbCUyMCUzRCUyMFJURGV0ckZvck9iamVjdERldGVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyUGVraW5nVSUyRnJ0ZGV0cl9yNTB2ZF9jb2NvX28zNjUlMjIlMkMlMjBkZXZpY2VfbWFwJTNEZGV2aWNlKSUwQSUwQWlucHV0cyUyMCUzRCUyMHBlcnNvbl9pbWFnZV9wcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBwZXJzb25fbW9kZWwoKippbnB1dHMpJTBBJTBBcmVzdWx0cyUyMCUzRCUyMHBlcnNvbl9pbWFnZV9wcm9jZXNzb3IucG9zdF9wcm9jZXNzX29iamVjdF9kZXRlY3Rpb24oJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyQyUyMHRhcmdldF9zaXplcyUzRHRvcmNoLnRlbnNvciglNUIoaW1hZ2UuaGVpZ2h0JTJDJTIwaW1hZ2Uud2lkdGgpJTVEKSUyQyUyMHRocmVzaG9sZCUzRDAuMyUwQSklMEFyZXN1bHQlMjAlM0QlMjByZXN1bHRzJTVCMCU1RCUyMCUyMCUyMyUyMHRha2UlMjBmaXJzdCUyMGltYWdlJTIwcmVzdWx0cyUwQSUwQSUyMyUyMEh1bWFuJTIwbGFiZWwlMjByZWZlcnMlMjAwJTIwaW5kZXglMjBpbiUyMENPQ08lMjBkYXRhc2V0JTBBcGVyc29uX2JveGVzJTIwJTNEJTIwcmVzdWx0JTVCJTIyYm94ZXMlMjIlNUQlNUJyZXN1bHQlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlM0QlMjAwJTVEJTBBcGVyc29uX2JveGVzJTIwJTNEJTIwcGVyc29uX2JveGVzLmNwdSgpLm51bXB5KCklMEElMEElMjMlMjBDb252ZXJ0JTIwYm94ZXMlMjBmcm9tJTIwVk9DJTIwKHgxJTJDJTIweTElMkMlMjB4MiUyQyUyMHkyKSUyMHRvJTIwQ09DTyUyMCh4MSUyQyUyMHkxJTJDJTIwdyUyQyUyMGgpJTIwZm9ybWF0JTBBcGVyc29uX2JveGVzJTVCJTNBJTJDJTIwMiU1RCUyMCUzRCUyMHBlcnNvbl9ib3hlcyU1QiUzQSUyQyUyMDIlNUQlMjAtJTIwcGVyc29uX2JveGVzJTVCJTNBJTJDJTIwMCU1RCUwQXBlcnNvbl9ib3hlcyU1QiUzQSUyQyUyMDMlNUQlMjAlM0QlMjBwZXJzb25fYm94ZXMlNUIlM0ElMkMlMjAzJTVEJTIwLSUyMHBlcnNvbl9ib3hlcyU1QiUzQSUyQyUyMDElNUQlMEElMEElMjMlMjAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lMEElMjMlMjBTdGFnZSUyMDIuJTIwRGV0ZWN0JTIwa2V5cG9pbnRzJTIwZm9yJTIwZWFjaCUyMHBlcnNvbiUyMGZvdW5kJTBBJTIzJTIwLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIydXN5ZC1jb21tdW5pdHklMkZ2aXRwb3NlLWJhc2Utc2ltcGxlJTIyKSUwQW1vZGVsJTIwJTNEJTIwVml0UG9zZUZvclBvc2VFc3RpbWF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJ1c3lkLWNvbW11bml0eSUyRnZpdHBvc2UtYmFzZS1zaW1wbGUlMjIlMkMlMjBkZXZpY2VfbWFwJTNEZGV2aWNlKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMGJveGVzJTNEJTVCcGVyc29uX2JveGVzJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBcG9zZV9yZXN1bHRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19wb3NlX2VzdGltYXRpb24ob3V0cHV0cyUyQyUyMGJveGVzJTNEJTVCcGVyc29uX2JveGVzJTVEKSUwQWltYWdlX3Bvc2VfcmVzdWx0JTIwJTNEJTIwcG9zZV9yZXN1bHRzJTVCMCU1RCUyMCUyMCUyMyUyMHJlc3VsdHMlMjBmb3IlMjBmaXJzdCUyMGltYWdl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
    AutoProcessor,
    RTDetrForObjectDetection,
    VitPoseForPoseEstimation,
)

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000000139.jpg&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-comment"># ------------------------------------------------------------------------</span>
<span class="hljs-comment"># Stage 1. Detect humans on the image</span>
<span class="hljs-comment"># ------------------------------------------------------------------------</span>

<span class="hljs-comment"># You can choose detector by your choice</span>
person_image_processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;PekingU/rtdetr_r50vd_coco_o365&quot;</span>)
person_model = RTDetrForObjectDetection.from_pretrained(<span class="hljs-string">&quot;PekingU/rtdetr_r50vd_coco_o365&quot;</span>, device_map=device)

inputs = person_image_processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = person_model(**inputs)

results = person_image_processor.post_process_object_detection(
    outputs, target_sizes=torch.tensor([(image.height, image.width)]), threshold=<span class="hljs-number">0.3</span>
)
result = results[<span class="hljs-number">0</span>]  <span class="hljs-comment"># take first image results</span>

<span class="hljs-comment"># Human label refers 0 index in COCO dataset</span>
person_boxes = result[<span class="hljs-string">&quot;boxes&quot;</span>][result[<span class="hljs-string">&quot;labels&quot;</span>] == <span class="hljs-number">0</span>]
person_boxes = person_boxes.cpu().numpy()

<span class="hljs-comment"># Convert boxes from VOC (x1, y1, x2, y2) to COCO (x1, y1, w, h) format</span>
person_boxes[:, <span class="hljs-number">2</span>] = person_boxes[:, <span class="hljs-number">2</span>] - person_boxes[:, <span class="hljs-number">0</span>]
person_boxes[:, <span class="hljs-number">3</span>] = person_boxes[:, <span class="hljs-number">3</span>] - person_boxes[:, <span class="hljs-number">1</span>]

<span class="hljs-comment"># ------------------------------------------------------------------------</span>
<span class="hljs-comment"># Stage 2. Detect keypoints for each person found</span>
<span class="hljs-comment"># ------------------------------------------------------------------------</span>

image_processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;usyd-community/vitpose-base-simple&quot;</span>)
model = VitPoseForPoseEstimation.from_pretrained(<span class="hljs-string">&quot;usyd-community/vitpose-base-simple&quot;</span>, device_map=device)

inputs = image_processor(image, boxes=[person_boxes], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs)

pose_results = image_processor.post_process_pose_estimation(outputs, boxes=[person_boxes])
image_pose_result = pose_results[<span class="hljs-number">0</span>]  <span class="hljs-comment"># results for first image</span>`,wrap:!1}}),P=new V({props:{title:"Visualization for supervision user",local:"visualization-for-supervision-user",headingTag:"h3"}}),D=new js({props:{code:"aW1wb3J0JTIwc3VwZXJ2aXNpb24lMjBhcyUyMHN2JTBBJTBBeHklMjAlM0QlMjB0b3JjaC5zdGFjayglNUJwb3NlX3Jlc3VsdCU1QidrZXlwb2ludHMnJTVEJTIwZm9yJTIwcG9zZV9yZXN1bHQlMjBpbiUyMGltYWdlX3Bvc2VfcmVzdWx0JTVEKS5jcHUoKS5udW1weSgpJTBBc2NvcmVzJTIwJTNEJTIwdG9yY2guc3RhY2soJTVCcG9zZV9yZXN1bHQlNUInc2NvcmVzJyU1RCUyMGZvciUyMHBvc2VfcmVzdWx0JTIwaW4lMjBpbWFnZV9wb3NlX3Jlc3VsdCU1RCkuY3B1KCkubnVtcHkoKSUwQSUwQWtleV9wb2ludHMlMjAlM0QlMjBzdi5LZXlQb2ludHMoJTBBJTIwJTIwJTIwJTIweHklM0R4eSUyQyUyMGNvbmZpZGVuY2UlM0RzY29yZXMlMEEpJTBBJTBBZWRnZV9hbm5vdGF0b3IlMjAlM0QlMjBzdi5FZGdlQW5ub3RhdG9yKCUwQSUyMCUyMCUyMCUyMGNvbG9yJTNEc3YuQ29sb3IuR1JFRU4lMkMlMEElMjAlMjAlMjAlMjB0aGlja25lc3MlM0QxJTBBKSUwQXZlcnRleF9hbm5vdGF0b3IlMjAlM0QlMjBzdi5WZXJ0ZXhBbm5vdGF0b3IoJTBBJTIwJTIwJTIwJTIwY29sb3IlM0Rzdi5Db2xvci5SRUQlMkMlMEElMjAlMjAlMjAlMjByYWRpdXMlM0QyJTBBKSUwQWFubm90YXRlZF9mcmFtZSUyMCUzRCUyMGVkZ2VfYW5ub3RhdG9yLmFubm90YXRlKCUwQSUyMCUyMCUyMCUyMHNjZW5lJTNEaW1hZ2UuY29weSgpJTJDJTBBJTIwJTIwJTIwJTIwa2V5X3BvaW50cyUzRGtleV9wb2ludHMlMEEpJTBBYW5ub3RhdGVkX2ZyYW1lJTIwJTNEJTIwdmVydGV4X2Fubm90YXRvci5hbm5vdGF0ZSglMEElMjAlMjAlMjAlMjBzY2VuZSUzRGFubm90YXRlZF9mcmFtZSUyQyUwQSUyMCUyMCUyMCUyMGtleV9wb2ludHMlM0RrZXlfcG9pbnRzJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> supervision <span class="hljs-keyword">as</span> sv

xy = torch.stack([pose_result[<span class="hljs-string">&#x27;keypoints&#x27;</span>] <span class="hljs-keyword">for</span> pose_result <span class="hljs-keyword">in</span> image_pose_result]).cpu().numpy()
scores = torch.stack([pose_result[<span class="hljs-string">&#x27;scores&#x27;</span>] <span class="hljs-keyword">for</span> pose_result <span class="hljs-keyword">in</span> image_pose_result]).cpu().numpy()

key_points = sv.KeyPoints(
    xy=xy, confidence=scores
)

edge_annotator = sv.EdgeAnnotator(
    color=sv.Color.GREEN,
    thickness=<span class="hljs-number">1</span>
)
vertex_annotator = sv.VertexAnnotator(
    color=sv.Color.RED,
    radius=<span class="hljs-number">2</span>
)
annotated_frame = edge_annotator.annotate(
    scene=image.copy(),
    key_points=key_points
)
annotated_frame = vertex_annotator.annotate(
    scene=annotated_frame,
    key_points=key_points
)`,wrap:!1}}),L=new V({props:{title:"Visualization for advanced user",local:"visualization-for-advanced-user",headingTag:"h3"}}),H=new js({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> math
<span class="hljs-keyword">import</span> cv2

<span class="hljs-keyword">def</span> <span class="hljs-title function_">draw_points</span>(<span class="hljs-params">image, keypoints, scores, pose_keypoint_color, keypoint_score_threshold, radius, show_keypoint_weight</span>):
    <span class="hljs-keyword">if</span> pose_keypoint_color <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
        <span class="hljs-keyword">assert</span> <span class="hljs-built_in">len</span>(pose_keypoint_color) == <span class="hljs-built_in">len</span>(keypoints)
    <span class="hljs-keyword">for</span> kid, (kpt, kpt_score) <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(<span class="hljs-built_in">zip</span>(keypoints, scores)):
        x_coord, y_coord = <span class="hljs-built_in">int</span>(kpt[<span class="hljs-number">0</span>]), <span class="hljs-built_in">int</span>(kpt[<span class="hljs-number">1</span>])
        <span class="hljs-keyword">if</span> kpt_score &gt; keypoint_score_threshold:
            color = <span class="hljs-built_in">tuple</span>(<span class="hljs-built_in">int</span>(c) <span class="hljs-keyword">for</span> c <span class="hljs-keyword">in</span> pose_keypoint_color[kid])
            <span class="hljs-keyword">if</span> show_keypoint_weight:
                cv2.circle(image, (<span class="hljs-built_in">int</span>(x_coord), <span class="hljs-built_in">int</span>(y_coord)), radius, color, -<span class="hljs-number">1</span>)
                transparency = <span class="hljs-built_in">max</span>(<span class="hljs-number">0</span>, <span class="hljs-built_in">min</span>(<span class="hljs-number">1</span>, kpt_score))
                cv2.addWeighted(image, transparency, image, <span class="hljs-number">1</span> - transparency, <span class="hljs-number">0</span>, dst=image)
            <span class="hljs-keyword">else</span>:
                cv2.circle(image, (<span class="hljs-built_in">int</span>(x_coord), <span class="hljs-built_in">int</span>(y_coord)), radius, color, -<span class="hljs-number">1</span>)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">draw_links</span>(<span class="hljs-params">image, keypoints, scores, keypoint_edges, link_colors, keypoint_score_threshold, thickness, show_keypoint_weight, stick_width = <span class="hljs-number">2</span></span>):
    height, width, _ = image.shape
    <span class="hljs-keyword">if</span> keypoint_edges <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span> <span class="hljs-keyword">and</span> link_colors <span class="hljs-keyword">is</span> <span class="hljs-keyword">not</span> <span class="hljs-literal">None</span>:
        <span class="hljs-keyword">assert</span> <span class="hljs-built_in">len</span>(link_colors) == <span class="hljs-built_in">len</span>(keypoint_edges)
        <span class="hljs-keyword">for</span> sk_id, sk <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(keypoint_edges):
            x1, y1, score1 = (<span class="hljs-built_in">int</span>(keypoints[sk[<span class="hljs-number">0</span>], <span class="hljs-number">0</span>]), <span class="hljs-built_in">int</span>(keypoints[sk[<span class="hljs-number">0</span>], <span class="hljs-number">1</span>]), scores[sk[<span class="hljs-number">0</span>]])
            x2, y2, score2 = (<span class="hljs-built_in">int</span>(keypoints[sk[<span class="hljs-number">1</span>], <span class="hljs-number">0</span>]), <span class="hljs-built_in">int</span>(keypoints[sk[<span class="hljs-number">1</span>], <span class="hljs-number">1</span>]), scores[sk[<span class="hljs-number">1</span>]])
            <span class="hljs-keyword">if</span> (
                x1 &gt; <span class="hljs-number">0</span>
                <span class="hljs-keyword">and</span> x1 &lt; width
                <span class="hljs-keyword">and</span> y1 &gt; <span class="hljs-number">0</span>
                <span class="hljs-keyword">and</span> y1 &lt; height
                <span class="hljs-keyword">and</span> x2 &gt; <span class="hljs-number">0</span>
                <span class="hljs-keyword">and</span> x2 &lt; width
                <span class="hljs-keyword">and</span> y2 &gt; <span class="hljs-number">0</span>
                <span class="hljs-keyword">and</span> y2 &lt; height
                <span class="hljs-keyword">and</span> score1 &gt; keypoint_score_threshold
                <span class="hljs-keyword">and</span> score2 &gt; keypoint_score_threshold
            ):
                color = <span class="hljs-built_in">tuple</span>(<span class="hljs-built_in">int</span>(c) <span class="hljs-keyword">for</span> c <span class="hljs-keyword">in</span> link_colors[sk_id])
                <span class="hljs-keyword">if</span> show_keypoint_weight:
                    X = (x1, x2)
                    Y = (y1, y2)
                    mean_x = np.mean(X)
                    mean_y = np.mean(Y)
                    length = ((Y[<span class="hljs-number">0</span>] - Y[<span class="hljs-number">1</span>]) ** <span class="hljs-number">2</span> + (X[<span class="hljs-number">0</span>] - X[<span class="hljs-number">1</span>]) ** <span class="hljs-number">2</span>) ** <span class="hljs-number">0.5</span>
                    angle = math.degrees(math.atan2(Y[<span class="hljs-number">0</span>] - Y[<span class="hljs-number">1</span>], X[<span class="hljs-number">0</span>] - X[<span class="hljs-number">1</span>]))
                    polygon = cv2.ellipse2Poly(
                        (<span class="hljs-built_in">int</span>(mean_x), <span class="hljs-built_in">int</span>(mean_y)), (<span class="hljs-built_in">int</span>(length / <span class="hljs-number">2</span>), <span class="hljs-built_in">int</span>(stick_width)), <span class="hljs-built_in">int</span>(angle), <span class="hljs-number">0</span>, <span class="hljs-number">360</span>, <span class="hljs-number">1</span>
                    )
                    cv2.fillConvexPoly(image, polygon, color)
                    transparency = <span class="hljs-built_in">max</span>(<span class="hljs-number">0</span>, <span class="hljs-built_in">min</span>(<span class="hljs-number">1</span>, <span class="hljs-number">0.5</span> * (keypoints[sk[<span class="hljs-number">0</span>], <span class="hljs-number">2</span>] + keypoints[sk[<span class="hljs-number">1</span>], <span class="hljs-number">2</span>])))
                    cv2.addWeighted(image, transparency, image, <span class="hljs-number">1</span> - transparency, <span class="hljs-number">0</span>, dst=image)
                <span class="hljs-keyword">else</span>:
                    cv2.line(image, (x1, y1), (x2, y2), color, thickness=thickness)


<span class="hljs-comment"># Note: keypoint_edges and color palette are dataset-specific</span>
keypoint_edges = model.config.edges

palette = np.array(
    [
        [<span class="hljs-number">255</span>, <span class="hljs-number">128</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">153</span>, <span class="hljs-number">51</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">178</span>, <span class="hljs-number">102</span>],
        [<span class="hljs-number">230</span>, <span class="hljs-number">230</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">153</span>, <span class="hljs-number">204</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">102</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">51</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">102</span>, <span class="hljs-number">178</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">51</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">153</span>, <span class="hljs-number">153</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">102</span>, <span class="hljs-number">102</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">51</span>, <span class="hljs-number">51</span>],
        [<span class="hljs-number">153</span>, <span class="hljs-number">255</span>, <span class="hljs-number">153</span>],
        [<span class="hljs-number">102</span>, <span class="hljs-number">255</span>, <span class="hljs-number">102</span>],
        [<span class="hljs-number">51</span>, <span class="hljs-number">255</span>, <span class="hljs-number">51</span>],
        [<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">255</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>],
        [<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>],
    ]
)

link_colors = palette[[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>]]
keypoint_colors = palette[[<span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">16</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]]

numpy_image = np.array(image)

<span class="hljs-keyword">for</span> pose_result <span class="hljs-keyword">in</span> image_pose_result:
    scores = np.array(pose_result[<span class="hljs-string">&quot;scores&quot;</span>])
    keypoints = np.array(pose_result[<span class="hljs-string">&quot;keypoints&quot;</span>])

    <span class="hljs-comment"># draw each point on image</span>
    draw_points(numpy_image, keypoints, scores, keypoint_colors, keypoint_score_threshold=<span class="hljs-number">0.3</span>, radius=<span class="hljs-number">4</span>, show_keypoint_weight=<span class="hljs-literal">False</span>)

    <span class="hljs-comment"># draw links</span>
    draw_links(numpy_image, keypoints, scores, keypoint_edges, link_colors, keypoint_score_threshold=<span class="hljs-number">0.3</span>, thickness=<span class="hljs-number">1</span>, show_keypoint_weight=<span class="hljs-literal">False</span>)

pose_image = Image.fromarray(numpy_image)
pose_image`,wrap:!1}}),Y=new V({props:{title:"MoE backbone",local:"moe-backbone",headingTag:"h3"}}),q=new js({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpdFBvc2VCYWNrYm9uZUNvbmZpZyUyQyUyMFZpdFBvc2VCYWNrYm9uZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBY29uZmlnJTIwJTNEJTIwVml0UG9zZUJhY2tib25lQ29uZmlnKG51bV9leHBlcnRzJTNEMyUyQyUyMG91dF9pbmRpY2VzJTNEJTVCLTElNUQpJTBBbW9kZWwlMjAlM0QlMjBWaXRQb3NlQmFja2JvbmUoY29uZmlnKSUwQSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHRvcmNoLnJhbmRuKDMlMkMlMjAzJTJDJTIwMjU2JTJDJTIwMTkyKSUwQWRhdGFzZXRfaW5kZXglMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCMSUyQyUyMDIlMkMlMjAzJTVEKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMlMkMlMjBkYXRhc2V0X2luZGV4KQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitPoseBackboneConfig, VitPoseBackbone
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>config = VitPoseBackboneConfig(num_experts=<span class="hljs-number">3</span>, out_indices=[-<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VitPoseBackbone(config)

<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = torch.randn(<span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">256</span>, <span class="hljs-number">192</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset_index = torch.tensor([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values, dataset_index)`,wrap:!1}}),O=new V({props:{title:"VitPoseImageProcessor",local:"transformers.VitPoseImageProcessor",headingTag:"h2"}}),ss=new bs({props:{name:"class transformers.VitPoseImageProcessor",anchor:"transformers.VitPoseImageProcessor",parameters:[{name:"do_affine_transform",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VitPoseImageProcessor.do_affine_transform",description:`<strong>do_affine_transform</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to apply an affine transformation to the input images.`,name:"do_affine_transform"},{anchor:"transformers.VitPoseImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 256, &quot;width&quot;: 192}</code>):
Resolution of the image after <code>affine_transform</code> is applied. Only has an effect if <code>do_affine_transform</code> is set to <code>True</code>. Can
be overriden by <code>size</code> in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.VitPoseImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to apply the scaling factor (to make pixel values floats between 0. and 1.).`,name:"do_rescale"},{anchor:"transformers.VitPoseImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overriden by <code>rescale_factor</code> in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.VitPoseImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to normalize the input with mean and standard deviation.`,name:"do_normalize"},{anchor:"transformers.VitPoseImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>List[int]</code>, defaults to <code>[0.485, 0.456, 0.406]</code>, <em>optional</em>) &#x2014;
The sequence of means for each channel, to be used when normalizing images.`,name:"image_mean"},{anchor:"transformers.VitPoseImageProcessor.image_std",description:`<strong>image_std</strong> (<code>List[int]</code>, defaults to <code>[0.229, 0.224, 0.225]</code>, <em>optional</em>) &#x2014;
The sequence of standard deviations for each channel, to be used when normalizing images.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/vitpose/image_processing_vitpose.py#L328"}}),es=new bs({props:{name:"preprocess",anchor:"transformers.VitPoseImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"boxes",val:": typing.Union[typing.List[typing.List[float]], numpy.ndarray]"},{name:"do_affine_transform",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"}],parametersDescription:[{anchor:"transformers.VitPoseImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.VitPoseImageProcessor.preprocess.boxes",description:`<strong>boxes</strong> (<code>List[List[List[float]]]</code> or <code>np.ndarray</code>) &#x2014;
List or array of bounding boxes for each image. Each box should be a list of 4 floats representing the bounding
box coordinates in COCO format (top_left_x, top_left_y, width, height).`,name:"boxes"},{anchor:"transformers.VitPoseImageProcessor.preprocess.do_affine_transform",description:`<strong>do_affine_transform</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_affine_transform</code>) &#x2014;
Whether to apply an affine transformation to the input images.`,name:"do_affine_transform"},{anchor:"transformers.VitPoseImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Dictionary in the format <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code> specifying the size of the output image after
resizing.`,name:"size"},{anchor:"transformers.VitPoseImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.VitPoseImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.VitPoseImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.VitPoseImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.VitPoseImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.VitPoseImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_30530/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>, defaults to <code>&apos;np&apos;</code>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/vitpose/image_processing_vitpose.py#L423",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30530/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>pixel_values</strong> — Pixel values to be fed to a model, of shape (batch_size, num_channels, height,
width).</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/pr_30530/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),as=new V({props:{title:"VitPoseConfig",local:"transformers.VitPoseConfig",headingTag:"h2"}}),ns=new bs({props:{name:"class transformers.VitPoseConfig",anchor:"transformers.VitPoseConfig",parameters:[{name:"backbone_config",val:": PretrainedConfig = None"},{name:"backbone",val:": str = None"},{name:"use_pretrained_backbone",val:": bool = False"},{name:"use_timm_backbone",val:": bool = False"},{name:"backbone_kwargs",val:": dict = None"},{name:"initializer_range",val:": float = 0.02"},{name:"scale_factor",val:": int = 4"},{name:"use_simple_decoder",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.VitPoseConfig.backbone_config",description:`<strong>backbone_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>VitPoseBackboneConfig()</code>) &#x2014;
The configuration of the backbone model. Currently, only <code>backbone_config</code> with <code>vitpose_backbone</code> as <code>model_type</code> is supported.`,name:"backbone_config"},{anchor:"transformers.VitPoseConfig.backbone",description:`<strong>backbone</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of backbone to use when <code>backbone_config</code> is <code>None</code>. If <code>use_pretrained_backbone</code> is <code>True</code>, this
will load the corresponding pretrained weights from the timm or transformers library. If <code>use_pretrained_backbone</code>
is <code>False</code>, this loads the backbone&#x2019;s config and uses that to initialize the backbone with random weights.`,name:"backbone"},{anchor:"transformers.VitPoseConfig.use_pretrained_backbone",description:`<strong>use_pretrained_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use pretrained weights for the backbone.`,name:"use_pretrained_backbone"},{anchor:"transformers.VitPoseConfig.use_timm_backbone",description:`<strong>use_timm_backbone</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to load <code>backbone</code> from the timm library. If <code>False</code>, the backbone is loaded from the transformers
library.`,name:"use_timm_backbone"},{anchor:"transformers.VitPoseConfig.backbone_kwargs",description:`<strong>backbone_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Keyword arguments to be passed to AutoBackbone when loading from a checkpoint
e.g. <code>{&apos;out_indices&apos;: (0, 1, 2, 3)}</code>. Cannot be specified if <code>backbone_config</code> is set.`,name:"backbone_kwargs"},{anchor:"transformers.VitPoseConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.VitPoseConfig.scale_factor",description:`<strong>scale_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Factor to upscale the feature maps coming from the ViT backbone.`,name:"scale_factor"},{anchor:"transformers.VitPoseConfig.use_simple_decoder",description:`<strong>use_simple_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use a <code>VitPoseSimpleDecoder</code> to decode the feature maps from the backbone into heatmaps. Otherwise it uses <code>VitPoseClassicDecoder</code>.`,name:"use_simple_decoder"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/vitpose/configuration_vitpose.py#L26"}}),Q=new je({props:{anchor:"transformers.VitPoseConfig.example",$$slots:{default:[Ie]},$$scope:{ctx:v}}}),ls=new V({props:{title:"VitPoseForPoseEstimation",local:"transformers.VitPoseForPoseEstimation",headingTag:"h2"}}),ts=new bs({props:{name:"class transformers.VitPoseForPoseEstimation",anchor:"transformers.VitPoseForPoseEstimation",parameters:[{name:"config",val:": VitPoseConfig"}],parametersDescription:[{anchor:"transformers.VitPoseForPoseEstimation.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30530/en/model_doc/vitpose#transformers.VitPoseConfig">VitPoseConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/pr_30530/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/vitpose/modeling_vitpose.py#L237"}}),os=new bs({props:{name:"forward",anchor:"transformers.VitPoseForPoseEstimation.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"dataset_index",val:": typing.Optional[torch.Tensor] = None"},{name:"flip_pairs",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.VitPoseForPoseEstimation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_30530/en/model_doc/vitpose#transformers.VitPoseImageProcessor">VitPoseImageProcessor</a>. See
<a href="/docs/transformers/pr_30530/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__">VitPoseImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.VitPoseForPoseEstimation.forward.dataset_index",description:`<strong>dataset_index</strong> (<code>torch.Tensor</code> of shape <code>(batch_size,)</code>) &#x2014;
Index to use in the Mixture-of-Experts (MoE) blocks of the backbone.</p>
<p>This corresponds to the dataset index used during training, e.g. For the single dataset index 0 refers to the corresponding dataset. For the multiple datasets index 0 refers to dataset A (e.g. MPII) and index 1 refers to dataset B (e.g. CrowdPose).`,name:"dataset_index"},{anchor:"transformers.VitPoseForPoseEstimation.forward.flip_pairs",description:`<strong>flip_pairs</strong> (<code>torch.tensor</code>, <em>optional</em>) &#x2014;
Whether to mirror pairs of keypoints (for example, left ear &#x2014; right ear).`,name:"flip_pairs"},{anchor:"transformers.VitPoseForPoseEstimation.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.VitPoseForPoseEstimation.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.VitPoseForPoseEstimation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30530/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/vitpose/modeling_vitpose.py#L260",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.vitpose.modeling_vitpose.VitPoseEstimatorOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_30530/en/model_doc/vitpose#transformers.VitPoseConfig"
>VitPoseConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Loss is not supported at this moment. See <a
  href="https://github.com/ViTAE-Transformer/ViTPose/tree/main/mmpose/models/losses"
  rel="nofollow"
>https://github.com/ViTAE-Transformer/ViTPose/tree/main/mmpose/models/losses</a> for further detail.</p>
</li>
<li>
<p><strong>heatmaps</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_keypoints, height, width)</code>) — Heatmaps as predicted by the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states
(also called feature maps) of the model at the output of each stage.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.vitpose.modeling_vitpose.VitPoseEstimatorOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Z=new fe({props:{$$slots:{default:[_e]},$$scope:{ctx:v}}}),N=new je({props:{anchor:"transformers.VitPoseForPoseEstimation.forward.example",$$slots:{default:[Ae]},$$scope:{ctx:v}}}),rs=new Ce({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/vitpose.md"}}),{c(){r=i("meta"),T=l(),j=i("p"),h=l(),c(b.$$.fragment),o=l(),c(w.$$.fragment),Js=l(),E=i("p"),E.innerHTML=ne,ws=l(),W=i("p"),W.textContent=le,Ts=l(),z=i("p"),z.innerHTML=te,gs=l(),x=i("p"),x.innerHTML=oe,fs=l(),X=i("p"),X.innerHTML=re,Cs=l(),c(R.$$.fragment),Is=l(),F=i("p"),F.innerHTML=ie,_s=l(),c($.$$.fragment),As=l(),c(P.$$.fragment),ks=l(),c(D.$$.fragment),Vs=l(),c(L.$$.fragment),vs=l(),c(H.$$.fragment),Ss=l(),S=i("img"),Bs=l(),c(Y.$$.fragment),Qs=l(),K=i("p"),K.innerHTML=ce,Zs=l(),c(q.$$.fragment),Ns=l(),c(O.$$.fragment),Gs=l(),C=i("div"),c(ss.$$.fragment),$s=l(),cs=i("p"),cs.textContent=Me,Ps=l(),B=i("div"),c(es.$$.fragment),Ds=l(),Ms=i("p"),Ms.textContent=me,Es=l(),c(as.$$.fragment),Ws=l(),g=i("div"),c(ns.$$.fragment),Ls=l(),ms=i("p"),ms.innerHTML=ye,Hs=l(),ys=i("p"),ys.innerHTML=de,Ys=l(),c(Q.$$.fragment),zs=l(),c(ls.$$.fragment),xs=l(),I=i("div"),c(ts.$$.fragment),Ks=l(),ds=i("p"),ds.innerHTML=Ue,qs=l(),f=i("div"),c(os.$$.fragment),Os=l(),Us=i("p"),Us.innerHTML=he,se=l(),c(Z.$$.fragment),ee=l(),c(N.$$.fragment),Xs=l(),c(rs.$$.fragment),Rs=l(),us=i("p"),this.h()},l(s){const e=ge("svelte-u9bgzb",document.head);r=p(e,"META",{name:!0,content:!0}),e.forEach(a),T=t(s),j=p(s,"P",{}),ps(j).forEach(a),h=t(s),M(b.$$.fragment,s),o=t(s),M(w.$$.fragment,s),Js=t(s),E=p(s,"P",{"data-svelte-h":!0}),J(E)!=="svelte-1ijga8w"&&(E.innerHTML=ne),ws=t(s),W=p(s,"P",{"data-svelte-h":!0}),J(W)!=="svelte-vfdo9a"&&(W.textContent=le),Ts=t(s),z=p(s,"P",{"data-svelte-h":!0}),J(z)!=="svelte-1r8g7qv"&&(z.innerHTML=te),gs=t(s),x=p(s,"P",{"data-svelte-h":!0}),J(x)!=="svelte-87cofx"&&(x.innerHTML=oe),fs=t(s),X=p(s,"P",{"data-svelte-h":!0}),J(X)!=="svelte-1pkw5cm"&&(X.innerHTML=re),Cs=t(s),M(R.$$.fragment,s),Is=t(s),F=p(s,"P",{"data-svelte-h":!0}),J(F)!=="svelte-jtjg2r"&&(F.innerHTML=ie),_s=t(s),M($.$$.fragment,s),As=t(s),M(P.$$.fragment,s),ks=t(s),M(D.$$.fragment,s),Vs=t(s),M(L.$$.fragment,s),vs=t(s),M(H.$$.fragment,s),Ss=t(s),S=p(s,"IMG",{src:!0,alt:!0,width:!0}),Bs=t(s),M(Y.$$.fragment,s),Qs=t(s),K=p(s,"P",{"data-svelte-h":!0}),J(K)!=="svelte-fxdwhy"&&(K.innerHTML=ce),Zs=t(s),M(q.$$.fragment,s),Ns=t(s),M(O.$$.fragment,s),Gs=t(s),C=p(s,"DIV",{class:!0});var k=ps(C);M(ss.$$.fragment,k),$s=t(k),cs=p(k,"P",{"data-svelte-h":!0}),J(cs)!=="svelte-1uf40pk"&&(cs.textContent=Me),Ps=t(k),B=p(k,"DIV",{class:!0});var is=ps(B);M(es.$$.fragment,is),Ds=t(is),Ms=p(is,"P",{"data-svelte-h":!0}),J(Ms)!=="svelte-1x3yxsa"&&(Ms.textContent=me),is.forEach(a),k.forEach(a),Es=t(s),M(as.$$.fragment,s),Ws=t(s),g=p(s,"DIV",{class:!0});var _=ps(g);M(ns.$$.fragment,_),Ls=t(_),ms=p(_,"P",{"data-svelte-h":!0}),J(ms)!=="svelte-1ag9mgo"&&(ms.innerHTML=ye),Hs=t(_),ys=p(_,"P",{"data-svelte-h":!0}),J(ys)!=="svelte-l1blo3"&&(ys.innerHTML=de),Ys=t(_),M(Q.$$.fragment,_),_.forEach(a),zs=t(s),M(ls.$$.fragment,s),xs=t(s),I=p(s,"DIV",{class:!0});var hs=ps(I);M(ts.$$.fragment,hs),Ks=t(hs),ds=p(hs,"P",{"data-svelte-h":!0}),J(ds)!=="svelte-1eb2kd5"&&(ds.innerHTML=Ue),qs=t(hs),f=p(hs,"DIV",{class:!0});var G=ps(f);M(os.$$.fragment,G),Os=t(G),Us=p(G,"P",{"data-svelte-h":!0}),J(Us)!=="svelte-oywgzg"&&(Us.innerHTML=he),se=t(G),M(Z.$$.fragment,G),ee=t(G),M(N.$$.fragment,G),G.forEach(a),hs.forEach(a),Xs=t(s),M(rs.$$.fragment,s),Rs=t(s),us=p(s,"P",{}),ps(us).forEach(a),this.h()},h(){A(r,"name","hf:doc:metadata"),A(r,"content",Ve),be(S.src,pe="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/vitpose-coco.jpg")||A(S,"src",pe),A(S,"alt","drawing"),A(S,"width","600"),A(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),A(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,e){u(document.head,r),n(s,T,e),n(s,j,e),n(s,h,e),m(b,s,e),n(s,o,e),m(w,s,e),n(s,Js,e),n(s,E,e),n(s,ws,e),n(s,W,e),n(s,Ts,e),n(s,z,e),n(s,gs,e),n(s,x,e),n(s,fs,e),n(s,X,e),n(s,Cs,e),m(R,s,e),n(s,Is,e),n(s,F,e),n(s,_s,e),m($,s,e),n(s,As,e),m(P,s,e),n(s,ks,e),m(D,s,e),n(s,Vs,e),m(L,s,e),n(s,vs,e),m(H,s,e),n(s,Ss,e),n(s,S,e),n(s,Bs,e),m(Y,s,e),n(s,Qs,e),n(s,K,e),n(s,Zs,e),m(q,s,e),n(s,Ns,e),m(O,s,e),n(s,Gs,e),n(s,C,e),m(ss,C,null),u(C,$s),u(C,cs),u(C,Ps),u(C,B),m(es,B,null),u(B,Ds),u(B,Ms),n(s,Es,e),m(as,s,e),n(s,Ws,e),n(s,g,e),m(ns,g,null),u(g,Ls),u(g,ms),u(g,Hs),u(g,ys),u(g,Ys),m(Q,g,null),n(s,zs,e),m(ls,s,e),n(s,xs,e),n(s,I,e),m(ts,I,null),u(I,Ks),u(I,ds),u(I,qs),u(I,f),m(os,f,null),u(f,Os),u(f,Us),u(f,se),m(Z,f,null),u(f,ee),m(N,f,null),n(s,Xs,e),m(rs,s,e),n(s,Rs,e),n(s,us,e),Fs=!0},p(s,[e]){const k={};e&2&&(k.$$scope={dirty:e,ctx:s}),Q.$set(k);const is={};e&2&&(is.$$scope={dirty:e,ctx:s}),Z.$set(is);const _={};e&2&&(_.$$scope={dirty:e,ctx:s}),N.$set(_)},i(s){Fs||(y(b.$$.fragment,s),y(w.$$.fragment,s),y(R.$$.fragment,s),y($.$$.fragment,s),y(P.$$.fragment,s),y(D.$$.fragment,s),y(L.$$.fragment,s),y(H.$$.fragment,s),y(Y.$$.fragment,s),y(q.$$.fragment,s),y(O.$$.fragment,s),y(ss.$$.fragment,s),y(es.$$.fragment,s),y(as.$$.fragment,s),y(ns.$$.fragment,s),y(Q.$$.fragment,s),y(ls.$$.fragment,s),y(ts.$$.fragment,s),y(os.$$.fragment,s),y(Z.$$.fragment,s),y(N.$$.fragment,s),y(rs.$$.fragment,s),Fs=!0)},o(s){d(b.$$.fragment,s),d(w.$$.fragment,s),d(R.$$.fragment,s),d($.$$.fragment,s),d(P.$$.fragment,s),d(D.$$.fragment,s),d(L.$$.fragment,s),d(H.$$.fragment,s),d(Y.$$.fragment,s),d(q.$$.fragment,s),d(O.$$.fragment,s),d(ss.$$.fragment,s),d(es.$$.fragment,s),d(as.$$.fragment,s),d(ns.$$.fragment,s),d(Q.$$.fragment,s),d(ls.$$.fragment,s),d(ts.$$.fragment,s),d(os.$$.fragment,s),d(Z.$$.fragment,s),d(N.$$.fragment,s),d(rs.$$.fragment,s),Fs=!1},d(s){s&&(a(T),a(j),a(h),a(o),a(Js),a(E),a(ws),a(W),a(Ts),a(z),a(gs),a(x),a(fs),a(X),a(Cs),a(Is),a(F),a(_s),a(As),a(ks),a(Vs),a(vs),a(Ss),a(S),a(Bs),a(Qs),a(K),a(Zs),a(Ns),a(Gs),a(C),a(Es),a(Ws),a(g),a(zs),a(xs),a(I),a(Xs),a(Rs),a(us)),a(r),U(b,s),U(w,s),U(R,s),U($,s),U(P,s),U(D,s),U(L,s),U(H,s),U(Y,s),U(q,s),U(O,s),U(ss),U(es),U(as,s),U(ns),U(Q),U(ls,s),U(ts),U(os),U(Z),U(N),U(rs,s)}}}const Ve='{"title":"VitPose","local":"vitpose","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage Tips","local":"usage-tips","sections":[{"title":"Visualization for supervision user","local":"visualization-for-supervision-user","sections":[],"depth":3},{"title":"Visualization for advanced user","local":"visualization-for-advanced-user","sections":[],"depth":3},{"title":"MoE backbone","local":"moe-backbone","sections":[],"depth":3}],"depth":2},{"title":"VitPoseImageProcessor","local":"transformers.VitPoseImageProcessor","sections":[],"depth":2},{"title":"VitPoseConfig","local":"transformers.VitPoseConfig","sections":[],"depth":2},{"title":"VitPoseForPoseEstimation","local":"transformers.VitPoseForPoseEstimation","sections":[],"depth":2}],"depth":1}';function ve(v){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class We extends we{constructor(r){super(),Te(this,r,ve,ke,ue,{})}}export{We as component};
