import{s as Yn,o as qn,n as S}from"../chunks/scheduler.18a86fab.js";import{S as Pn,i as Hn,g as d,s as i,r as h,A as En,h as p,f as a,c as l,j,x as w,u as f,k as v,l as Qn,y as n,a as m,v as u,d as _,t as b,w as y}from"../chunks/index.98837b22.js";import{T as po}from"../chunks/Tip.77304350.js";import{D as x}from"../chunks/Docstring.6758ea23.js";import{C as N}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as ae}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as Y}from"../chunks/Heading.7e7e0c5b.js";import{H as Ln,a as Ks}from"../chunks/HfOption.6641485e.js";import{E as An}from"../chunks/index.499f366c.js";function Dn(J){let t,M="Click on the SigLIP2 models in the right sidebar for more examples of how to apply SigLIP2 to different image and text tasks.";return{c(){t=d("p"),t.textContent=M},l(s){t=p(s,"P",{"data-svelte-h":!0}),w(t)!=="svelte-10s9038"&&(t.textContent=M)},m(s,c){m(s,t,c)},p:S,d(s){s&&a(t)}}}function On(J){let t,M;return t=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEElMEFpbWFnZSUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTBBY2FuZGlkYXRlX2xhYmVscyUyMCUzRCUyMCU1QiUyMmElMjBQYWxsYXMlMjBjYXQlMjIlMkMlMjAlMjJhJTIwbGlvbiUyMiUyQyUyMCUyMmElMjBTaWJlcmlhbiUyMHRpZ2VyJTIyJTVEJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBwaXBlbGluZSh0YXNrJTNEJTIyemVyby1zaG90LWltYWdlLWNsYXNzaWZpY2F0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIlMkMlMjBkZXZpY2UlM0QwJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEFwaXBlbGluZShpbWFnZSUyQyUyMGNhbmRpZGF0ZV9sYWJlbHMlM0RjYW5kaWRhdGVfbGFiZWxzKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

image = <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
candidate_labels = [<span class="hljs-string">&quot;a Pallas cat&quot;</span>, <span class="hljs-string">&quot;a lion&quot;</span>, <span class="hljs-string">&quot;a Siberian tiger&quot;</span>]

pipeline = pipeline(task=<span class="hljs-string">&quot;zero-shot-image-classification&quot;</span>, model=<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>, device=<span class="hljs-number">0</span>, torch_dtype=torch.bfloat16)
pipeline(image, candidate_labels=candidate_labels)`,wrap:!1}}),{c(){h(t.$$.fragment)},l(s){f(t.$$.fragment,s)},m(s,c){u(t,s,c),M=!0},p:S,i(s){M||(_(t.$$.fragment,s),M=!0)},o(s){b(t.$$.fragment,s),M=!1},d(s){y(t,s)}}}function Kn(J){let t,M;return t=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnNpZ2xpcDItYmFzZS1wYXRjaDE2LTIyNCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMnNkcGElMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBY2FuZGlkYXRlX2xhYmVscyUyMCUzRCUyMCU1QiUyMmElMjBQYWxsYXMlMjBjYXQlMjIlMkMlMjAlMjJhJTIwbGlvbiUyMiUyQyUyMCUyMmElMjBTaWJlcmlhbiUyMHRpZ2VyJTIyJTVEJTBBJTBBJTIzJTIwZm9sbG93cyUyMHRoZSUyMHBpcGVsaW5lJTIwcHJvbXB0JTIwdGVtcGxhdGUlMjB0byUyMGdldCUyMHNhbWUlMjByZXN1bHRzJTBBdGV4dHMlMjAlM0QlMjAlNUJmJ1RoaXMlMjBpcyUyMGElMjBwaG90byUyMG9mJTIwJTdCbGFiZWwlN0QuJyUyMGZvciUyMGxhYmVsJTIwaW4lMjBjYW5kaWRhdGVfbGFiZWxzJTVEJTBBJTBBJTIzJTIwSU1QT1JUQU5UJTNBJTIwd2UlMjBwYXNzJTIwJTYwcGFkZGluZyUzRG1heF9sZW5ndGglNjAlMjBhbmQlMjAlNjBtYXhfbGVuZ3RoJTNENjQlNjAlMjBzaW5jZSUyMHRoZSUyMG1vZGVsJTIwd2FzJTIwdHJhaW5lZCUyMHdpdGglMjB0aGlzJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0R0ZXh0cyUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcGFkZGluZyUzRCUyMm1heF9sZW5ndGglMjIlMkMlMjBtYXhfbGVuZ3RoJTNENjQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byglMjJjdWRhJTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUwQXByb2JzJTIwJTNEJTIwdG9yY2guc2lnbW9pZChsb2dpdHNfcGVyX2ltYWdlKSUwQXByaW50KGYlMjIlN0Jwcm9icyU1QjAlNUQlNUIwJTVEJTNBLjElMjUlN0QlMjB0aGF0JTIwaW1hZ2UlMjAwJTIwaXMlMjAnJTdCY2FuZGlkYXRlX2xhYmVscyU1QjAlNUQlN0QnJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<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, AutoModel

model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;auto&quot;</span>, attn_implementation=<span class="hljs-string">&quot;sdpa&quot;</span>)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
candidate_labels = [<span class="hljs-string">&quot;a Pallas cat&quot;</span>, <span class="hljs-string">&quot;a lion&quot;</span>, <span class="hljs-string">&quot;a Siberian tiger&quot;</span>]

<span class="hljs-comment"># follows the pipeline prompt template to get same results</span>
texts = [<span class="hljs-string">f&#x27;This is a photo of <span class="hljs-subst">{label}</span>.&#x27;</span> <span class="hljs-keyword">for</span> label <span class="hljs-keyword">in</span> candidate_labels]

<span class="hljs-comment"># IMPORTANT: we pass \`padding=max_length\` and \`max_length=64\` since the model was trained with this</span>
inputs = processor(text=texts, images=image, padding=<span class="hljs-string">&quot;max_length&quot;</span>, max_length=<span class="hljs-number">64</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

logits_per_image = outputs.logits_per_image
probs = torch.sigmoid(logits_per_image)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{probs[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>]:<span class="hljs-number">.1</span>%}</span> that image 0 is &#x27;<span class="hljs-subst">{candidate_labels[<span class="hljs-number">0</span>]}</span>&#x27;&quot;</span>)`,wrap:!1}}),{c(){h(t.$$.fragment)},l(s){f(t.$$.fragment,s)},m(s,c){u(t,s,c),M=!0},p:S,i(s){M||(_(t.$$.fragment,s),M=!0)},o(s){b(t.$$.fragment,s),M=!1},d(s){y(t,s)}}}function ea(J){let t,M;return t=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnNpZ2xpcDItYmFzZS1wYXRjaDE2LW5hZmxleCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMnNkcGElMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtbmFmbGV4JTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBY2FuZGlkYXRlX2xhYmVscyUyMCUzRCUyMCU1QiUyMmElMjBQYWxsYXMlMjBjYXQlMjIlMkMlMjAlMjJhJTIwbGlvbiUyMiUyQyUyMCUyMmElMjBTaWJlcmlhbiUyMHRpZ2VyJTIyJTVEJTBBdGV4dHMlMjAlM0QlMjAlNUJmJ1RoaXMlMjBpcyUyMGElMjBwaG90byUyMG9mJTIwJTdCbGFiZWwlN0QuJyUyMGZvciUyMGxhYmVsJTIwaW4lMjBjYW5kaWRhdGVfbGFiZWxzJTVEJTBBJTBBJTIzJTIwZGVmYXVsdCUyMHZhbHVlJTIwZm9yJTIwJTYwbWF4X251bV9wYXRjaGVzJTYwJTIwaXMlMjAyNTYlMkMlMjBidXQlMjB5b3UlMjBjYW4lMjBpbmNyZWFzZSUyMHJlc3VsdGVkJTIwaW1hZ2UlMjByZXNvbHV0aW9uJTIwcHJvdmlkaW5nJTIwaGlnaGVyJTIwdmFsdWVzJTIwZS5nLiUyMCU2MG1heF9udW1fcGF0Y2hlcyUzRDUxMiU2MCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdGV4dHMlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHBhZGRpbmclM0QlMjJtYXhfbGVuZ3RoJTIyJTJDJTIwbWF4X251bV9wYXRjaGVzJTNEMjU2JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oJTIyY3VkYSUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMEFwcm9icyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzX3Blcl9pbWFnZSklMEFwcmludChmJTIyJTdCcHJvYnMlNUIwJTVEJTVCMCU1RCUzQS4xJTI1JTdEJTIwdGhhdCUyMGltYWdlJTIwMCUyMGlzJTIwJyU3QmNhbmRpZGF0ZV9sYWJlbHMlNUIwJTVEJTdEJyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<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, AutoModel

model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-naflex&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;auto&quot;</span>, attn_implementation=<span class="hljs-string">&quot;sdpa&quot;</span>)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-naflex&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
candidate_labels = [<span class="hljs-string">&quot;a Pallas cat&quot;</span>, <span class="hljs-string">&quot;a lion&quot;</span>, <span class="hljs-string">&quot;a Siberian tiger&quot;</span>]
texts = [<span class="hljs-string">f&#x27;This is a photo of <span class="hljs-subst">{label}</span>.&#x27;</span> <span class="hljs-keyword">for</span> label <span class="hljs-keyword">in</span> candidate_labels]

<span class="hljs-comment"># default value for \`max_num_patches\` is 256, but you can increase resulted image resolution providing higher values e.g. \`max_num_patches=512\`</span>
inputs = processor(text=texts, images=image, padding=<span class="hljs-string">&quot;max_length&quot;</span>, max_num_patches=<span class="hljs-number">256</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

logits_per_image = outputs.logits_per_image
probs = torch.sigmoid(logits_per_image)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{probs[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>]:<span class="hljs-number">.1</span>%}</span> that image 0 is &#x27;<span class="hljs-subst">{candidate_labels[<span class="hljs-number">0</span>]}</span>&#x27;&quot;</span>)`,wrap:!1}}),{c(){h(t.$$.fragment)},l(s){f(t.$$.fragment,s)},m(s,c){u(t,s,c),M=!0},p:S,i(s){M||(_(t.$$.fragment,s),M=!0)},o(s){b(t.$$.fragment,s),M=!1},d(s){y(t,s)}}}function ta(J){let t,M,s,c,T,o;return t=new Ks({props:{id:"usage",option:"Pipeline",$$slots:{default:[On]},$$scope:{ctx:J}}}),s=new Ks({props:{id:"usage",option:"AutoModel (FixRes)",$$slots:{default:[Kn]},$$scope:{ctx:J}}}),T=new Ks({props:{id:"usage",option:"AutoModel (NaFlex)",$$slots:{default:[ea]},$$scope:{ctx:J}}}),{c(){h(t.$$.fragment),M=i(),h(s.$$.fragment),c=i(),h(T.$$.fragment)},l(g){f(t.$$.fragment,g),M=l(g),f(s.$$.fragment,g),c=l(g),f(T.$$.fragment,g)},m(g,$){u(t,g,$),m(g,M,$),u(s,g,$),m(g,c,$),u(T,g,$),o=!0},p(g,$){const Se={};$&2&&(Se.$$scope={dirty:$,ctx:g}),t.$set(Se);const K={};$&2&&(K.$$scope={dirty:$,ctx:g}),s.$set(K);const Ze={};$&2&&(Ze.$$scope={dirty:$,ctx:g}),T.$set(Ze)},i(g){o||(_(t.$$.fragment,g),_(s.$$.fragment,g),_(T.$$.fragment,g),o=!0)},o(g){b(t.$$.fragment,g),b(s.$$.fragment,g),b(T.$$.fragment,g),o=!1},d(g){g&&(a(M),a(c)),y(t,g),y(s,g),y(T,g)}}}function oa(J){let t,M="Example:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNpZ2xpcDJDb25maWclMkMlMjBTaWdsaXAyTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwU2lnbGlwMkNvbmZpZyUyMHdpdGglMjBnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU2lnbGlwMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFNpZ2xpcDJNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTaWdsaXAyTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmlnJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBhbHNvJTIwaW5pdGlhbGl6ZSUyMGElMjBTaWdsaXAyQ29uZmlnJTIwZnJvbSUyMGElMjBTaWdsaXAyVGV4dENvbmZpZyUyMGFuZCUyMGElMjBTaWdsaXAyVmlzaW9uQ29uZmlnJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNpZ2xpcDJUZXh0Q29uZmlnJTJDJTIwU2lnbGlwMlZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTaWdsaXAyVGV4dCUyMGFuZCUyMFNpZ2xpcDJWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBTaWdsaXAyVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMFNpZ2xpcDJWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMFNpZ2xpcDJDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Siglip2Config, Siglip2Model

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2Config with google/siglip2-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Siglip2Config()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2Model (with random weights) from the google/siglip2-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2Model(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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a Siglip2Config from a Siglip2TextConfig and a Siglip2VisionConfig</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Siglip2TextConfig, Siglip2VisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2Text and Siglip2Vision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = Siglip2TextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = Siglip2VisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = Siglip2Config.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function sa(J){let t,M="Example:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNpZ2xpcDJUZXh0Q29uZmlnJTJDJTIwU2lnbGlwMlRleHRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTaWdsaXAyVGV4dENvbmZpZyUyMHdpdGglMjBnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU2lnbGlwMlRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBTaWdsaXAyVGV4dE1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMFNpZ2xpcDJUZXh0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Siglip2TextConfig, Siglip2TextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2TextConfig with google/siglip2-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Siglip2TextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2TextModel (with random weights) from the google/siglip2-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2TextModel(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(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function na(J){let t,M="Example:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNpZ2xpcDJWaXNpb25Db25maWclMkMlMjBTaWdsaXAyVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwU2lnbGlwMlZpc2lvbkNvbmZpZyUyMHdpdGglMjBnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi1uYWZsZXglMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU2lnbGlwMlZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFNpZ2xpcDJWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtbmFmbGV4JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBTaWdsaXAyVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Siglip2VisionConfig, Siglip2VisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2VisionConfig with google/siglip2-base-patch16-naflex style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Siglip2VisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Siglip2VisionModel (with random weights) from the google/siglip2-base-patch16-naflex style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2VisionModel(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(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-11lpom8"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function aa(J){let t,M=`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(){t=d("p"),t.innerHTML=M},l(s){t=p(s,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(s,c){m(s,t,c)},p:S,d(s){s&&a(t)}}}function ra(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnNpZ2xpcDItYmFzZS1wYXRjaDE2LTIyNCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQXRleHRzJTIwJTNEJTIwJTVCJTIyYSUyMHBob3RvJTIwb2YlMjAyJTIwY2F0cyUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwMiUyMGRvZ3MlMjIlNUQlMEElMjMlMjBpbXBvcnRhbnQlM0ElMjB3ZSUyMHBhc3MlMjAlNjBwYWRkaW5nJTNEbWF4X2xlbmd0aCU2MCUyMHNpbmNlJTIwdGhlJTIwbW9kZWwlMjB3YXMlMjB0cmFpbmVkJTIwd2l0aCUyMHRoaXMlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRHRleHRzJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjBwYWRkaW5nJTNEJTIybWF4X2xlbmd0aCUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTBBcHJvYnMlMjAlM0QlMjB0b3JjaC5zaWdtb2lkKGxvZ2l0c19wZXJfaW1hZ2UpJTIwJTIzJTIwdGhlc2UlMjBhcmUlMjB0aGUlMjBwcm9iYWJpbGl0aWVzJTBBcHJpbnQoZiUyMiU3QnByb2JzJTVCMCU1RCU1QjAlNUQlM0EuMSUyNSU3RCUyMHRoYXQlMjBpbWFnZSUyMDAlMjBpcyUyMCclN0J0ZXh0cyU1QjAlNUQlN0QnJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;a photo of 2 cats&quot;</span>, <span class="hljs-string">&quot;a photo of 2 dogs&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># important: we pass \`padding=max_length\` since the model was trained with this</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, images=image, padding=<span class="hljs-string">&quot;max_length&quot;</span>, 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>logits_per_image = outputs.logits_per_image
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = torch.sigmoid(logits_per_image) <span class="hljs-comment"># these are the probabilities</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{probs[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>]:<span class="hljs-number">.1</span>%}</span> that image 0 is &#x27;<span class="hljs-subst">{texts[<span class="hljs-number">0</span>]}</span>&#x27;&quot;</span>)
<span class="hljs-number">31.9</span>% that image <span class="hljs-number">0</span> <span class="hljs-keyword">is</span> <span class="hljs-string">&#x27;a photo of 2 cats&#x27;</span>`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function ia(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQSUyMyUyMGltcG9ydGFudCUzQSUyMG1ha2UlMjBzdXJlJTIwdG8lMjBzZXQlMjBwYWRkaW5nJTNEJTIybWF4X2xlbmd0aCUyMiUyMGFzJTIwdGhhdCdzJTIwaG93JTIwdGhlJTIwbW9kZWwlMjB3YXMlMjB0cmFpbmVkJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0QlMjJtYXhfbGVuZ3RoJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># important: make sure to set padding=&quot;max_length&quot; as that&#x27;s how the model was trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-string">&quot;max_length&quot;</span>, 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>    text_features = model.get_text_features(**inputs)`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function la(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnNpZ2xpcDItYmFzZS1wYXRjaDE2LTIyNCUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    image_features = model.get_image_features(**inputs)`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function ca(J){let t,M=`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(){t=d("p"),t.innerHTML=M},l(s){t=p(s,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(s,c){m(s,t,c)},p:S,d(s){s&&a(t)}}}function da(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBTaWdsaXAyVGV4dE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBTaWdsaXAyVGV4dE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQSUyMyUyMGltcG9ydGFudCUzQSUyMG1ha2UlMjBzdXJlJTIwdG8lMjBzZXQlMjBwYWRkaW5nJTNEJTIybWF4X2xlbmd0aCUyMiUyMGFzJTIwdGhhdCdzJTIwaG93JTIwdGhlJTIwbW9kZWwlMjB3YXMlMjB0cmFpbmVkJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0QlMjJtYXhfbGVuZ3RoJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMChFT1MlMjB0b2tlbiklMjBzdGF0ZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Siglip2TextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2TextModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># important: make sure to set padding=&quot;max_length&quot; as that&#x27;s how the model was trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-string">&quot;max_length&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function pa(J){let t,M=`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(){t=d("p"),t.innerHTML=M},l(s){t=p(s,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(s,c){m(s,t,c)},p:S,d(s){s&&a(t)}}}function ma(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFNpZ2xpcDJWaXNpb25Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwU2lnbGlwMlZpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwZmVhdHVyZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Siglip2VisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2VisionModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled features</span>`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function ga(J){let t,M=`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(){t=d("p"),t.innerHTML=M},l(s){t=p(s,"P",{"data-svelte-h":!0}),w(t)!=="svelte-fincs2"&&(t.innerHTML=M)},m(s,c){m(s,t,c)},p:S,d(s){s&&a(t)}}}function ha(J){let t,M="Examples:",s,c,T;return c=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFNpZ2xpcDJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQXRvcmNoLm1hbnVhbF9zZWVkKDMpJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMG5vdGUlM0ElMjB3ZSUyMGFyZSUyMGxvYWRpbmclMjBhJTIwJTYwU2lnbGlwMk1vZGVsJTYwJTIwZnJvbSUyMHRoZSUyMGh1YiUyMGhlcmUlMkMlMEElMjMlMjBzbyUyMHRoZSUyMGhlYWQlMjB3aWxsJTIwYmUlMjByYW5kb21seSUyMGluaXRpYWxpemVkJTJDJTIwaGVuY2UlMjB0aGUlMjBwcmVkaWN0aW9ucyUyMHdpbGwlMjBiZSUyMHJhbmRvbSUyMGlmJTIwc2VlZCUyMGlzJTIwbm90JTIwc2V0JTIwYWJvdmUuJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWJhc2UtcGF0Y2gxNi0yMjQlMjIpJTBBbW9kZWwlMjAlM0QlMjBTaWdsaXAyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGc2lnbGlwMi1iYXNlLXBhdGNoMTYtMjI0JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwdHdvJTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHglNUQp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, Siglip2ForImageClassification
<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>torch.manual_seed(<span class="hljs-number">3</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><span class="hljs-comment"># note: we are loading a \`Siglip2Model\` from the hub here,</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># so the head will be randomly initialized, hence the predictions will be random if seed is not set above.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Siglip2ForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&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>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the two classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: LABEL_1`,wrap:!1}}),{c(){t=d("p"),t.textContent=M,s=i(),h(c.$$.fragment)},l(o){t=p(o,"P",{"data-svelte-h":!0}),w(t)!=="svelte-kvfsh7"&&(t.textContent=M),s=l(o),f(c.$$.fragment,o)},m(o,g){m(o,t,g),m(o,s,g),u(c,o,g),T=!0},p:S,i(o){T||(_(c.$$.fragment,o),T=!0)},o(o){b(c.$$.fragment,o),T=!1},d(o){o&&(a(t),a(s)),y(c,o)}}}function fa(J){let t,M,s,c,T,o='<div class="flex flex-wrap space-x-1"><img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/></div>',g,$,Se,K,Ze,Ce,en='<a href="https://huggingface.co/papers/2502.14786" rel="nofollow">SigLIP2</a> is a family of multilingual vision-language encoders that builds on the <a href="./siglip">SigLIP</a> training recipe. It includes decoder-based pretraining, self-distillation, and masked prediction to improve dense prediction tasks (segmentation, depth estimation, etc.). This model is available in two variants:',mo,ze,tn='<li>NaFlex supports different resolutions and maintains the native image aspect ratio</li> <li>FixRes supports fixed resolutions and is backwards compatible with <a href="./siglip">SigLIP</a></li>',go,We,on='You can find all the original SigLIP2 checkpoints under the <a href="https://huggingface.co/collections/google/siglip2-67b5dcef38c175486e240107" rel="nofollow">SigLIP2</a> collection.',ho,re,fo,Be,sn='The example below demonstrates zero-shot classification with <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.Pipeline">Pipeline</a> or the <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoModel">AutoModel</a> class.',uo,ie,_o,ke,nn='Quantization reduces the memory burden of large models by representing the weights in a lower precision. Refer to the <a href="../quantization/overview">Quantization</a> overview for more available quantization backends.',bo,Ge,an='The example below uses <a href="../quantization/bitsandbytes">bitsandbytes</a> to only quantize the weights to int4.',yo,Ne,Mo,Fe,To,Z,vt,rn='<p>Training is supported for DDP and FSDP on single-node multi-GPU setups. However, it does not use <a href="https://pytorch.org/tutorials/beginner/dist_overview.html" rel="nofollow">torch.distributed</a> utilities which may limit the scalability of batch size.</p>',Eo,xt,ln='<p>When using the standalone <a href="/docs/transformers/main/en/model_doc/gemma#transformers.GemmaTokenizerFast">GemmaTokenizerFast</a> make sure to pass <code>padding=&quot;max_length&quot;</code> and <code>max_length=64</code> as that’s how the model was trained.</p>',Qo,$t,cn="<p>Model was trained with <em>lowercased</em> text, so make sure your text labels are preprocessed the same way.</p>",Lo,Ut,dn='<p>To get the same results as the <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.Pipeline">Pipeline</a>, a prompt template of <code>&quot;This is a photo of {label}.&quot;</code> should be passed to the processor.</p>',Ao,It,pn="<p>The NaFlex variant processes different types of images at the appropriate resolution (using a larger resolution to process document images for example), while also minimizing the impact of aspect ratio distortion for certain inference tasks like OCR.</p> <p>NaFlex resizes the input image so the height and width are multiples of the patch size after resizing. It keeps the aspect ratio distortion as low as possible and produces a sequence length of at most the desired target sequence length (<code>max_num_patches</code>). After resizing, the image is split into a sequence of patches and a mask with padding information is added.</p>",Do,Xe,St,mn="Toggle the <code>attn_implementation</code> parameter to either <code>&quot;sdpa&quot;</code> or <code>&quot;flash_attention_2&quot;</code> to use a more memory-efficient attention.",Oo,Re,wo,Ve,Jo,C,Ye,Ko,Zt,gn=`<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config">Siglip2Config</a> is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Model">Siglip2Model</a>. It is used to
instantiate a Siglip2 model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the Siglip2
<a href="https://huggingface.co/google/siglip2-base-patch16-224" rel="nofollow">google/siglip2-base-patch16-224</a> architecture.`,es,Ct,hn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ts,le,os,ce,qe,ss,zt,fn=`Instantiate a <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config">Siglip2Config</a> (or a derived class) from siglip2 text model configuration and siglip2 vision
model configuration.`,jo,Pe,vo,F,He,ns,Wt,un=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextModel">Siglip2TextModel</a>. It is used to instantiate a
Siglip2 text encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the text encoder of the Siglip2
<a href="https://huggingface.co/google/siglip2-base-patch16-224" rel="nofollow">google/siglip2-base-patch16-224</a> architecture.`,as,Bt,_n=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,rs,de,xo,Ee,$o,X,Qe,is,kt,bn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionModel">Siglip2VisionModel</a>. It is used to instantiate a
Siglip2 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the Siglip2
<a href="https://huggingface.co/google/siglip2-base-patch16-naflex" rel="nofollow">google/siglip2-base-patch16-naflex</a> architecture.`,ls,Gt,yn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,cs,pe,Uo,Le,Io,Q,Ae,ds,Nt,Mn="Constructs a SigLIP2 image processor.",ps,me,De,ms,Ft,Tn="Preprocess an image or batch of images.",So,Oe,Zo,L,Ke,gs,Xt,wn="Constructs a fast Siglip2 image processor.",hs,Rt,et,Co,tt,zo,z,ot,fs,Vt,Jn="Constructs a Siglip2 processor which wraps a Siglip2 image processor and a Gemma tokenizer into a single processor.",us,Yt,jn=`<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Processor">Siglip2Processor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2ImageProcessor">Siglip2ImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/gemma#transformers.GemmaTokenizerFast">GemmaTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Processor.decode">decode()</a> for more information.`,_s,ge,st,bs,qt,vn=`This method forwards all its arguments to Siglip2Tokenizer’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ys,he,nt,Ms,Pt,xn=`This method forwards all its arguments to Siglip2Tokenizer’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,Wo,at,Bo,U,rt,Ts,Ht,$n="The bare Siglip2 Model outputting raw hidden-states without any specific head on top.",ws,Et,Un=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Js,Qt,In=`This model is also 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.`,js,q,it,vs,Lt,Sn='The <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Model">Siglip2Model</a> forward method, overrides the <code>__call__</code> special method.',xs,fe,$s,ue,Us,_e,lt,Is,be,Ss,ye,ct,Zs,Me,ko,dt,Go,W,pt,Cs,At,Zn="The text model from Siglip2 without any head or projection on top.",zs,Dt,Cn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Ws,Ot,zn=`This model is also 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.`,Bs,P,mt,ks,Kt,Wn='The <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextModel">Siglip2TextModel</a> forward method, overrides the <code>__call__</code> special method.',Gs,Te,Ns,we,No,gt,Fo,B,ht,Fs,eo,Bn="The vision model from Siglip2 without any head or projection on top.",Xs,to,kn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Rs,oo,Gn=`This model is also 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.`,Vs,H,ft,Ys,so,Nn='The <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionModel">Siglip2VisionModel</a> forward method, overrides the <code>__call__</code> special method.',qs,Je,Ps,je,Xo,ut,Ro,k,_t,Hs,no,Fn=`Siglip2 vision encoder with an image classification head on top (a linear layer on top of the pooled final hidden states of
the patch tokens) e.g. for ImageNet.`,Es,ao,Xn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Qs,ro,Rn=`This model is also 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.`,Ls,E,bt,As,io,Vn='The <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2ForImageClassification">Siglip2ForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',Ds,ve,Os,xe,Vo,yt,Yo,lo,qo;return $=new Y({props:{title:"SigLIP2",local:"siglip2",headingTag:"h1"}}),K=new Y({props:{title:"Overview",local:"overview",headingTag:"h2"}}),re=new po({props:{warning:!1,$$slots:{default:[Dn]},$$scope:{ctx:J}}}),ie=new Ln({props:{id:"usage",options:["Pipeline","AutoModel (FixRes)","AutoModel (NaFlex)"],$$slots:{default:[ta]},$$scope:{ctx:J}}}),Ne=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwQXV0b01vZGVsJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBYm5iX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzRiaXQlM0RUcnVlKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZzaWdsaXAyLWxhcmdlLXBhdGNoMTYtNTEyJTIyJTJDJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRGJuYl9jb25maWclMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiUyQyUyMGF0dG5faW1wbGVtZW50YXRpb24lM0QlMjJzZHBhJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRnNpZ2xpcDItYmFzZS1wYXRjaDE2LTIyNCUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZwaXBlbGluZS1jYXQtY2hvbmsuanBlZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWNhbmRpZGF0ZV9sYWJlbHMlMjAlM0QlMjAlNUIlMjJhJTIwUGFsbGFzJTIwY2F0JTIyJTJDJTIwJTIyYSUyMGxpb24lMjIlMkMlMjAlMjJhJTIwU2liZXJpYW4lMjB0aWdlciUyMiU1RCUwQSUwQSUyMyUyMGZvbGxvd3MlMjB0aGUlMjBwaXBlbGluZSUyMHByb21wdCUyMHRlbXBsYXRlJTIwdG8lMjBnZXQlMjBzYW1lJTIwcmVzdWx0cyUwQXRleHRzJTIwJTNEJTIwJTVCZidUaGlzJTIwaXMlMjBhJTIwcGhvdG8lMjBvZiUyMCU3QmxhYmVsJTdELiclMjBmb3IlMjBsYWJlbCUyMGluJTIwY2FuZGlkYXRlX2xhYmVscyU1RCUwQSUwQSUyMyUyMElNUE9SVEFOVCUzQSUyMHdlJTIwcGFzcyUyMCU2MHBhZGRpbmclM0RtYXhfbGVuZ3RoJTYwJTIwYW5kJTIwJTYwbWF4X2xlbmd0aCUzRDY0JTYwJTIwc2luY2UlMjB0aGUlMjBtb2RlbCUyMHdhcyUyMHRyYWluZWQlMjB3aXRoJTIwdGhpcyUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdGV4dHMlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHBhZGRpbmclM0QlMjJtYXhfbGVuZ3RoJTIyJTJDJTIwbWF4X2xlbmd0aCUzRDY0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oJTIyY3VkYSUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMEFwcm9icyUyMCUzRCUyMHRvcmNoLnNpZ21vaWQobG9naXRzX3Blcl9pbWFnZSklMEFwcmludChmJTIyJTdCcHJvYnMlNUIwJTVEJTVCMCU1RCUzQS4xJTI1JTdEJTIwdGhhdCUyMGltYWdlJTIwMCUyMGlzJTIwJyU3QmNhbmRpZGF0ZV9sYWJlbHMlNUIwJTVEJTdEJyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<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, AutoModel, BitsAndBytesConfig

bnb_config = BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>)
model = AutoModel.from_pretrained(<span class="hljs-string">&quot;google/siglip2-large-patch16-512&quot;</span>, quantization_config=bnb_config, device_map=<span class="hljs-string">&quot;auto&quot;</span>, attn_implementation=<span class="hljs-string">&quot;sdpa&quot;</span>)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;google/siglip2-base-patch16-224&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&quot;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
candidate_labels = [<span class="hljs-string">&quot;a Pallas cat&quot;</span>, <span class="hljs-string">&quot;a lion&quot;</span>, <span class="hljs-string">&quot;a Siberian tiger&quot;</span>]

<span class="hljs-comment"># follows the pipeline prompt template to get same results</span>
texts = [<span class="hljs-string">f&#x27;This is a photo of <span class="hljs-subst">{label}</span>.&#x27;</span> <span class="hljs-keyword">for</span> label <span class="hljs-keyword">in</span> candidate_labels]

<span class="hljs-comment"># IMPORTANT: we pass \`padding=max_length\` and \`max_length=64\` since the model was trained with this</span>
inputs = processor(text=texts, images=image, padding=<span class="hljs-string">&quot;max_length&quot;</span>, max_length=<span class="hljs-number">64</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

logits_per_image = outputs.logits_per_image
probs = torch.sigmoid(logits_per_image)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;<span class="hljs-subst">{probs[<span class="hljs-number">0</span>][<span class="hljs-number">0</span>]:<span class="hljs-number">.1</span>%}</span> that image 0 is &#x27;<span class="hljs-subst">{candidate_labels[<span class="hljs-number">0</span>]}</span>&#x27;&quot;</span>)`,wrap:!1}}),Fe=new Y({props:{title:"Notes",local:"notes",headingTag:"h2"}}),Re=new N({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhc2gtYXR0biUyMC0tbm8tYnVpbGQtaXNvbGF0aW9uJTBBJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNpZ2xpcE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBTaWdsaXBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZ29vZ2xlJTJGc2lnbGlwMi1zbzQwMG0tcGF0Y2gxNC0zODQlMjIlMkMlMEElMjAlMjAlMjAlMjBhdHRuX2ltcGxlbWVudGF0aW9uJTNEJTIyZmxhc2hfYXR0ZW50aW9uXzIlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEZGV2aWNlJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># pip install -U flash-attn --no-build-isolation</span>

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SiglipModel

model = SiglipModel.from_pretrained(
    <span class="hljs-string">&quot;google/siglip2-so400m-patch14-384&quot;</span>,
    attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>,
    torch_dtype=torch.float16,
    device_map=device,
)`,wrap:!1}}),Ve=new Y({props:{title:"Siglip2Config",local:"transformers.Siglip2Config",headingTag:"h2"}}),Ye=new x({props:{name:"class transformers.Siglip2Config",anchor:"transformers.Siglip2Config",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Siglip2Config.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextConfig">Siglip2TextConfig</a>.`,name:"text_config"},{anchor:"transformers.Siglip2Config.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionConfig">Siglip2VisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.Siglip2Config.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/configuration_siglip2.py#L203"}}),le=new ae({props:{anchor:"transformers.Siglip2Config.example",$$slots:{default:[oa]},$$scope:{ctx:J}}}),qe=new x({props:{name:"from_text_vision_configs",anchor:"transformers.Siglip2Config.from_text_vision_configs",parameters:[{name:"text_config",val:": Siglip2TextConfig"},{name:"vision_config",val:": Siglip2VisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/configuration_siglip2.py#L264",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An instance of a configuration object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config"
>Siglip2Config</a></p>
`}}),Pe=new Y({props:{title:"Siglip2TextConfig",local:"transformers.Siglip2TextConfig",headingTag:"h2"}}),He=new x({props:{name:"class transformers.Siglip2TextConfig",anchor:"transformers.Siglip2TextConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"max_position_embeddings",val:" = 64"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"attention_dropout",val:" = 0.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"projection_size",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Siglip2TextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Siglip2 text model. Defines the number of different tokens that can be represented by
the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Model">Siglip2Model</a>.`,name:"vocab_size"},{anchor:"transformers.Siglip2TextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Siglip2TextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Siglip2TextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Siglip2TextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Siglip2TextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.Siglip2TextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Siglip2TextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Siglip2TextConfig.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.Siglip2TextConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The id of the padding token in the vocabulary.`,name:"pad_token_id"},{anchor:"transformers.Siglip2TextConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49406) &#x2014;
The id of the beginning-of-sequence token in the vocabulary.`,name:"bos_token_id"},{anchor:"transformers.Siglip2TextConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 49407) &#x2014;
The id of the end-of-sequence token in the vocabulary.`,name:"eos_token_id"},{anchor:"transformers.Siglip2TextConfig.projection_size",description:`<strong>projection_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>hidden_size</code>) &#x2014;
The size of the projection head.`,name:"projection_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/configuration_siglip2.py#L29"}}),de=new ae({props:{anchor:"transformers.Siglip2TextConfig.example",$$slots:{default:[sa]},$$scope:{ctx:J}}}),Ee=new Y({props:{title:"Siglip2VisionConfig",local:"transformers.Siglip2VisionConfig",headingTag:"h2"}}),Qe=new x({props:{name:"class transformers.Siglip2VisionConfig",anchor:"transformers.Siglip2VisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"num_patches",val:" = 256"},{name:"patch_size",val:" = 16"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"attention_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Siglip2VisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Siglip2VisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Siglip2VisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Siglip2VisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Siglip2VisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.Siglip2VisionConfig.num_patches",description:`<strong>num_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The number of patches in the image with the size of (<code>patch_size</code>, <code>patch_size</code>).
The image is resized to fill maximum of this number of patches, and to preserve
the aspect ratio. In case the resulted number of patches is lower, the image is
padded in &#x201C;patch&#x201D; dimension.`,name:"num_patches"},{anchor:"transformers.Siglip2VisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Siglip2VisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Siglip2VisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Siglip2VisionConfig.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/configuration_siglip2.py#L121"}}),pe=new ae({props:{anchor:"transformers.Siglip2VisionConfig.example",$$slots:{default:[na]},$$scope:{ctx:J}}}),Le=new Y({props:{title:"Siglip2ImageProcessor",local:"transformers.Siglip2ImageProcessor",headingTag:"h2"}}),Ae=new x({props:{name:"class transformers.Siglip2ImageProcessor",anchor:"transformers.Siglip2ImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"resample",val:": PILImageResampling = <Resampling.BILINEAR: 2>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": 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:"do_convert_rgb",val:": typing.Optional[bool] = None"},{name:"patch_size",val:": int = 16"},{name:"max_num_patches",val:": int = 256"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Siglip2ImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s dimensions to fit <code>max_num_patches</code> according to given <code>patch_size</code>.
Can be overridden by <code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.Siglip2ImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.Siglip2ImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.Siglip2ImageProcessor.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 overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.Siglip2ImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image by the specified mean and standard deviation. Can be overridden by
<code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.Siglip2ImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.Siglip2ImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.Siglip2ImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.Siglip2ImageProcessor.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch the image will be split to.`,name:"patch_size"},{anchor:"transformers.Siglip2ImageProcessor.max_num_patches",description:`<strong>max_num_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The image will be resized to have at most this number of patches,
and then padded in &#x201C;patch&#x201D; dimension to match this number exactly.`,name:"max_num_patches"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/image_processing_siglip2.py#L126"}}),De=new x({props:{name:"preprocess",anchor:"transformers.Siglip2ImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"resample",val:": typing.Optional[ForwardRef('PILImageResampling')] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"do_convert_rgb",val:": typing.Optional[bool] = None"},{name:"patch_size",val:": typing.Optional[int] = None"},{name:"max_num_patches",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.Siglip2ImageProcessor.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.Siglip2ImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing.`,name:"size"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.Siglip2ImageProcessor.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.`,name:"do_rescale"},{anchor:"transformers.Siglip2ImageProcessor.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.Siglip2ImageProcessor.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.Siglip2ImageProcessor.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 for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.Siglip2ImageProcessor.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 for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.patch_size</code>) &#x2014;
Patch size for processing, same as the patch size used in the model.`,name:"patch_size"},{anchor:"transformers.Siglip2ImageProcessor.preprocess.max_num_patches",description:`<strong>max_num_patches</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.max_num_patches</code>) &#x2014;
Maximum number of patches per image, the image will be resized to have at most this number of patches.`,name:"max_num_patches"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/image_processing_siglip2.py#L193"}}),Oe=new Y({props:{title:"Siglip2ImageProcessorFast",local:"transformers.Siglip2ImageProcessorFast",headingTag:"h2"}}),Ke=new x({props:{name:"class transformers.Siglip2ImageProcessorFast",anchor:"transformers.Siglip2ImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.siglip2.image_processing_siglip2_fast.Siglip2FastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.Siglip2ImageProcessorFast.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.Siglip2ImageProcessorFast.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.Siglip2ImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.Siglip2ImageProcessorFast.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</code>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.Siglip2ImageProcessorFast.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.Siglip2ImageProcessorFast.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.Siglip2ImageProcessorFast.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.Siglip2ImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</code>, defaults to <code>0.00392156862745098</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.Siglip2ImageProcessorFast.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.Siglip2ImageProcessorFast.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.Siglip2ImageProcessorFast.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.5, 0.5, 0.5]</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.Siglip2ImageProcessorFast.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.Siglip2ImageProcessorFast.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>, defaults to <code>None</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.Siglip2ImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.Siglip2ImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.Siglip2ImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.Siglip2ImageProcessorFast.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch the image will be split to.`,name:"patch_size"},{anchor:"transformers.Siglip2ImageProcessorFast.max_num_patches",description:`<strong>max_num_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The image will be resized to have at most this number of patches,
and then padded in &#x201C;patch&#x201D; dimension to match this number exactly.`,name:"max_num_patches"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/image_processing_siglip2_fast.py#L99"}}),et=new x({props:{name:"preprocess",anchor:"transformers.Siglip2ImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.siglip2.image_processing_siglip2_fast.Siglip2FastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.images",description:`<strong>images</strong> (<code>Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[&apos;PIL.Image.Image&apos;], list[numpy.ndarray], list[&apos;torch.Tensor&apos;]]</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.Siglip2ImageProcessorFast.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</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.Siglip2ImageProcessorFast.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch the image will be split to.`,name:"patch_size"},{anchor:"transformers.Siglip2ImageProcessorFast.preprocess.max_num_patches",description:`<strong>max_num_patches</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The image will be resized to have at most this number of patches,
and then padded in &#x201C;patch&#x201D; dimension to match this number exactly.`,name:"max_num_patches"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/image_processing_siglip2_fast.py#L120",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><strong>data</strong> (<code>dict</code>) — Dictionary of lists/arrays/tensors returned by the <strong>call</strong> method (‘pixel_values’, etc.).</li>
<li><strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) — You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>&lt;class 'transformers.image_processing_base.BatchFeature'&gt;</code></p>
`}}),tt=new Y({props:{title:"Siglip2Processor",local:"transformers.Siglip2Processor",headingTag:"h2"}}),ot=new x({props:{name:"class transformers.Siglip2Processor",anchor:"transformers.Siglip2Processor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.Siglip2Processor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2ImageProcessor">Siglip2ImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.Siglip2Processor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/gemma#transformers.GemmaTokenizerFast">GemmaTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/processing_siglip2.py#L48"}}),st=new x({props:{name:"batch_decode",anchor:"transformers.Siglip2Processor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/processing_siglip2.py#L157"}}),nt=new x({props:{name:"decode",anchor:"transformers.Siglip2Processor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/processing_siglip2.py#L150"}}),at=new Y({props:{title:"Siglip2Model",local:"transformers.Siglip2Model",headingTag:"h2"}}),rt=new x({props:{name:"class transformers.Siglip2Model",anchor:"transformers.Siglip2Model",parameters:[{name:"config",val:": Siglip2Config"}],parametersDescription:[{anchor:"transformers.Siglip2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config">Siglip2Config</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L951"}}),it=new x({props:{name:"forward",anchor:"transformers.Siglip2Model.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"spatial_shapes",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Siglip2Model.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Siglip2Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Siglip2Model.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Siglip2Model.forward.spatial_shapes",description:`<strong>spatial_shapes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the spatial dimensions (height, width) of the input images.`,name:"spatial_shapes"},{anchor:"transformers.Siglip2Model.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Siglip2Model.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Siglip2Model.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.Siglip2Model.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.Siglip2Model.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L1090",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.siglip2.modeling_siglip2.Siglip2Output</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config"
>Siglip2Config</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) — Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image</strong> (<code>torch.FloatTensor</code> of shape <code>(image_batch_size, text_batch_size)</code>) — The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, image_batch_size)</code>) — The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>) — The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextModel"
>Siglip2TextModel</a>.</li>
<li><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionModel"
>Siglip2VisionModel</a>.</li>
<li><strong>text_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextModel"
>Siglip2TextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) — The output of the <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionModel"
>Siglip2VisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.siglip2.modeling_siglip2.Siglip2Output</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),fe=new po({props:{$$slots:{default:[aa]},$$scope:{ctx:J}}}),ue=new ae({props:{anchor:"transformers.Siglip2Model.forward.example",$$slots:{default:[ra]},$$scope:{ctx:J}}}),lt=new x({props:{name:"get_text_features",anchor:"transformers.Siglip2Model.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Siglip2Model.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Siglip2Model.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Siglip2Model.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Siglip2Model.get_text_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Siglip2Model.get_text_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L987",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextModel"
>Siglip2TextModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),be=new ae({props:{anchor:"transformers.Siglip2Model.get_text_features.example",$$slots:{default:[ia]},$$scope:{ctx:J}}}),ct=new x({props:{name:"get_image_features",anchor:"transformers.Siglip2Model.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"spatial_shapes",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Siglip2Model.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Siglip2Model.get_image_features.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Siglip2Model.get_image_features.spatial_shapes",description:`<strong>spatial_shapes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the spatial dimensions (height, width) of the input images.`,name:"spatial_shapes"},{anchor:"transformers.Siglip2Model.get_image_features.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.Siglip2Model.get_image_features.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L1033",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionModel"
>Siglip2VisionModel</a>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Me=new ae({props:{anchor:"transformers.Siglip2Model.get_image_features.example",$$slots:{default:[la]},$$scope:{ctx:J}}}),dt=new Y({props:{title:"Siglip2TextModel",local:"transformers.Siglip2TextModel",headingTag:"h2"}}),pt=new x({props:{name:"class transformers.Siglip2TextModel",anchor:"transformers.Siglip2TextModel",parameters:[{name:"config",val:": Siglip2TextConfig"}],parametersDescription:[{anchor:"transformers.Siglip2TextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2TextConfig">Siglip2TextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L800"}}),mt=new x({props:{name:"forward",anchor:"transformers.Siglip2TextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Siglip2TextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Siglip2TextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Siglip2TextModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Siglip2TextModel.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.Siglip2TextModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L820",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config"
>Siglip2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new po({props:{$$slots:{default:[ca]},$$scope:{ctx:J}}}),we=new ae({props:{anchor:"transformers.Siglip2TextModel.forward.example",$$slots:{default:[da]},$$scope:{ctx:J}}}),gt=new Y({props:{title:"Siglip2VisionModel",local:"transformers.Siglip2VisionModel",headingTag:"h2"}}),ht=new x({props:{name:"class transformers.Siglip2VisionModel",anchor:"transformers.Siglip2VisionModel",parameters:[{name:"config",val:": Siglip2VisionConfig"}],parametersDescription:[{anchor:"transformers.Siglip2VisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2VisionConfig">Siglip2VisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L887"}}),ft=new x({props:{name:"forward",anchor:"transformers.Siglip2VisionModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"pixel_attention_mask",val:": Tensor"},{name:"spatial_shapes",val:": LongTensor"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Siglip2VisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Siglip2VisionModel.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Siglip2VisionModel.forward.spatial_shapes",description:`<strong>spatial_shapes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the spatial dimensions (height, width) of the input images.`,name:"spatial_shapes"},{anchor:"transformers.Siglip2VisionModel.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.Siglip2VisionModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L907",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config"
>Siglip2Config</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Je=new po({props:{$$slots:{default:[pa]},$$scope:{ctx:J}}}),je=new ae({props:{anchor:"transformers.Siglip2VisionModel.forward.example",$$slots:{default:[ma]},$$scope:{ctx:J}}}),ut=new Y({props:{title:"Siglip2ForImageClassification",local:"transformers.Siglip2ForImageClassification",headingTag:"h2"}}),_t=new x({props:{name:"class transformers.Siglip2ForImageClassification",anchor:"transformers.Siglip2ForImageClassification",parameters:[{name:"config",val:": Siglip2Config"}],parametersDescription:[{anchor:"transformers.Siglip2ForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config">Siglip2Config</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L1196"}}),bt=new x({props:{name:"forward",anchor:"transformers.Siglip2ForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"spatial_shapes",val:": typing.Optional[torch.LongTensor] = 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"}],parametersDescription:[{anchor:"transformers.Siglip2ForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Siglip2ForImageClassification.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Siglip2ForImageClassification.forward.spatial_shapes",description:`<strong>spatial_shapes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>) &#x2014;
Tensor containing the spatial dimensions (height, width) of the input images.`,name:"spatial_shapes"},{anchor:"transformers.Siglip2ForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"},{anchor:"transformers.Siglip2ForImageClassification.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.Siglip2ForImageClassification.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip2/modeling_siglip2.py#L1223",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/siglip2#transformers.Siglip2Config"
>Siglip2Config</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) — Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</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><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput"
>transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new po({props:{$$slots:{default:[ga]},$$scope:{ctx:J}}}),xe=new ae({props:{anchor:"transformers.Siglip2ForImageClassification.forward.example",$$slots:{default:[ha]},$$scope:{ctx:J}}}),yt=new An({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/siglip2.md"}}),{c(){t=d("meta"),M=i(),s=d("p"),c=i(),T=d("div"),T.innerHTML=o,g=i(),h($.$$.fragment),Se=i(),h(K.$$.fragment),Ze=i(),Ce=d("p"),Ce.innerHTML=en,mo=i(),ze=d("ul"),ze.innerHTML=tn,go=i(),We=d("p"),We.innerHTML=on,ho=i(),h(re.$$.fragment),fo=i(),Be=d("p"),Be.innerHTML=sn,uo=i(),h(ie.$$.fragment),_o=i(),ke=d("p"),ke.innerHTML=nn,bo=i(),Ge=d("p"),Ge.innerHTML=an,yo=i(),h(Ne.$$.fragment),Mo=i(),h(Fe.$$.fragment),To=i(),Z=d("ul"),vt=d("li"),vt.innerHTML=rn,Eo=i(),xt=d("li"),xt.innerHTML=ln,Qo=i(),$t=d("li"),$t.innerHTML=cn,Lo=i(),Ut=d("li"),Ut.innerHTML=dn,Ao=i(),It=d("li"),It.innerHTML=pn,Do=i(),Xe=d("li"),St=d("p"),St.innerHTML=mn,Oo=i(),h(Re.$$.fragment),wo=i(),h(Ve.$$.fragment),Jo=i(),C=d("div"),h(Ye.$$.fragment),Ko=i(),Zt=d("p"),Zt.innerHTML=gn,es=i(),Ct=d("p"),Ct.innerHTML=hn,ts=i(),h(le.$$.fragment),os=i(),ce=d("div"),h(qe.$$.fragment),ss=i(),zt=d("p"),zt.innerHTML=fn,jo=i(),h(Pe.$$.fragment),vo=i(),F=d("div"),h(He.$$.fragment),ns=i(),Wt=d("p"),Wt.innerHTML=un,as=i(),Bt=d("p"),Bt.innerHTML=_n,rs=i(),h(de.$$.fragment),xo=i(),h(Ee.$$.fragment),$o=i(),X=d("div"),h(Qe.$$.fragment),is=i(),kt=d("p"),kt.innerHTML=bn,ls=i(),Gt=d("p"),Gt.innerHTML=yn,cs=i(),h(pe.$$.fragment),Uo=i(),h(Le.$$.fragment),Io=i(),Q=d("div"),h(Ae.$$.fragment),ds=i(),Nt=d("p"),Nt.textContent=Mn,ps=i(),me=d("div"),h(De.$$.fragment),ms=i(),Ft=d("p"),Ft.textContent=Tn,So=i(),h(Oe.$$.fragment),Zo=i(),L=d("div"),h(Ke.$$.fragment),gs=i(),Xt=d("p"),Xt.textContent=wn,hs=i(),Rt=d("div"),h(et.$$.fragment),Co=i(),h(tt.$$.fragment),zo=i(),z=d("div"),h(ot.$$.fragment),fs=i(),Vt=d("p"),Vt.textContent=Jn,us=i(),Yt=d("p"),Yt.innerHTML=jn,_s=i(),ge=d("div"),h(st.$$.fragment),bs=i(),qt=d("p"),qt.innerHTML=vn,ys=i(),he=d("div"),h(nt.$$.fragment),Ms=i(),Pt=d("p"),Pt.innerHTML=xn,Wo=i(),h(at.$$.fragment),Bo=i(),U=d("div"),h(rt.$$.fragment),Ts=i(),Ht=d("p"),Ht.textContent=$n,ws=i(),Et=d("p"),Et.innerHTML=Un,Js=i(),Qt=d("p"),Qt.innerHTML=In,js=i(),q=d("div"),h(it.$$.fragment),vs=i(),Lt=d("p"),Lt.innerHTML=Sn,xs=i(),h(fe.$$.fragment),$s=i(),h(ue.$$.fragment),Us=i(),_e=d("div"),h(lt.$$.fragment),Is=i(),h(be.$$.fragment),Ss=i(),ye=d("div"),h(ct.$$.fragment),Zs=i(),h(Me.$$.fragment),ko=i(),h(dt.$$.fragment),Go=i(),W=d("div"),h(pt.$$.fragment),Cs=i(),At=d("p"),At.textContent=Zn,zs=i(),Dt=d("p"),Dt.innerHTML=Cn,Ws=i(),Ot=d("p"),Ot.innerHTML=zn,Bs=i(),P=d("div"),h(mt.$$.fragment),ks=i(),Kt=d("p"),Kt.innerHTML=Wn,Gs=i(),h(Te.$$.fragment),Ns=i(),h(we.$$.fragment),No=i(),h(gt.$$.fragment),Fo=i(),B=d("div"),h(ht.$$.fragment),Fs=i(),eo=d("p"),eo.textContent=Bn,Xs=i(),to=d("p"),to.innerHTML=kn,Rs=i(),oo=d("p"),oo.innerHTML=Gn,Vs=i(),H=d("div"),h(ft.$$.fragment),Ys=i(),so=d("p"),so.innerHTML=Nn,qs=i(),h(Je.$$.fragment),Ps=i(),h(je.$$.fragment),Xo=i(),h(ut.$$.fragment),Ro=i(),k=d("div"),h(_t.$$.fragment),Hs=i(),no=d("p"),no.textContent=Fn,Es=i(),ao=d("p"),ao.innerHTML=Xn,Qs=i(),ro=d("p"),ro.innerHTML=Rn,Ls=i(),E=d("div"),h(bt.$$.fragment),As=i(),io=d("p"),io.innerHTML=Vn,Ds=i(),h(ve.$$.fragment),Os=i(),h(xe.$$.fragment),Vo=i(),h(yt.$$.fragment),Yo=i(),lo=d("p"),this.h()},l(e){const r=En("svelte-u9bgzb",document.head);t=p(r,"META",{name:!0,content:!0}),r.forEach(a),M=l(e),s=p(e,"P",{}),j(s).forEach(a),c=l(e),T=p(e,"DIV",{style:!0,"data-svelte-h":!0}),w(T)!=="svelte-8nzrvr"&&(T.innerHTML=o),g=l(e),f($.$$.fragment,e),Se=l(e),f(K.$$.fragment,e),Ze=l(e),Ce=p(e,"P",{"data-svelte-h":!0}),w(Ce)!=="svelte-1fthxqn"&&(Ce.innerHTML=en),mo=l(e),ze=p(e,"UL",{"data-svelte-h":!0}),w(ze)!=="svelte-1g34c3m"&&(ze.innerHTML=tn),go=l(e),We=p(e,"P",{"data-svelte-h":!0}),w(We)!=="svelte-10wgfmd"&&(We.innerHTML=on),ho=l(e),f(re.$$.fragment,e),fo=l(e),Be=p(e,"P",{"data-svelte-h":!0}),w(Be)!=="svelte-rtqz9m"&&(Be.innerHTML=sn),uo=l(e),f(ie.$$.fragment,e),_o=l(e),ke=p(e,"P",{"data-svelte-h":!0}),w(ke)!=="svelte-nf5ooi"&&(ke.innerHTML=nn),bo=l(e),Ge=p(e,"P",{"data-svelte-h":!0}),w(Ge)!=="svelte-11sw8fc"&&(Ge.innerHTML=an),yo=l(e),f(Ne.$$.fragment,e),Mo=l(e),f(Fe.$$.fragment,e),To=l(e),Z=p(e,"UL",{});var G=j(Z);vt=p(G,"LI",{"data-svelte-h":!0}),w(vt)!=="svelte-1xxlu00"&&(vt.innerHTML=rn),Eo=l(G),xt=p(G,"LI",{"data-svelte-h":!0}),w(xt)!=="svelte-1w8nfx"&&(xt.innerHTML=ln),Qo=l(G),$t=p(G,"LI",{"data-svelte-h":!0}),w($t)!=="svelte-lpp7yu"&&($t.innerHTML=cn),Lo=l(G),Ut=p(G,"LI",{"data-svelte-h":!0}),w(Ut)!=="svelte-1uukvfr"&&(Ut.innerHTML=dn),Ao=l(G),It=p(G,"LI",{"data-svelte-h":!0}),w(It)!=="svelte-kch10p"&&(It.innerHTML=pn),Do=l(G),Xe=p(G,"LI",{});var Mt=j(Xe);St=p(Mt,"P",{"data-svelte-h":!0}),w(St)!=="svelte-15v8pg3"&&(St.innerHTML=mn),Oo=l(Mt),f(Re.$$.fragment,Mt),Mt.forEach(a),G.forEach(a),wo=l(e),f(Ve.$$.fragment,e),Jo=l(e),C=p(e,"DIV",{class:!0});var R=j(C);f(Ye.$$.fragment,R),Ko=l(R),Zt=p(R,"P",{"data-svelte-h":!0}),w(Zt)!=="svelte-1vbp23r"&&(Zt.innerHTML=gn),es=l(R),Ct=p(R,"P",{"data-svelte-h":!0}),w(Ct)!=="svelte-o55m63"&&(Ct.innerHTML=hn),ts=l(R),f(le.$$.fragment,R),os=l(R),ce=p(R,"DIV",{class:!0});var Tt=j(ce);f(qe.$$.fragment,Tt),ss=l(Tt),zt=p(Tt,"P",{"data-svelte-h":!0}),w(zt)!=="svelte-p8fqos"&&(zt.innerHTML=fn),Tt.forEach(a),R.forEach(a),jo=l(e),f(Pe.$$.fragment,e),vo=l(e),F=p(e,"DIV",{class:!0});var A=j(F);f(He.$$.fragment,A),ns=l(A),Wt=p(A,"P",{"data-svelte-h":!0}),w(Wt)!=="svelte-12mtkos"&&(Wt.innerHTML=un),as=l(A),Bt=p(A,"P",{"data-svelte-h":!0}),w(Bt)!=="svelte-o55m63"&&(Bt.innerHTML=_n),rs=l(A),f(de.$$.fragment,A),A.forEach(a),xo=l(e),f(Ee.$$.fragment,e),$o=l(e),X=p(e,"DIV",{class:!0});var D=j(X);f(Qe.$$.fragment,D),is=l(D),kt=p(D,"P",{"data-svelte-h":!0}),w(kt)!=="svelte-s3k87c"&&(kt.innerHTML=bn),ls=l(D),Gt=p(D,"P",{"data-svelte-h":!0}),w(Gt)!=="svelte-o55m63"&&(Gt.innerHTML=yn),cs=l(D),f(pe.$$.fragment,D),D.forEach(a),Uo=l(e),f(Le.$$.fragment,e),Io=l(e),Q=p(e,"DIV",{class:!0});var se=j(Q);f(Ae.$$.fragment,se),ds=l(se),Nt=p(se,"P",{"data-svelte-h":!0}),w(Nt)!=="svelte-1wo0rua"&&(Nt.textContent=Mn),ps=l(se),me=p(se,"DIV",{class:!0});var wt=j(me);f(De.$$.fragment,wt),ms=l(wt),Ft=p(wt,"P",{"data-svelte-h":!0}),w(Ft)!=="svelte-1x3yxsa"&&(Ft.textContent=Tn),wt.forEach(a),se.forEach(a),So=l(e),f(Oe.$$.fragment,e),Zo=l(e),L=p(e,"DIV",{class:!0});var ne=j(L);f(Ke.$$.fragment,ne),gs=l(ne),Xt=p(ne,"P",{"data-svelte-h":!0}),w(Xt)!=="svelte-j0d8u"&&(Xt.textContent=wn),hs=l(ne),Rt=p(ne,"DIV",{class:!0});var co=j(Rt);f(et.$$.fragment,co),co.forEach(a),ne.forEach(a),Co=l(e),f(tt.$$.fragment,e),zo=l(e),z=p(e,"DIV",{class:!0});var V=j(z);f(ot.$$.fragment,V),fs=l(V),Vt=p(V,"P",{"data-svelte-h":!0}),w(Vt)!=="svelte-7h512o"&&(Vt.textContent=Jn),us=l(V),Yt=p(V,"P",{"data-svelte-h":!0}),w(Yt)!=="svelte-vzhykd"&&(Yt.innerHTML=jn),_s=l(V),ge=p(V,"DIV",{class:!0});var Jt=j(ge);f(st.$$.fragment,Jt),bs=l(Jt),qt=p(Jt,"P",{"data-svelte-h":!0}),w(qt)!=="svelte-j275wp"&&(qt.innerHTML=vn),Jt.forEach(a),ys=l(V),he=p(V,"DIV",{class:!0});var jt=j(he);f(nt.$$.fragment,jt),Ms=l(jt),Pt=p(jt,"P",{"data-svelte-h":!0}),w(Pt)!=="svelte-1m7qudb"&&(Pt.innerHTML=xn),jt.forEach(a),V.forEach(a),Wo=l(e),f(at.$$.fragment,e),Bo=l(e),U=p(e,"DIV",{class:!0});var I=j(U);f(rt.$$.fragment,I),Ts=l(I),Ht=p(I,"P",{"data-svelte-h":!0}),w(Ht)!=="svelte-1nuputi"&&(Ht.textContent=$n),ws=l(I),Et=p(I,"P",{"data-svelte-h":!0}),w(Et)!=="svelte-6pahdo"&&(Et.innerHTML=Un),Js=l(I),Qt=p(I,"P",{"data-svelte-h":!0}),w(Qt)!=="svelte-hswkmf"&&(Qt.innerHTML=In),js=l(I),q=p(I,"DIV",{class:!0});var O=j(q);f(it.$$.fragment,O),vs=l(O),Lt=p(O,"P",{"data-svelte-h":!0}),w(Lt)!=="svelte-xfz8cd"&&(Lt.innerHTML=Sn),xs=l(O),f(fe.$$.fragment,O),$s=l(O),f(ue.$$.fragment,O),O.forEach(a),Us=l(I),_e=p(I,"DIV",{class:!0});var Po=j(_e);f(lt.$$.fragment,Po),Is=l(Po),f(be.$$.fragment,Po),Po.forEach(a),Ss=l(I),ye=p(I,"DIV",{class:!0});var Ho=j(ye);f(ct.$$.fragment,Ho),Zs=l(Ho),f(Me.$$.fragment,Ho),Ho.forEach(a),I.forEach(a),ko=l(e),f(dt.$$.fragment,e),Go=l(e),W=p(e,"DIV",{class:!0});var ee=j(W);f(pt.$$.fragment,ee),Cs=l(ee),At=p(ee,"P",{"data-svelte-h":!0}),w(At)!=="svelte-fkwm5z"&&(At.textContent=Zn),zs=l(ee),Dt=p(ee,"P",{"data-svelte-h":!0}),w(Dt)!=="svelte-6pahdo"&&(Dt.innerHTML=Cn),Ws=l(ee),Ot=p(ee,"P",{"data-svelte-h":!0}),w(Ot)!=="svelte-hswkmf"&&(Ot.innerHTML=zn),Bs=l(ee),P=p(ee,"DIV",{class:!0});var $e=j(P);f(mt.$$.fragment,$e),ks=l($e),Kt=p($e,"P",{"data-svelte-h":!0}),w(Kt)!=="svelte-12ev6rz"&&(Kt.innerHTML=Wn),Gs=l($e),f(Te.$$.fragment,$e),Ns=l($e),f(we.$$.fragment,$e),$e.forEach(a),ee.forEach(a),No=l(e),f(gt.$$.fragment,e),Fo=l(e),B=p(e,"DIV",{class:!0});var te=j(B);f(ht.$$.fragment,te),Fs=l(te),eo=p(te,"P",{"data-svelte-h":!0}),w(eo)!=="svelte-grfxsq"&&(eo.textContent=Bn),Xs=l(te),to=p(te,"P",{"data-svelte-h":!0}),w(to)!=="svelte-6pahdo"&&(to.innerHTML=kn),Rs=l(te),oo=p(te,"P",{"data-svelte-h":!0}),w(oo)!=="svelte-hswkmf"&&(oo.innerHTML=Gn),Vs=l(te),H=p(te,"DIV",{class:!0});var Ue=j(H);f(ft.$$.fragment,Ue),Ys=l(Ue),so=p(Ue,"P",{"data-svelte-h":!0}),w(so)!=="svelte-148j79d"&&(so.innerHTML=Nn),qs=l(Ue),f(Je.$$.fragment,Ue),Ps=l(Ue),f(je.$$.fragment,Ue),Ue.forEach(a),te.forEach(a),Xo=l(e),f(ut.$$.fragment,e),Ro=l(e),k=p(e,"DIV",{class:!0});var oe=j(k);f(_t.$$.fragment,oe),Hs=l(oe),no=p(oe,"P",{"data-svelte-h":!0}),w(no)!=="svelte-1q70b0m"&&(no.textContent=Fn),Es=l(oe),ao=p(oe,"P",{"data-svelte-h":!0}),w(ao)!=="svelte-6pahdo"&&(ao.innerHTML=Xn),Qs=l(oe),ro=p(oe,"P",{"data-svelte-h":!0}),w(ro)!=="svelte-hswkmf"&&(ro.innerHTML=Rn),Ls=l(oe),E=p(oe,"DIV",{class:!0});var Ie=j(E);f(bt.$$.fragment,Ie),As=l(Ie),io=p(Ie,"P",{"data-svelte-h":!0}),w(io)!=="svelte-nfs11j"&&(io.innerHTML=Vn),Ds=l(Ie),f(ve.$$.fragment,Ie),Os=l(Ie),f(xe.$$.fragment,Ie),Ie.forEach(a),oe.forEach(a),Vo=l(e),f(yt.$$.fragment,e),Yo=l(e),lo=p(e,"P",{}),j(lo).forEach(a),this.h()},h(){v(t,"name","hf:doc:metadata"),v(t,"content",ua),Qn(T,"float","right"),v(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){n(document.head,t),m(e,M,r),m(e,s,r),m(e,c,r),m(e,T,r),m(e,g,r),u($,e,r),m(e,Se,r),u(K,e,r),m(e,Ze,r),m(e,Ce,r),m(e,mo,r),m(e,ze,r),m(e,go,r),m(e,We,r),m(e,ho,r),u(re,e,r),m(e,fo,r),m(e,Be,r),m(e,uo,r),u(ie,e,r),m(e,_o,r),m(e,ke,r),m(e,bo,r),m(e,Ge,r),m(e,yo,r),u(Ne,e,r),m(e,Mo,r),u(Fe,e,r),m(e,To,r),m(e,Z,r),n(Z,vt),n(Z,Eo),n(Z,xt),n(Z,Qo),n(Z,$t),n(Z,Lo),n(Z,Ut),n(Z,Ao),n(Z,It),n(Z,Do),n(Z,Xe),n(Xe,St),n(Xe,Oo),u(Re,Xe,null),m(e,wo,r),u(Ve,e,r),m(e,Jo,r),m(e,C,r),u(Ye,C,null),n(C,Ko),n(C,Zt),n(C,es),n(C,Ct),n(C,ts),u(le,C,null),n(C,os),n(C,ce),u(qe,ce,null),n(ce,ss),n(ce,zt),m(e,jo,r),u(Pe,e,r),m(e,vo,r),m(e,F,r),u(He,F,null),n(F,ns),n(F,Wt),n(F,as),n(F,Bt),n(F,rs),u(de,F,null),m(e,xo,r),u(Ee,e,r),m(e,$o,r),m(e,X,r),u(Qe,X,null),n(X,is),n(X,kt),n(X,ls),n(X,Gt),n(X,cs),u(pe,X,null),m(e,Uo,r),u(Le,e,r),m(e,Io,r),m(e,Q,r),u(Ae,Q,null),n(Q,ds),n(Q,Nt),n(Q,ps),n(Q,me),u(De,me,null),n(me,ms),n(me,Ft),m(e,So,r),u(Oe,e,r),m(e,Zo,r),m(e,L,r),u(Ke,L,null),n(L,gs),n(L,Xt),n(L,hs),n(L,Rt),u(et,Rt,null),m(e,Co,r),u(tt,e,r),m(e,zo,r),m(e,z,r),u(ot,z,null),n(z,fs),n(z,Vt),n(z,us),n(z,Yt),n(z,_s),n(z,ge),u(st,ge,null),n(ge,bs),n(ge,qt),n(z,ys),n(z,he),u(nt,he,null),n(he,Ms),n(he,Pt),m(e,Wo,r),u(at,e,r),m(e,Bo,r),m(e,U,r),u(rt,U,null),n(U,Ts),n(U,Ht),n(U,ws),n(U,Et),n(U,Js),n(U,Qt),n(U,js),n(U,q),u(it,q,null),n(q,vs),n(q,Lt),n(q,xs),u(fe,q,null),n(q,$s),u(ue,q,null),n(U,Us),n(U,_e),u(lt,_e,null),n(_e,Is),u(be,_e,null),n(U,Ss),n(U,ye),u(ct,ye,null),n(ye,Zs),u(Me,ye,null),m(e,ko,r),u(dt,e,r),m(e,Go,r),m(e,W,r),u(pt,W,null),n(W,Cs),n(W,At),n(W,zs),n(W,Dt),n(W,Ws),n(W,Ot),n(W,Bs),n(W,P),u(mt,P,null),n(P,ks),n(P,Kt),n(P,Gs),u(Te,P,null),n(P,Ns),u(we,P,null),m(e,No,r),u(gt,e,r),m(e,Fo,r),m(e,B,r),u(ht,B,null),n(B,Fs),n(B,eo),n(B,Xs),n(B,to),n(B,Rs),n(B,oo),n(B,Vs),n(B,H),u(ft,H,null),n(H,Ys),n(H,so),n(H,qs),u(Je,H,null),n(H,Ps),u(je,H,null),m(e,Xo,r),u(ut,e,r),m(e,Ro,r),m(e,k,r),u(_t,k,null),n(k,Hs),n(k,no),n(k,Es),n(k,ao),n(k,Qs),n(k,ro),n(k,Ls),n(k,E),u(bt,E,null),n(E,As),n(E,io),n(E,Ds),u(ve,E,null),n(E,Os),u(xe,E,null),m(e,Vo,r),u(yt,e,r),m(e,Yo,r),m(e,lo,r),qo=!0},p(e,[r]){const G={};r&2&&(G.$$scope={dirty:r,ctx:e}),re.$set(G);const Mt={};r&2&&(Mt.$$scope={dirty:r,ctx:e}),ie.$set(Mt);const R={};r&2&&(R.$$scope={dirty:r,ctx:e}),le.$set(R);const Tt={};r&2&&(Tt.$$scope={dirty:r,ctx:e}),de.$set(Tt);const A={};r&2&&(A.$$scope={dirty:r,ctx:e}),pe.$set(A);const D={};r&2&&(D.$$scope={dirty:r,ctx:e}),fe.$set(D);const se={};r&2&&(se.$$scope={dirty:r,ctx:e}),ue.$set(se);const wt={};r&2&&(wt.$$scope={dirty:r,ctx:e}),be.$set(wt);const ne={};r&2&&(ne.$$scope={dirty:r,ctx:e}),Me.$set(ne);const co={};r&2&&(co.$$scope={dirty:r,ctx:e}),Te.$set(co);const V={};r&2&&(V.$$scope={dirty:r,ctx:e}),we.$set(V);const Jt={};r&2&&(Jt.$$scope={dirty:r,ctx:e}),Je.$set(Jt);const jt={};r&2&&(jt.$$scope={dirty:r,ctx:e}),je.$set(jt);const I={};r&2&&(I.$$scope={dirty:r,ctx:e}),ve.$set(I);const O={};r&2&&(O.$$scope={dirty:r,ctx:e}),xe.$set(O)},i(e){qo||(_($.$$.fragment,e),_(K.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(Ne.$$.fragment,e),_(Fe.$$.fragment,e),_(Re.$$.fragment,e),_(Ve.$$.fragment,e),_(Ye.$$.fragment,e),_(le.$$.fragment,e),_(qe.$$.fragment,e),_(Pe.$$.fragment,e),_(He.$$.fragment,e),_(de.$$.fragment,e),_(Ee.$$.fragment,e),_(Qe.$$.fragment,e),_(pe.$$.fragment,e),_(Le.$$.fragment,e),_(Ae.$$.fragment,e),_(De.$$.fragment,e),_(Oe.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(ot.$$.fragment,e),_(st.$$.fragment,e),_(nt.$$.fragment,e),_(at.$$.fragment,e),_(rt.$$.fragment,e),_(it.$$.fragment,e),_(fe.$$.fragment,e),_(ue.$$.fragment,e),_(lt.$$.fragment,e),_(be.$$.fragment,e),_(ct.$$.fragment,e),_(Me.$$.fragment,e),_(dt.$$.fragment,e),_(pt.$$.fragment,e),_(mt.$$.fragment,e),_(Te.$$.fragment,e),_(we.$$.fragment,e),_(gt.$$.fragment,e),_(ht.$$.fragment,e),_(ft.$$.fragment,e),_(Je.$$.fragment,e),_(je.$$.fragment,e),_(ut.$$.fragment,e),_(_t.$$.fragment,e),_(bt.$$.fragment,e),_(ve.$$.fragment,e),_(xe.$$.fragment,e),_(yt.$$.fragment,e),qo=!0)},o(e){b($.$$.fragment,e),b(K.$$.fragment,e),b(re.$$.fragment,e),b(ie.$$.fragment,e),b(Ne.$$.fragment,e),b(Fe.$$.fragment,e),b(Re.$$.fragment,e),b(Ve.$$.fragment,e),b(Ye.$$.fragment,e),b(le.$$.fragment,e),b(qe.$$.fragment,e),b(Pe.$$.fragment,e),b(He.$$.fragment,e),b(de.$$.fragment,e),b(Ee.$$.fragment,e),b(Qe.$$.fragment,e),b(pe.$$.fragment,e),b(Le.$$.fragment,e),b(Ae.$$.fragment,e),b(De.$$.fragment,e),b(Oe.$$.fragment,e),b(Ke.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(ot.$$.fragment,e),b(st.$$.fragment,e),b(nt.$$.fragment,e),b(at.$$.fragment,e),b(rt.$$.fragment,e),b(it.$$.fragment,e),b(fe.$$.fragment,e),b(ue.$$.fragment,e),b(lt.$$.fragment,e),b(be.$$.fragment,e),b(ct.$$.fragment,e),b(Me.$$.fragment,e),b(dt.$$.fragment,e),b(pt.$$.fragment,e),b(mt.$$.fragment,e),b(Te.$$.fragment,e),b(we.$$.fragment,e),b(gt.$$.fragment,e),b(ht.$$.fragment,e),b(ft.$$.fragment,e),b(Je.$$.fragment,e),b(je.$$.fragment,e),b(ut.$$.fragment,e),b(_t.$$.fragment,e),b(bt.$$.fragment,e),b(ve.$$.fragment,e),b(xe.$$.fragment,e),b(yt.$$.fragment,e),qo=!1},d(e){e&&(a(M),a(s),a(c),a(T),a(g),a(Se),a(Ze),a(Ce),a(mo),a(ze),a(go),a(We),a(ho),a(fo),a(Be),a(uo),a(_o),a(ke),a(bo),a(Ge),a(yo),a(Mo),a(To),a(Z),a(wo),a(Jo),a(C),a(jo),a(vo),a(F),a(xo),a($o),a(X),a(Uo),a(Io),a(Q),a(So),a(Zo),a(L),a(Co),a(zo),a(z),a(Wo),a(Bo),a(U),a(ko),a(Go),a(W),a(No),a(Fo),a(B),a(Xo),a(Ro),a(k),a(Vo),a(Yo),a(lo)),a(t),y($,e),y(K,e),y(re,e),y(ie,e),y(Ne,e),y(Fe,e),y(Re),y(Ve,e),y(Ye),y(le),y(qe),y(Pe,e),y(He),y(de),y(Ee,e),y(Qe),y(pe),y(Le,e),y(Ae),y(De),y(Oe,e),y(Ke),y(et),y(tt,e),y(ot),y(st),y(nt),y(at,e),y(rt),y(it),y(fe),y(ue),y(lt),y(be),y(ct),y(Me),y(dt,e),y(pt),y(mt),y(Te),y(we),y(gt,e),y(ht),y(ft),y(Je),y(je),y(ut,e),y(_t),y(bt),y(ve),y(xe),y(yt,e)}}}const ua='{"title":"SigLIP2","local":"siglip2","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Notes","local":"notes","sections":[],"depth":2},{"title":"Siglip2Config","local":"transformers.Siglip2Config","sections":[],"depth":2},{"title":"Siglip2TextConfig","local":"transformers.Siglip2TextConfig","sections":[],"depth":2},{"title":"Siglip2VisionConfig","local":"transformers.Siglip2VisionConfig","sections":[],"depth":2},{"title":"Siglip2ImageProcessor","local":"transformers.Siglip2ImageProcessor","sections":[],"depth":2},{"title":"Siglip2ImageProcessorFast","local":"transformers.Siglip2ImageProcessorFast","sections":[],"depth":2},{"title":"Siglip2Processor","local":"transformers.Siglip2Processor","sections":[],"depth":2},{"title":"Siglip2Model","local":"transformers.Siglip2Model","sections":[],"depth":2},{"title":"Siglip2TextModel","local":"transformers.Siglip2TextModel","sections":[],"depth":2},{"title":"Siglip2VisionModel","local":"transformers.Siglip2VisionModel","sections":[],"depth":2},{"title":"Siglip2ForImageClassification","local":"transformers.Siglip2ForImageClassification","sections":[],"depth":2}],"depth":1}';function _a(J){return qn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $a extends Pn{constructor(t){super(),Hn(this,t,_a,fa,Yn,{})}}export{$a as component};
