import{S as mt,i as ft,s as ht,e as o,k as p,w as h,t as c,M as gt,c as n,d as a,m as i,a as r,x as g,h as m,b as f,N as ct,G as e,g as l,y as u,L as ut,q as b,o as d,B as _,v as bt}from"../../chunks/vendor-hf-doc-builder.js";import{I as Ma}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as P}from"../../chunks/CodeBlock-hf-doc-builder.js";import{D as dt}from"../../chunks/DocNotebookDropdown-hf-doc-builder.js";function _t(Aa){let x,js,$,y,rs,I,Ws,ps,sa,xs,M,$s,Y,aa,ws,J,ta,vs,Q,ea,ks,U,la,ys,V,oa,qs,q,is,na,ra,cs,pa,Es,K,ia,zs,A,Ps,w,E,ms,D,ca,fs,ma,Is,v,hs,fa,ha,S,ga,ua,Ms,H,As,W,ba,Ds,N,Ss,B,ss,Da,Hs,j,da,gs,_a,ja,us,xa,$a,Ns,C,Bs,k,z,bs,T,wa,ds,va,Cs,as,ka,Ts,F,L,ya,qa,Fs,G,Ls,ts,Ea,Gs,O,Os,Z,es,Sa,Zs,ls,za,Rs,R,Xs,os,Pa,Ys,X,Js;return I=new Ma({}),M=new dt({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/zero_shot_image_classification.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/zero_shot_image_classification.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/zero_shot_image_classification.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/zero_shot_image_classification.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/zero_shot_image_classification.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/zero_shot_image_classification.ipynb"}]}}),A=new P({props:{code:"pip install -q transformers",highlighted:"pip install -q transformers"}}),D=new Ma({}),H=new P({props:{code:`from transformers import pipeline

checkpoint = "openai/clip-vit-large-patch14"
detector = pipeline(model=checkpoint, task="zero-shot-image-classification")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>checkpoint = <span class="hljs-string">&quot;openai/clip-vit-large-patch14&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>detector = pipeline(model=checkpoint, task=<span class="hljs-string">&quot;zero-shot-image-classification&quot;</span>)`}}),N=new P({props:{code:`from PIL import Image
import requests

url = "https://unsplash.com/photos/g8oS8-82DxI/download?ixid=MnwxMjA3fDB8MXx0b3BpY3x8SnBnNktpZGwtSGt8fHx8fDJ8fDE2NzgxMDYwODc&force=true&w=640"
image = Image.open(requests.get(url, stream=True).raw)

image`,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>url = <span class="hljs-string">&quot;https://unsplash.com/photos/g8oS8-82DxI/download?ixid=MnwxMjA3fDB8MXx0b3BpY3x8SnBnNktpZGwtSGt8fHx8fDJ8fDE2NzgxMDYwODc&amp;force=true&amp;w=640&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>image`}}),C=new P({props:{code:`predictions = classifier(image, candidate_labels=["fox", "bear", "seagull", "owl"])
predictions`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>predictions = classifier(image, candidate_labels=[<span class="hljs-string">&quot;fox&quot;</span>, <span class="hljs-string">&quot;bear&quot;</span>, <span class="hljs-string">&quot;seagull&quot;</span>, <span class="hljs-string">&quot;owl&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>predictions
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9996670484542847</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;owl&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.000199399160919711</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;seagull&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">7.392891711788252e-05</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;fox&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">5.96074532950297e-05</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bear&#x27;</span>}]`}}),T=new Ma({}),G=new P({props:{code:`from transformers import AutoProcessor, AutoModelForZeroShotImageClassification

model = AutoModelForZeroShotImageClassification.from_pretrained(checkpoint)
processor = AutoProcessor.from_pretrained(checkpoint)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForZeroShotImageClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForZeroShotImageClassification.from_pretrained(checkpoint)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(checkpoint)`}}),O=new P({props:{code:`from PIL import Image
import requests

url = "https://unsplash.com/photos/xBRQfR2bqNI/download?ixid=MnwxMjA3fDB8MXxhbGx8fHx8fHx8fHwxNjc4Mzg4ODEx&force=true&w=640"
image = Image.open(requests.get(url, stream=True).raw)

image`,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>url = <span class="hljs-string">&quot;https://unsplash.com/photos/xBRQfR2bqNI/download?ixid=MnwxMjA3fDB8MXxhbGx8fHx8fHx8fHwxNjc4Mzg4ODEx&amp;force=true&amp;w=640&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>image`}}),R=new P({props:{code:`candidate_labels = ["tree", "car", "bike", "cat"]
inputs = processor(images=image, text=candidate_labels, return_tensors="pt", padding=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>candidate_labels = [<span class="hljs-string">&quot;tree&quot;</span>, <span class="hljs-string">&quot;car&quot;</span>, <span class="hljs-string">&quot;bike&quot;</span>, <span class="hljs-string">&quot;cat&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, text=candidate_labels, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)`}}),X=new P({props:{code:`import torch

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

logits = outputs.logits_per_image[0]
probs = logits.softmax(dim=-1).numpy()
scores = probs.tolist()

result = [
    {"score": score, "label": candidate_label}
    for score, candidate_label in sorted(zip(probs, candidate_labels), key=lambda x: -x[0])
]

result`,highlighted:`<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">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits_per_image[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits.softmax(dim=-<span class="hljs-number">1</span>).numpy()
<span class="hljs-meta">&gt;&gt;&gt; </span>scores = probs.tolist()

<span class="hljs-meta">&gt;&gt;&gt; </span>result = [
<span class="hljs-meta">... </span>    {<span class="hljs-string">&quot;score&quot;</span>: score, <span class="hljs-string">&quot;label&quot;</span>: candidate_label}
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> score, candidate_label <span class="hljs-keyword">in</span> <span class="hljs-built_in">sorted</span>(<span class="hljs-built_in">zip</span>(probs, candidate_labels), key=<span class="hljs-keyword">lambda</span> x: -x[<span class="hljs-number">0</span>])
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>result
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.998572</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;car&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0010570387</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bike&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0003393686</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;tree&#x27;</span>},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">3.1572064e-05</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cat&#x27;</span>}]`}}),{c(){x=o("meta"),js=p(),$=o("h1"),y=o("a"),rs=o("span"),h(I.$$.fragment),Ws=p(),ps=o("span"),sa=c("\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958"),xs=p(),h(M.$$.fragment),$s=p(),Y=o("p"),aa=c("\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958\uB294 \uD2B9\uC815 \uCE74\uD14C\uACE0\uB9AC\uC758 \uC608\uC2DC\uAC00 \uD3EC\uD568\uB41C \uB370\uC774\uD130\uB97C \uD559\uC2B5\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD574 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC218\uD589\uD558\uB294 \uC791\uC5C5\uC785\uB2C8\uB2E4."),ws=p(),J=o("p"),ta=c(`\uC77C\uBC18\uC801\uC73C\uB85C \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC704\uD574\uC11C\uB294 \uB808\uC774\uBE14\uC774 \uB2EC\uB9B0 \uD2B9\uC815 \uC774\uBBF8\uC9C0 \uB370\uC774\uD130\uB85C \uBAA8\uB378 \uD559\uC2B5\uC774 \uD544\uC694\uD558\uBA70, \uC774 \uBAA8\uB378\uC740 \uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD2B9\uC9D5\uC744 \uB808\uC774\uBE14\uC5D0 \u201C\uB9E4\uD551\u201D\uD558\uB294 \uBC29\uBC95\uC744 \uD559\uC2B5\uD569\uB2C8\uB2E4.
\uC0C8\uB85C\uC6B4 \uB808\uC774\uBE14\uC774 \uC788\uB294 \uBD84\uB958 \uC791\uC5C5\uC5D0 \uC774\uB7EC\uD55C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD574\uC57C \uD558\uB294 \uACBD\uC6B0\uC5D0\uB294, \uBAA8\uB378\uC744 \u201C\uC7AC\uBCF4\uC815\u201D\uD558\uAE30 \uC704\uD574 \uBBF8\uC138 \uC870\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.`),vs=p(),Q=o("p"),ea=c(`\uC774\uC640 \uB300\uC870\uC801\uC73C\uB85C, \uC81C\uB85C\uC0F7 \uB610\uB294 \uAC1C\uBC29\uD615 \uC5B4\uD718(open vocabulary) \uC774\uBBF8\uC9C0 \uBD84\uB958 \uBAA8\uB378\uC740 \uC77C\uBC18\uC801\uC73C\uB85C \uB300\uADDC\uBAA8 \uC774\uBBF8\uC9C0 \uB370\uC774\uD130\uC640 \uD574\uB2F9 \uC124\uBA85\uC5D0 \uB300\uD574 \uD559\uC2B5\uB41C \uBA40\uD2F0\uBAA8\uB2EC(multimodal) \uBAA8\uB378\uC785\uB2C8\uB2E4.
\uC774\uB7EC\uD55C \uBAA8\uB378\uC740 \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uD3EC\uD568\uD55C \uB9CE\uC740 \uB2E4\uC6B4\uC2A4\uD2B8\uB9BC \uC791\uC5C5\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB294 \uC815\uB82C\uB41C(aligned) \uBE44\uC804 \uC5B8\uC5B4 \uD45C\uD604\uC744 \uD559\uC2B5\uD569\uB2C8\uB2E4.`),ks=p(),U=o("p"),la=c(`\uC774\uB294 \uC774\uBBF8\uC9C0 \uBD84\uB958\uC5D0 \uB300\uD55C \uBCF4\uB2E4 \uC720\uC5F0\uD55C \uC811\uADFC \uBC29\uC2DD\uC73C\uB85C, \uCD94\uAC00 \uD559\uC2B5 \uB370\uC774\uD130 \uC5C6\uC774 \uC0C8\uB85C\uC6B4 \uB808\uC774\uBE14\uC774\uB098 \uD559\uC2B5\uD558\uC9C0 \uBABB\uD55C \uCE74\uD14C\uACE0\uB9AC\uC5D0 \uB300\uD574 \uBAA8\uB378\uC744 \uC77C\uBC18\uD654\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
\uB610\uD55C, \uC0AC\uC6A9\uC790\uAC00 \uB300\uC0C1 \uAC1C\uCCB4\uC5D0 \uB300\uD55C \uC790\uC720 \uD615\uC2DD\uC758 \uD14D\uC2A4\uD2B8 \uC124\uBA85\uC73C\uB85C \uC774\uBBF8\uC9C0\uB97C \uAC80\uC0C9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),ys=p(),V=o("p"),oa=c("\uC774\uBC88 \uAC00\uC774\uB4DC\uC5D0\uC11C \uBC30\uC6B8 \uB0B4\uC6A9\uC740 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4:"),qs=p(),q=o("ul"),is=o("li"),na=c("\uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778 \uB9CC\uB4E4\uAE30"),ra=p(),cs=o("li"),pa=c("\uC9C1\uC811 \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uBAA8\uB378 \uCD94\uB860 \uC2E4\uD589\uD558\uAE30"),Es=p(),K=o("p"),ia=c("\uC2DC\uC791\uD558\uAE30 \uC804\uC5D0 \uD544\uC694\uD55C \uB77C\uC774\uBE0C\uB7EC\uB9AC\uAC00 \uBAA8\uB450 \uC124\uCE58\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694:"),zs=p(),h(A.$$.fragment),Ps=p(),w=o("h2"),E=o("a"),ms=o("span"),h(D.$$.fragment),ca=p(),fs=o("span"),ma=c("\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778"),Is=p(),v=o("p"),hs=o("code"),fa=c("pipeline()"),ha=c(`\uC744 \uD65C\uC6A9\uD558\uBA74 \uAC00\uC7A5 \uAC04\uB2E8\uD558\uAC8C \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC9C0\uC6D0\uD558\uB294 \uBAA8\uB378\uB85C \uCD94\uB860\uD574\uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4.
`),S=o("a"),ga=c("Hugging Face Hub\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uCCB4\uD06C\uD3EC\uC778\uD2B8"),ua=c("\uC5D0\uC11C \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC778\uC2A4\uD134\uC2A4\uD654\uD569\uB2C8\uB2E4."),Ms=p(),h(H.$$.fragment),As=p(),W=o("p"),ba=c("\uB2E4\uC74C\uC73C\uB85C, \uBD84\uB958\uD558\uACE0 \uC2F6\uC740 \uC774\uBBF8\uC9C0\uB97C \uC120\uD0DD\uD558\uC138\uC694."),Ds=p(),h(N.$$.fragment),Ss=p(),B=o("div"),ss=o("img"),Hs=p(),j=o("p"),da=c("\uC774\uBBF8\uC9C0\uC640 \uD574\uB2F9 \uC774\uBBF8\uC9C0\uC758 \uD6C4\uBCF4 \uB808\uC774\uBE14\uC778 "),gs=o("code"),_a=c("candidate_labels"),ja=c(`\uB97C \uD30C\uC774\uD504\uB77C\uC778\uC73C\uB85C \uC804\uB2EC\uD569\uB2C8\uB2E4.
\uC5EC\uAE30\uC11C\uB294 \uC774\uBBF8\uC9C0\uB97C \uC9C1\uC811 \uC804\uB2EC\uD558\uC9C0\uB9CC, \uCEF4\uD4E8\uD130\uC5D0 \uC800\uC7A5\uB41C \uC774\uBBF8\uC9C0\uC758 \uACBD\uB85C\uB098 url\uB85C \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4.
`),us=o("code"),xa=c("candidate_labels"),$a=c("\uB294 \uC774 \uC608\uC2DC\uCC98\uB7FC \uAC04\uB2E8\uD55C \uB2E8\uC5B4\uC77C \uC218\uB3C4 \uC788\uACE0 \uC880 \uB354 \uC124\uBA85\uC801\uC778 \uB2E8\uC5B4\uC77C \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),Ns=p(),h(C.$$.fragment),Bs=p(),k=o("h2"),z=o("a"),bs=o("span"),h(T.$$.fragment),wa=p(),ds=o("span"),va=c("\uC9C1\uC811 \uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958\uD558\uAE30"),Cs=p(),as=o("p"),ka=c("\uC774\uC81C \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778 \uC0AC\uC6A9 \uBC29\uBC95\uC744 \uC0B4\uD3B4\uBCF4\uC558\uC73C\uB2C8, \uC2E4\uD589\uD558\uB294 \uBC29\uBC95\uC744 \uC0B4\uD3B4\uBCF4\uACA0\uC2B5\uB2C8\uB2E4."),Ts=p(),F=o("p"),L=o("a"),ya=c("Hugging Face Hub\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uCCB4\uD06C\uD3EC\uC778\uD2B8"),qa=c(`\uC5D0\uC11C \uBAA8\uB378\uACFC \uD504\uB85C\uC138\uC11C\uB97C \uAC00\uC838\uC624\uB294 \uAC83\uC73C\uB85C \uC2DC\uC791\uD569\uB2C8\uB2E4.
\uC5EC\uAE30\uC11C\uB294 \uC774\uC804\uACFC \uB3D9\uC77C\uD55C \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uC0AC\uC6A9\uD558\uACA0\uC2B5\uB2C8\uB2E4:`),Fs=p(),h(G.$$.fragment),Ls=p(),ts=o("p"),Ea=c("\uB2E4\uB978 \uC774\uBBF8\uC9C0\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4."),Gs=p(),h(O.$$.fragment),Os=p(),Z=o("div"),es=o("img"),Zs=p(),ls=o("p"),za=c(`\uD504\uB85C\uC138\uC11C\uB97C \uC0AC\uC6A9\uD574 \uBAA8\uB378\uC758 \uC785\uB825\uC744 \uC900\uBE44\uD569\uB2C8\uB2E4.
\uD504\uB85C\uC138\uC11C\uB294 \uBAA8\uB378\uC758 \uC785\uB825\uC73C\uB85C \uC0AC\uC6A9\uD558\uAE30 \uC704\uD574 \uC774\uBBF8\uC9C0 \uD06C\uAE30\uB97C \uBCC0\uD658\uD558\uACE0 \uC815\uADDC\uD654\uD558\uB294 \uC774\uBBF8\uC9C0 \uD504\uB85C\uC138\uC11C\uC640 \uD14D\uC2A4\uD2B8 \uC785\uB825\uC744 \uCC98\uB9AC\uD558\uB294 \uD1A0\uD06C\uB098\uC774\uC800\uB85C \uAD6C\uC131\uB429\uB2C8\uB2E4.`),Rs=p(),h(R.$$.fragment),Xs=p(),os=o("p"),Pa=c("\uBAA8\uB378\uC5D0 \uC785\uB825\uC744 \uC804\uB2EC\uD558\uACE0, \uACB0\uACFC\uB97C \uD6C4\uCC98\uB9AC\uD569\uB2C8\uB2E4:"),Ys=p(),h(X.$$.fragment),this.h()},l(s){const t=gt('[data-svelte="svelte-1phssyn"]',document.head);x=n(t,"META",{name:!0,content:!0}),t.forEach(a),js=i(s),$=n(s,"H1",{class:!0});var Qs=r($);y=n(Qs,"A",{id:!0,class:!0,href:!0});var Ha=r(y);rs=n(Ha,"SPAN",{});var Na=r(rs);g(I.$$.fragment,Na),Na.forEach(a),Ha.forEach(a),Ws=i(Qs),ps=n(Qs,"SPAN",{});var Ba=r(ps);sa=m(Ba,"\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958"),Ba.forEach(a),Qs.forEach(a),xs=i(s),g(M.$$.fragment,s),$s=i(s),Y=n(s,"P",{});var Ca=r(Y);aa=m(Ca,"\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958\uB294 \uD2B9\uC815 \uCE74\uD14C\uACE0\uB9AC\uC758 \uC608\uC2DC\uAC00 \uD3EC\uD568\uB41C \uB370\uC774\uD130\uB97C \uD559\uC2B5\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD574 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC218\uD589\uD558\uB294 \uC791\uC5C5\uC785\uB2C8\uB2E4."),Ca.forEach(a),ws=i(s),J=n(s,"P",{});var Ta=r(J);ta=m(Ta,`\uC77C\uBC18\uC801\uC73C\uB85C \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC704\uD574\uC11C\uB294 \uB808\uC774\uBE14\uC774 \uB2EC\uB9B0 \uD2B9\uC815 \uC774\uBBF8\uC9C0 \uB370\uC774\uD130\uB85C \uBAA8\uB378 \uD559\uC2B5\uC774 \uD544\uC694\uD558\uBA70, \uC774 \uBAA8\uB378\uC740 \uD2B9\uC815 \uC774\uBBF8\uC9C0\uC758 \uD2B9\uC9D5\uC744 \uB808\uC774\uBE14\uC5D0 \u201C\uB9E4\uD551\u201D\uD558\uB294 \uBC29\uBC95\uC744 \uD559\uC2B5\uD569\uB2C8\uB2E4.
\uC0C8\uB85C\uC6B4 \uB808\uC774\uBE14\uC774 \uC788\uB294 \uBD84\uB958 \uC791\uC5C5\uC5D0 \uC774\uB7EC\uD55C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD574\uC57C \uD558\uB294 \uACBD\uC6B0\uC5D0\uB294, \uBAA8\uB378\uC744 \u201C\uC7AC\uBCF4\uC815\u201D\uD558\uAE30 \uC704\uD574 \uBBF8\uC138 \uC870\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.`),Ta.forEach(a),vs=i(s),Q=n(s,"P",{});var Fa=r(Q);ea=m(Fa,`\uC774\uC640 \uB300\uC870\uC801\uC73C\uB85C, \uC81C\uB85C\uC0F7 \uB610\uB294 \uAC1C\uBC29\uD615 \uC5B4\uD718(open vocabulary) \uC774\uBBF8\uC9C0 \uBD84\uB958 \uBAA8\uB378\uC740 \uC77C\uBC18\uC801\uC73C\uB85C \uB300\uADDC\uBAA8 \uC774\uBBF8\uC9C0 \uB370\uC774\uD130\uC640 \uD574\uB2F9 \uC124\uBA85\uC5D0 \uB300\uD574 \uD559\uC2B5\uB41C \uBA40\uD2F0\uBAA8\uB2EC(multimodal) \uBAA8\uB378\uC785\uB2C8\uB2E4.
\uC774\uB7EC\uD55C \uBAA8\uB378\uC740 \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uD3EC\uD568\uD55C \uB9CE\uC740 \uB2E4\uC6B4\uC2A4\uD2B8\uB9BC \uC791\uC5C5\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB294 \uC815\uB82C\uB41C(aligned) \uBE44\uC804 \uC5B8\uC5B4 \uD45C\uD604\uC744 \uD559\uC2B5\uD569\uB2C8\uB2E4.`),Fa.forEach(a),ks=i(s),U=n(s,"P",{});var La=r(U);la=m(La,`\uC774\uB294 \uC774\uBBF8\uC9C0 \uBD84\uB958\uC5D0 \uB300\uD55C \uBCF4\uB2E4 \uC720\uC5F0\uD55C \uC811\uADFC \uBC29\uC2DD\uC73C\uB85C, \uCD94\uAC00 \uD559\uC2B5 \uB370\uC774\uD130 \uC5C6\uC774 \uC0C8\uB85C\uC6B4 \uB808\uC774\uBE14\uC774\uB098 \uD559\uC2B5\uD558\uC9C0 \uBABB\uD55C \uCE74\uD14C\uACE0\uB9AC\uC5D0 \uB300\uD574 \uBAA8\uB378\uC744 \uC77C\uBC18\uD654\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
\uB610\uD55C, \uC0AC\uC6A9\uC790\uAC00 \uB300\uC0C1 \uAC1C\uCCB4\uC5D0 \uB300\uD55C \uC790\uC720 \uD615\uC2DD\uC758 \uD14D\uC2A4\uD2B8 \uC124\uBA85\uC73C\uB85C \uC774\uBBF8\uC9C0\uB97C \uAC80\uC0C9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),La.forEach(a),ys=i(s),V=n(s,"P",{});var Ga=r(V);oa=m(Ga,"\uC774\uBC88 \uAC00\uC774\uB4DC\uC5D0\uC11C \uBC30\uC6B8 \uB0B4\uC6A9\uC740 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4:"),Ga.forEach(a),qs=i(s),q=n(s,"UL",{});var Us=r(q);is=n(Us,"LI",{});var Oa=r(is);na=m(Oa,"\uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778 \uB9CC\uB4E4\uAE30"),Oa.forEach(a),ra=i(Us),cs=n(Us,"LI",{});var Za=r(cs);pa=m(Za,"\uC9C1\uC811 \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uBAA8\uB378 \uCD94\uB860 \uC2E4\uD589\uD558\uAE30"),Za.forEach(a),Us.forEach(a),Es=i(s),K=n(s,"P",{});var Ra=r(K);ia=m(Ra,"\uC2DC\uC791\uD558\uAE30 \uC804\uC5D0 \uD544\uC694\uD55C \uB77C\uC774\uBE0C\uB7EC\uB9AC\uAC00 \uBAA8\uB450 \uC124\uCE58\uB418\uC5B4 \uC788\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694:"),Ra.forEach(a),zs=i(s),g(A.$$.fragment,s),Ps=i(s),w=n(s,"H2",{class:!0});var Vs=r(w);E=n(Vs,"A",{id:!0,class:!0,href:!0});var Xa=r(E);ms=n(Xa,"SPAN",{});var Ya=r(ms);g(D.$$.fragment,Ya),Ya.forEach(a),Xa.forEach(a),ca=i(Vs),fs=n(Vs,"SPAN",{});var Ja=r(fs);ma=m(Ja,"\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778"),Ja.forEach(a),Vs.forEach(a),Is=i(s),v=n(s,"P",{});var _s=r(v);hs=n(_s,"CODE",{});var Qa=r(hs);fa=m(Qa,"pipeline()"),Qa.forEach(a),ha=m(_s,`\uC744 \uD65C\uC6A9\uD558\uBA74 \uAC00\uC7A5 \uAC04\uB2E8\uD558\uAC8C \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958\uB97C \uC9C0\uC6D0\uD558\uB294 \uBAA8\uB378\uB85C \uCD94\uB860\uD574\uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4.
`),S=n(_s,"A",{href:!0,rel:!0});var Ua=r(S);ga=m(Ua,"Hugging Face Hub\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uCCB4\uD06C\uD3EC\uC778\uD2B8"),Ua.forEach(a),ua=m(_s,"\uC5D0\uC11C \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC778\uC2A4\uD134\uC2A4\uD654\uD569\uB2C8\uB2E4."),_s.forEach(a),Ms=i(s),g(H.$$.fragment,s),As=i(s),W=n(s,"P",{});var Va=r(W);ba=m(Va,"\uB2E4\uC74C\uC73C\uB85C, \uBD84\uB958\uD558\uACE0 \uC2F6\uC740 \uC774\uBBF8\uC9C0\uB97C \uC120\uD0DD\uD558\uC138\uC694."),Va.forEach(a),Ds=i(s),g(N.$$.fragment,s),Ss=i(s),B=n(s,"DIV",{class:!0});var Ka=r(B);ss=n(Ka,"IMG",{src:!0,alt:!0}),Ka.forEach(a),Hs=i(s),j=n(s,"P",{});var ns=r(j);da=m(ns,"\uC774\uBBF8\uC9C0\uC640 \uD574\uB2F9 \uC774\uBBF8\uC9C0\uC758 \uD6C4\uBCF4 \uB808\uC774\uBE14\uC778 "),gs=n(ns,"CODE",{});var Wa=r(gs);_a=m(Wa,"candidate_labels"),Wa.forEach(a),ja=m(ns,`\uB97C \uD30C\uC774\uD504\uB77C\uC778\uC73C\uB85C \uC804\uB2EC\uD569\uB2C8\uB2E4.
\uC5EC\uAE30\uC11C\uB294 \uC774\uBBF8\uC9C0\uB97C \uC9C1\uC811 \uC804\uB2EC\uD558\uC9C0\uB9CC, \uCEF4\uD4E8\uD130\uC5D0 \uC800\uC7A5\uB41C \uC774\uBBF8\uC9C0\uC758 \uACBD\uB85C\uB098 url\uB85C \uC804\uB2EC\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4.
`),us=n(ns,"CODE",{});var st=r(us);xa=m(st,"candidate_labels"),st.forEach(a),$a=m(ns,"\uB294 \uC774 \uC608\uC2DC\uCC98\uB7FC \uAC04\uB2E8\uD55C \uB2E8\uC5B4\uC77C \uC218\uB3C4 \uC788\uACE0 \uC880 \uB354 \uC124\uBA85\uC801\uC778 \uB2E8\uC5B4\uC77C \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),ns.forEach(a),Ns=i(s),g(C.$$.fragment,s),Bs=i(s),k=n(s,"H2",{class:!0});var Ks=r(k);z=n(Ks,"A",{id:!0,class:!0,href:!0});var at=r(z);bs=n(at,"SPAN",{});var tt=r(bs);g(T.$$.fragment,tt),tt.forEach(a),at.forEach(a),wa=i(Ks),ds=n(Ks,"SPAN",{});var et=r(ds);va=m(et,"\uC9C1\uC811 \uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958\uD558\uAE30"),et.forEach(a),Ks.forEach(a),Cs=i(s),as=n(s,"P",{});var lt=r(as);ka=m(lt,"\uC774\uC81C \uC81C\uB85C\uC0F7 \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778 \uC0AC\uC6A9 \uBC29\uBC95\uC744 \uC0B4\uD3B4\uBCF4\uC558\uC73C\uB2C8, \uC2E4\uD589\uD558\uB294 \uBC29\uBC95\uC744 \uC0B4\uD3B4\uBCF4\uACA0\uC2B5\uB2C8\uB2E4."),lt.forEach(a),Ts=i(s),F=n(s,"P",{});var Ia=r(F);L=n(Ia,"A",{href:!0,rel:!0});var ot=r(L);ya=m(ot,"Hugging Face Hub\uC5D0 \uC5C5\uB85C\uB4DC\uB41C \uCCB4\uD06C\uD3EC\uC778\uD2B8"),ot.forEach(a),qa=m(Ia,`\uC5D0\uC11C \uBAA8\uB378\uACFC \uD504\uB85C\uC138\uC11C\uB97C \uAC00\uC838\uC624\uB294 \uAC83\uC73C\uB85C \uC2DC\uC791\uD569\uB2C8\uB2E4.
\uC5EC\uAE30\uC11C\uB294 \uC774\uC804\uACFC \uB3D9\uC77C\uD55C \uCCB4\uD06C\uD3EC\uC778\uD2B8\uB97C \uC0AC\uC6A9\uD558\uACA0\uC2B5\uB2C8\uB2E4:`),Ia.forEach(a),Fs=i(s),g(G.$$.fragment,s),Ls=i(s),ts=n(s,"P",{});var nt=r(ts);Ea=m(nt,"\uB2E4\uB978 \uC774\uBBF8\uC9C0\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4."),nt.forEach(a),Gs=i(s),g(O.$$.fragment,s),Os=i(s),Z=n(s,"DIV",{class:!0});var rt=r(Z);es=n(rt,"IMG",{src:!0,alt:!0}),rt.forEach(a),Zs=i(s),ls=n(s,"P",{});var pt=r(ls);za=m(pt,`\uD504\uB85C\uC138\uC11C\uB97C \uC0AC\uC6A9\uD574 \uBAA8\uB378\uC758 \uC785\uB825\uC744 \uC900\uBE44\uD569\uB2C8\uB2E4.
\uD504\uB85C\uC138\uC11C\uB294 \uBAA8\uB378\uC758 \uC785\uB825\uC73C\uB85C \uC0AC\uC6A9\uD558\uAE30 \uC704\uD574 \uC774\uBBF8\uC9C0 \uD06C\uAE30\uB97C \uBCC0\uD658\uD558\uACE0 \uC815\uADDC\uD654\uD558\uB294 \uC774\uBBF8\uC9C0 \uD504\uB85C\uC138\uC11C\uC640 \uD14D\uC2A4\uD2B8 \uC785\uB825\uC744 \uCC98\uB9AC\uD558\uB294 \uD1A0\uD06C\uB098\uC774\uC800\uB85C \uAD6C\uC131\uB429\uB2C8\uB2E4.`),pt.forEach(a),Rs=i(s),g(R.$$.fragment,s),Xs=i(s),os=n(s,"P",{});var it=r(os);Pa=m(it,"\uBAA8\uB378\uC5D0 \uC785\uB825\uC744 \uC804\uB2EC\uD558\uACE0, \uACB0\uACFC\uB97C \uD6C4\uCC98\uB9AC\uD569\uB2C8\uB2E4:"),it.forEach(a),Ys=i(s),g(X.$$.fragment,s),this.h()},h(){f(x,"name","hf:doc:metadata"),f(x,"content",JSON.stringify(jt)),f(y,"id","zeroshot-image-classification"),f(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(y,"href","#zeroshot-image-classification"),f($,"class","relative group"),f(E,"id","zeroshot-image-classification-pipeline"),f(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(E,"href","#zeroshot-image-classification-pipeline"),f(w,"class","relative group"),f(S,"href","https://huggingface.co/models?pipeline_tag=zero-shot-image-classification&sort=downloads"),f(S,"rel","nofollow"),ct(ss.src,Da="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/owl.jpg")||f(ss,"src",Da),f(ss,"alt","Photo of an owl"),f(B,"class","flex justify-center"),f(z,"id","zeroshot-image-classification-by-hand"),f(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(z,"href","#zeroshot-image-classification-by-hand"),f(k,"class","relative group"),f(L,"href","https://huggingface.co/models?pipeline_tag=zero-shot-image-classification&sort=downloads"),f(L,"rel","nofollow"),ct(es.src,Sa="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg")||f(es,"src",Sa),f(es,"alt","Photo of a car"),f(Z,"class","flex justify-center")},m(s,t){e(document.head,x),l(s,js,t),l(s,$,t),e($,y),e(y,rs),u(I,rs,null),e($,Ws),e($,ps),e(ps,sa),l(s,xs,t),u(M,s,t),l(s,$s,t),l(s,Y,t),e(Y,aa),l(s,ws,t),l(s,J,t),e(J,ta),l(s,vs,t),l(s,Q,t),e(Q,ea),l(s,ks,t),l(s,U,t),e(U,la),l(s,ys,t),l(s,V,t),e(V,oa),l(s,qs,t),l(s,q,t),e(q,is),e(is,na),e(q,ra),e(q,cs),e(cs,pa),l(s,Es,t),l(s,K,t),e(K,ia),l(s,zs,t),u(A,s,t),l(s,Ps,t),l(s,w,t),e(w,E),e(E,ms),u(D,ms,null),e(w,ca),e(w,fs),e(fs,ma),l(s,Is,t),l(s,v,t),e(v,hs),e(hs,fa),e(v,ha),e(v,S),e(S,ga),e(v,ua),l(s,Ms,t),u(H,s,t),l(s,As,t),l(s,W,t),e(W,ba),l(s,Ds,t),u(N,s,t),l(s,Ss,t),l(s,B,t),e(B,ss),l(s,Hs,t),l(s,j,t),e(j,da),e(j,gs),e(gs,_a),e(j,ja),e(j,us),e(us,xa),e(j,$a),l(s,Ns,t),u(C,s,t),l(s,Bs,t),l(s,k,t),e(k,z),e(z,bs),u(T,bs,null),e(k,wa),e(k,ds),e(ds,va),l(s,Cs,t),l(s,as,t),e(as,ka),l(s,Ts,t),l(s,F,t),e(F,L),e(L,ya),e(F,qa),l(s,Fs,t),u(G,s,t),l(s,Ls,t),l(s,ts,t),e(ts,Ea),l(s,Gs,t),u(O,s,t),l(s,Os,t),l(s,Z,t),e(Z,es),l(s,Zs,t),l(s,ls,t),e(ls,za),l(s,Rs,t),u(R,s,t),l(s,Xs,t),l(s,os,t),e(os,Pa),l(s,Ys,t),u(X,s,t),Js=!0},p:ut,i(s){Js||(b(I.$$.fragment,s),b(M.$$.fragment,s),b(A.$$.fragment,s),b(D.$$.fragment,s),b(H.$$.fragment,s),b(N.$$.fragment,s),b(C.$$.fragment,s),b(T.$$.fragment,s),b(G.$$.fragment,s),b(O.$$.fragment,s),b(R.$$.fragment,s),b(X.$$.fragment,s),Js=!0)},o(s){d(I.$$.fragment,s),d(M.$$.fragment,s),d(A.$$.fragment,s),d(D.$$.fragment,s),d(H.$$.fragment,s),d(N.$$.fragment,s),d(C.$$.fragment,s),d(T.$$.fragment,s),d(G.$$.fragment,s),d(O.$$.fragment,s),d(R.$$.fragment,s),d(X.$$.fragment,s),Js=!1},d(s){a(x),s&&a(js),s&&a($),_(I),s&&a(xs),_(M,s),s&&a($s),s&&a(Y),s&&a(ws),s&&a(J),s&&a(vs),s&&a(Q),s&&a(ks),s&&a(U),s&&a(ys),s&&a(V),s&&a(qs),s&&a(q),s&&a(Es),s&&a(K),s&&a(zs),_(A,s),s&&a(Ps),s&&a(w),_(D),s&&a(Is),s&&a(v),s&&a(Ms),_(H,s),s&&a(As),s&&a(W),s&&a(Ds),_(N,s),s&&a(Ss),s&&a(B),s&&a(Hs),s&&a(j),s&&a(Ns),_(C,s),s&&a(Bs),s&&a(k),_(T),s&&a(Cs),s&&a(as),s&&a(Ts),s&&a(F),s&&a(Fs),_(G,s),s&&a(Ls),s&&a(ts),s&&a(Gs),_(O,s),s&&a(Os),s&&a(Z),s&&a(Zs),s&&a(ls),s&&a(Rs),_(R,s),s&&a(Xs),s&&a(os),s&&a(Ys),_(X,s)}}}const jt={local:"zeroshot-image-classification",sections:[{local:"zeroshot-image-classification-pipeline",title:"\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958 \uD30C\uC774\uD504\uB77C\uC778"},{local:"zeroshot-image-classification-by-hand",title:"\uC9C1\uC811 \uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958\uD558\uAE30"}],title:"\uC81C\uB85C\uC0F7(zero-shot) \uC774\uBBF8\uC9C0 \uBD84\uB958"};function xt(Aa){return bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yt extends mt{constructor(x){super();ft(this,x,xt,_t,ht,{})}}export{yt as default,jt as metadata};
