import{s as El,o as Hl,n as ss}from"../chunks/scheduler.bdbef820.js";import{S as zl,i as Sl,g as d,s as c,r as y,A as Ll,h as b,f as e,c as M,j as Al,u as g,x as I,k as wl,y as Dl,a as t,v as h,d as J,t as f,w}from"../chunks/index.33f81d56.js";import{T as ul}from"../chunks/Tip.34194030.js";import{Y as ql}from"../chunks/Youtube.0e329b00.js";import{C as x}from"../chunks/CodeBlock.362b34a4.js";import{D as Kl}from"../chunks/DocNotebookDropdown.d5db5928.js";import{F as is,M as os}from"../chunks/Markdown.03194dea.js";import{H as Rs,E as Pl}from"../chunks/EditOnGithub.a9246e21.js";function Ol(k){let a,j='이 작업과 호환되는 모든 아키텍처와 체크포인트를 보려면 <a href="https://huggingface.co/tasks/image-segmentation" rel="nofollow">작업 페이지</a>를 확인하는 것이 좋습니다.';return{c(){a=d("p"),a.innerHTML=j},l(l){a=b(l,"P",{"data-svelte-h":!0}),I(a)!=="svelte-pmwuhn"&&(a.innerHTML=j)},m(l,i){t(l,a,i)},p:ss,d(l){l&&e(a)}}}function sa(k){let a,j='이미지 데이터 세트에 데이터 증강을 적용하여 과적합에 대해 모델을 보다 강건하게 만드는 것이 일반적입니다. 이 가이드에서는 <a href="https://pytorch.org/vision/stable/index.html" rel="nofollow">torchvision</a>의 <a href="https://pytorch.org/vision/stable/generated/torchvision.transforms.ColorJitter.html" rel="nofollow"><code>ColorJitter</code></a>를 사용하여 이미지의 색상 속성을 임의로 변경합니다. 하지만, 자신이 원하는 이미지 라이브러리를 사용할 수도 있습니다.',l,i,u,$,R="이제 모델에 사용할 이미지와 주석을 준비하기 위해 두 개의 전처리 함수를 만듭니다. 이 함수들은 이미지를 <code>pixel_values</code>로, 주석을 <code>labels</code>로 변환합니다. 훈련 세트의 경우 이미지 프로세서에 이미지를 제공하기 전에 <code>jitter</code>를 적용합니다. 테스트 세트의 경우 이미지 프로세서는 <code>images</code>를 자르고 정규화하며, 테스트 중에는 데이터 증강이 적용되지 않으므로 <code>labels</code>만 자릅니다.",W,_,B,C,Q="모든 데이터 세트에 <code>jitter</code>를 적용하려면, 🤗 Datasets <code>set_transform</code> 함수를 사용하세요. 즉시 변환이 적용되기 때문에 더 빠르고 디스크 공간을 덜 차지합니다:",v,T,V;return i=new x({props:{code:"ZnJvbSUyMHRvcmNodmlzaW9uLnRyYW5zZm9ybXMlMjBpbXBvcnQlMjBDb2xvckppdHRlciUwQSUwQWppdHRlciUyMCUzRCUyMENvbG9ySml0dGVyKGJyaWdodG5lc3MlM0QwLjI1JTJDJTIwY29udHJhc3QlM0QwLjI1JTJDJTIwc2F0dXJhdGlvbiUzRDAuMjUlMkMlMjBodWUlM0QwLjEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torchvision.transforms <span class="hljs-keyword">import</span> ColorJitter

<span class="hljs-meta">&gt;&gt;&gt; </span>jitter = ColorJitter(brightness=<span class="hljs-number">0.25</span>, contrast=<span class="hljs-number">0.25</span>, saturation=<span class="hljs-number">0.25</span>, hue=<span class="hljs-number">0.1</span>)`,wrap:!1}}),_=new x({props:{code:"ZGVmJTIwdHJhaW5fdHJhbnNmb3JtcyhleGFtcGxlX2JhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlcyUyMCUzRCUyMCU1QmppdHRlcih4KSUyMGZvciUyMHglMjBpbiUyMGV4YW1wbGVfYmF0Y2glNUIlMjJpbWFnZSUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMCU1QnglMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlX2JhdGNoJTVCJTIyYW5ub3RhdGlvbiUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlMkMlMjBsYWJlbHMpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW5wdXRzJTBBJTBBJTBBZGVmJTIwdmFsX3RyYW5zZm9ybXMoZXhhbXBsZV9iYXRjaCklM0ElMEElMjAlMjAlMjAlMjBpbWFnZXMlMjAlM0QlMjAlNUJ4JTIwZm9yJTIweCUyMGluJTIwZXhhbXBsZV9iYXRjaCU1QiUyMmltYWdlJTIyJTVEJTVEJTBBJTIwJTIwJTIwJTIwbGFiZWxzJTIwJTNEJTIwJTVCeCUyMGZvciUyMHglMjBpbiUyMGV4YW1wbGVfYmF0Y2glNUIlMjJhbm5vdGF0aW9uJTIyJTVEJTVEJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUyQyUyMGxhYmVscyklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">train_transforms</span>(<span class="hljs-params">example_batch</span>):
<span class="hljs-meta">... </span>    images = [jitter(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;image&quot;</span>]]
<span class="hljs-meta">... </span>    labels = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;annotation&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = image_processor(images, labels)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">val_transforms</span>(<span class="hljs-params">example_batch</span>):
<span class="hljs-meta">... </span>    images = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;image&quot;</span>]]
<span class="hljs-meta">... </span>    labels = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;annotation&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = image_processor(images, labels)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs`,wrap:!1}}),T=new x({props:{code:"dHJhaW5fZHMuc2V0X3RyYW5zZm9ybSh0cmFpbl90cmFuc2Zvcm1zKSUwQXRlc3RfZHMuc2V0X3RyYW5zZm9ybSh2YWxfdHJhbnNmb3Jtcyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>train_ds.set_transform(train_transforms)
<span class="hljs-meta">&gt;&gt;&gt; </span>test_ds.set_transform(val_transforms)`,wrap:!1}}),{c(){a=d("p"),a.innerHTML=j,l=c(),y(i.$$.fragment),u=c(),$=d("p"),$.innerHTML=R,W=c(),y(_.$$.fragment),B=c(),C=d("p"),C.innerHTML=Q,v=c(),y(T.$$.fragment)},l(m){a=b(m,"P",{"data-svelte-h":!0}),I(a)!=="svelte-wfjux"&&(a.innerHTML=j),l=M(m),g(i.$$.fragment,m),u=M(m),$=b(m,"P",{"data-svelte-h":!0}),I($)!=="svelte-nni9bw"&&($.innerHTML=R),W=M(m),g(_.$$.fragment,m),B=M(m),C=b(m,"P",{"data-svelte-h":!0}),I(C)!=="svelte-co6957"&&(C.innerHTML=Q),v=M(m),g(T.$$.fragment,m)},m(m,U){t(m,a,U),t(m,l,U),h(i,m,U),t(m,u,U),t(m,$,U),t(m,W,U),h(_,m,U),t(m,B,U),t(m,C,U),t(m,v,U),h(T,m,U),V=!0},p:ss,i(m){V||(J(i.$$.fragment,m),J(_.$$.fragment,m),J(T.$$.fragment,m),V=!0)},o(m){f(i.$$.fragment,m),f(_.$$.fragment,m),f(T.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(u),e($),e(W),e(B),e(C),e(v)),w(i,m),w(_,m),w(T,m)}}}function la(k){let a,j;return a=new os({props:{$$slots:{default:[sa]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function aa(k){let a,j='이미지 데이터 세트에 데이터 증강을 적용하여 과적합에 대해 모델을 보다 강건하게 만드는 것이 일반적입니다. 이 가이드에서는 <a href="https://www.tensorflow.org/api_docs/python/tf/image" rel="nofollow"><code>tf.image</code></a>를 사용하여 이미지의 색상 속성을 임의로 변경합니다. 하지만, 자신이 원하는 이미지 라이브러리를 사용할 수도 있습니다.',l,i,u="별개의 두 변환 함수를 정의합니다:",$,R,W="<li>이미지 증강을 포함하는 학습 데이터 변환</li> <li>🤗 Transformers의 컴퓨터 비전 모델은 채널 우선 레이아웃을 기대하기 때문에, 이미지만 바꾸는 검증 데이터 변환</li>",_,B,C,Q,v="그런 다음 모델을 위해 두 개의 전처리 함수를 만들어 이미지 및 주석 배치를 준비합니다. 이 함수들은 이미지 변환을 적용하고 이전에 로드한 <code>image_processor</code>를 사용하여 이미지를 <code>pixel_values</code>로, 주석을 <code>label</code>로 변환합니다. <code>ImageProcessor</code> 는 이미지의 크기 조정과 정규화도 처리합니다.",T,V,m,U,X=`전체 데이터 집합에 전처리 변환을 적용하려면 🤗 Datasets <code>set_transform</code> 함수를 사용하세요.
즉시 변환이 적용되기 때문에 더 빠르고 디스크 공간을 덜 차지합니다:`,G,F,p;return B=new x({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEElMEFkZWYlMjBhdWdfdHJhbnNmb3JtcyhpbWFnZSklM0ElMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMHRmLmtlcmFzLnV0aWxzLmltZ190b19hcnJheShpbWFnZSklMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMHRmLmltYWdlLnJhbmRvbV9icmlnaHRuZXNzKGltYWdlJTJDJTIwMC4yNSklMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMHRmLmltYWdlLnJhbmRvbV9jb250cmFzdChpbWFnZSUyQyUyMDAuNSUyQyUyMDIuMCklMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMHRmLmltYWdlLnJhbmRvbV9zYXR1cmF0aW9uKGltYWdlJTJDJTIwMC43NSUyQyUyMDEuMjUpJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjB0Zi5pbWFnZS5yYW5kb21faHVlKGltYWdlJTJDJTIwMC4xKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwdGYudHJhbnNwb3NlKGltYWdlJTJDJTIwKDIlMkMlMjAwJTJDJTIwMSkpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW1hZ2UlMEElMEElMEFkZWYlMjB0cmFuc2Zvcm1zKGltYWdlKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwdGYua2VyYXMudXRpbHMuaW1nX3RvX2FycmF5KGltYWdlKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwdGYudHJhbnNwb3NlKGltYWdlJTJDJTIwKDIlMkMlMjAwJTJDJTIwMSkpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW1hZ2U=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">aug_transforms</span>(<span class="hljs-params">image</span>):
<span class="hljs-meta">... </span>    image = tf.keras.utils.img_to_array(image)
<span class="hljs-meta">... </span>    image = tf.image.random_brightness(image, <span class="hljs-number">0.25</span>)
<span class="hljs-meta">... </span>    image = tf.image.random_contrast(image, <span class="hljs-number">0.5</span>, <span class="hljs-number">2.0</span>)
<span class="hljs-meta">... </span>    image = tf.image.random_saturation(image, <span class="hljs-number">0.75</span>, <span class="hljs-number">1.25</span>)
<span class="hljs-meta">... </span>    image = tf.image.random_hue(image, <span class="hljs-number">0.1</span>)
<span class="hljs-meta">... </span>    image = tf.transpose(image, (<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> image


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">transforms</span>(<span class="hljs-params">image</span>):
<span class="hljs-meta">... </span>    image = tf.keras.utils.img_to_array(image)
<span class="hljs-meta">... </span>    image = tf.transpose(image, (<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> image`,wrap:!1}}),V=new x({props:{code:"ZGVmJTIwdHJhaW5fdHJhbnNmb3JtcyhleGFtcGxlX2JhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlcyUyMCUzRCUyMCU1QmF1Z190cmFuc2Zvcm1zKHguY29udmVydCglMjJSR0IlMjIpKSUyMGZvciUyMHglMjBpbiUyMGV4YW1wbGVfYmF0Y2glNUIlMjJpbWFnZSUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMCU1QnglMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlX2JhdGNoJTVCJTIyYW5ub3RhdGlvbiUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlMkMlMjBsYWJlbHMpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW5wdXRzJTBBJTBBJTBBZGVmJTIwdmFsX3RyYW5zZm9ybXMoZXhhbXBsZV9iYXRjaCklM0ElMEElMjAlMjAlMjAlMjBpbWFnZXMlMjAlM0QlMjAlNUJ0cmFuc2Zvcm1zKHguY29udmVydCglMjJSR0IlMjIpKSUyMGZvciUyMHglMjBpbiUyMGV4YW1wbGVfYmF0Y2glNUIlMjJpbWFnZSUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMCU1QnglMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlX2JhdGNoJTVCJTIyYW5ub3RhdGlvbiUyMiU1RCU1RCUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlMkMlMjBsYWJlbHMpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaW5wdXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">train_transforms</span>(<span class="hljs-params">example_batch</span>):
<span class="hljs-meta">... </span>    images = [aug_transforms(x.convert(<span class="hljs-string">&quot;RGB&quot;</span>)) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;image&quot;</span>]]
<span class="hljs-meta">... </span>    labels = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;annotation&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = image_processor(images, labels)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">val_transforms</span>(<span class="hljs-params">example_batch</span>):
<span class="hljs-meta">... </span>    images = [transforms(x.convert(<span class="hljs-string">&quot;RGB&quot;</span>)) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;image&quot;</span>]]
<span class="hljs-meta">... </span>    labels = [x <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> example_batch[<span class="hljs-string">&quot;annotation&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = image_processor(images, labels)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs`,wrap:!1}}),F=new x({props:{code:"dHJhaW5fZHMuc2V0X3RyYW5zZm9ybSh0cmFpbl90cmFuc2Zvcm1zKSUwQXRlc3RfZHMuc2V0X3RyYW5zZm9ybSh2YWxfdHJhbnNmb3Jtcyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>train_ds.set_transform(train_transforms)
<span class="hljs-meta">&gt;&gt;&gt; </span>test_ds.set_transform(val_transforms)`,wrap:!1}}),{c(){a=d("p"),a.innerHTML=j,l=c(),i=d("p"),i.textContent=u,$=c(),R=d("ul"),R.innerHTML=W,_=c(),y(B.$$.fragment),C=c(),Q=d("p"),Q.innerHTML=v,T=c(),y(V.$$.fragment),m=c(),U=d("p"),U.innerHTML=X,G=c(),y(F.$$.fragment)},l(r){a=b(r,"P",{"data-svelte-h":!0}),I(a)!=="svelte-r0uin4"&&(a.innerHTML=j),l=M(r),i=b(r,"P",{"data-svelte-h":!0}),I(i)!=="svelte-163wstu"&&(i.textContent=u),$=M(r),R=b(r,"UL",{"data-svelte-h":!0}),I(R)!=="svelte-5sercd"&&(R.innerHTML=W),_=M(r),g(B.$$.fragment,r),C=M(r),Q=b(r,"P",{"data-svelte-h":!0}),I(Q)!=="svelte-1p58cmv"&&(Q.innerHTML=v),T=M(r),g(V.$$.fragment,r),m=M(r),U=b(r,"P",{"data-svelte-h":!0}),I(U)!=="svelte-1trxcly"&&(U.innerHTML=X),G=M(r),g(F.$$.fragment,r)},m(r,Y){t(r,a,Y),t(r,l,Y),t(r,i,Y),t(r,$,Y),t(r,R,Y),t(r,_,Y),h(B,r,Y),t(r,C,Y),t(r,Q,Y),t(r,T,Y),h(V,r,Y),t(r,m,Y),t(r,U,Y),t(r,G,Y),h(F,r,Y),p=!0},p:ss,i(r){p||(J(B.$$.fragment,r),J(V.$$.fragment,r),J(F.$$.fragment,r),p=!0)},o(r){f(B.$$.fragment,r),f(V.$$.fragment,r),f(F.$$.fragment,r),p=!1},d(r){r&&(e(a),e(l),e(i),e($),e(R),e(_),e(C),e(Q),e(T),e(m),e(U),e(G)),w(B,r),w(V,r),w(F,r)}}}function ea(k){let a,j;return a=new os({props:{$$slots:{default:[aa]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ta(k){let a,j;return a=new x({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2glMjBpbXBvcnQlMjBubiUwQSUwQWRlZiUyMGNvbXB1dGVfbWV0cmljcyhldmFsX3ByZWQpJTNBJTBBJTIwJTIwJTIwJTIwd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvZ2l0cyUyQyUyMGxhYmVscyUyMCUzRCUyMGV2YWxfcHJlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvZ2l0c190ZW5zb3IlMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KGxvZ2l0cyklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb2dpdHNfdGVuc29yJTIwJTNEJTIwbm4uZnVuY3Rpb25hbC5pbnRlcnBvbGF0ZSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb2dpdHNfdGVuc29yJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2l6ZSUzRGxhYmVscy5zaGFwZSU1Qi0yJTNBJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZSUzRCUyMmJpbGluZWFyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYWxpZ25fY29ybmVycyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKS5hcmdtYXgoZGltJTNEMSklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmVkX2xhYmVscyUyMCUzRCUyMGxvZ2l0c190ZW5zb3IuZGV0YWNoKCkuY3B1KCkubnVtcHkoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldHJpY3MlMjAlM0QlMjBtZXRyaWMuY29tcHV0ZSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUzRHByZWRfbGFiZWxzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVmZXJlbmNlcyUzRGxhYmVscyUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWdub3JlX2luZGV4JTNEMjU1JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVkdWNlX2xhYmVscyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZvciUyMGtleSUyQyUyMHZhbHVlJTIwaW4lMjBtZXRyaWNzLml0ZW1zKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZiUyMGlzaW5zdGFuY2UodmFsdWUlMkMlMjBucC5uZGFycmF5KSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldHJpY3MlNUJrZXklNUQlMjAlM0QlMjB2YWx1ZS50b2xpc3QoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMG1ldHJpY3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<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> torch <span class="hljs-keyword">import</span> nn

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">eval_pred</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>        logits, labels = eval_pred
<span class="hljs-meta">... </span>        logits_tensor = torch.from_numpy(logits)
<span class="hljs-meta">... </span>        logits_tensor = nn.functional.interpolate(
<span class="hljs-meta">... </span>            logits_tensor,
<span class="hljs-meta">... </span>            size=labels.shape[-<span class="hljs-number">2</span>:],
<span class="hljs-meta">... </span>            mode=<span class="hljs-string">&quot;bilinear&quot;</span>,
<span class="hljs-meta">... </span>            align_corners=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>        ).argmax(dim=<span class="hljs-number">1</span>)

<span class="hljs-meta">... </span>        pred_labels = logits_tensor.detach().cpu().numpy()
<span class="hljs-meta">... </span>        metrics = metric.compute(
<span class="hljs-meta">... </span>            predictions=pred_labels,
<span class="hljs-meta">... </span>            references=labels,
<span class="hljs-meta">... </span>            num_labels=num_labels,
<span class="hljs-meta">... </span>            ignore_index=<span class="hljs-number">255</span>,
<span class="hljs-meta">... </span>            reduce_labels=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>        )
<span class="hljs-meta">... </span>        <span class="hljs-keyword">for</span> key, value <span class="hljs-keyword">in</span> metrics.items():
<span class="hljs-meta">... </span>            <span class="hljs-keyword">if</span> <span class="hljs-built_in">isinstance</span>(value, np.ndarray):
<span class="hljs-meta">... </span>                metrics[key] = value.tolist()
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> metrics`,wrap:!1}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p:ss,i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function na(k){let a,j;return a=new os({props:{$$slots:{default:[ta]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function pa(k){let a,j;return a=new x({props:{code:"ZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMkMlMjBsYWJlbHMlMjAlM0QlMjBldmFsX3ByZWQlMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjB0Zi50cmFuc3Bvc2UobG9naXRzJTJDJTIwcGVybSUzRCU1QjAlMkMlMjAyJTJDJTIwMyUyQyUyMDElNUQpJTBBJTIwJTIwJTIwJTIwbG9naXRzX3Jlc2l6ZWQlMjAlM0QlMjB0Zi5pbWFnZS5yZXNpemUoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbG9naXRzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2l6ZSUzRHRmLnNoYXBlKGxhYmVscyklNUIxJTNBJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWV0aG9kJTNEJTIyYmlsaW5lYXIlMjIlMkMlMEElMjAlMjAlMjAlMjApJTBBJTBBJTIwJTIwJTIwJTIwcHJlZF9sYWJlbHMlMjAlM0QlMjB0Zi5hcmdtYXgobG9naXRzX3Jlc2l6ZWQlMkMlMjBheGlzJTNELTEpJTBBJTIwJTIwJTIwJTIwbWV0cmljcyUyMCUzRCUyMG1ldHJpYy5jb21wdXRlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByZWRpY3Rpb25zJTNEcHJlZF9sYWJlbHMlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZWZlcmVuY2VzJTNEbGFiZWxzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZ25vcmVfaW5kZXglM0QtMSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJlZHVjZV9sYWJlbHMlM0RpbWFnZV9wcm9jZXNzb3IuZG9fcmVkdWNlX2xhYmVscyUyQyUwQSUyMCUyMCUyMCUyMCklMEElMEElMjAlMjAlMjAlMjBwZXJfY2F0ZWdvcnlfYWNjdXJhY3klMjAlM0QlMjBtZXRyaWNzLnBvcCglMjJwZXJfY2F0ZWdvcnlfYWNjdXJhY3klMjIpLnRvbGlzdCgpJTBBJTIwJTIwJTIwJTIwcGVyX2NhdGVnb3J5X2lvdSUyMCUzRCUyMG1ldHJpY3MucG9wKCUyMnBlcl9jYXRlZ29yeV9pb3UlMjIpLnRvbGlzdCgpJTBBJTBBJTIwJTIwJTIwJTIwbWV0cmljcy51cGRhdGUoJTdCZiUyMmFjY3VyYWN5XyU3QmlkMmxhYmVsJTVCaSU1RCU3RCUyMiUzQSUyMHYlMjBmb3IlMjBpJTJDJTIwdiUyMGluJTIwZW51bWVyYXRlKHBlcl9jYXRlZ29yeV9hY2N1cmFjeSklN0QpJTBBJTIwJTIwJTIwJTIwbWV0cmljcy51cGRhdGUoJTdCZiUyMmlvdV8lN0JpZDJsYWJlbCU1QmklNUQlN0QlMjIlM0ElMjB2JTIwZm9yJTIwaSUyQyUyMHYlMjBpbiUyMGVudW1lcmF0ZShwZXJfY2F0ZWdvcnlfaW91KSU3RCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJ2YWxfJTIyJTIwJTJCJTIwayUzQSUyMHYlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwbWV0cmljcy5pdGVtcygpJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">eval_pred</span>):
<span class="hljs-meta">... </span>    logits, labels = eval_pred
<span class="hljs-meta">... </span>    logits = tf.transpose(logits, perm=[<span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">1</span>])
<span class="hljs-meta">... </span>    logits_resized = tf.image.resize(
<span class="hljs-meta">... </span>        logits,
<span class="hljs-meta">... </span>        size=tf.shape(labels)[<span class="hljs-number">1</span>:],
<span class="hljs-meta">... </span>        method=<span class="hljs-string">&quot;bilinear&quot;</span>,
<span class="hljs-meta">... </span>    )

<span class="hljs-meta">... </span>    pred_labels = tf.argmax(logits_resized, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    metrics = metric.compute(
<span class="hljs-meta">... </span>        predictions=pred_labels,
<span class="hljs-meta">... </span>        references=labels,
<span class="hljs-meta">... </span>        num_labels=num_labels,
<span class="hljs-meta">... </span>        ignore_index=-<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>        reduce_labels=image_processor.do_reduce_labels,
<span class="hljs-meta">... </span>    )

<span class="hljs-meta">... </span>    per_category_accuracy = metrics.pop(<span class="hljs-string">&quot;per_category_accuracy&quot;</span>).tolist()
<span class="hljs-meta">... </span>    per_category_iou = metrics.pop(<span class="hljs-string">&quot;per_category_iou&quot;</span>).tolist()

<span class="hljs-meta">... </span>    metrics.update({<span class="hljs-string">f&quot;accuracy_<span class="hljs-subst">{id2label[i]}</span>&quot;</span>: v <span class="hljs-keyword">for</span> i, v <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(per_category_accuracy)})
<span class="hljs-meta">... </span>    metrics.update({<span class="hljs-string">f&quot;iou_<span class="hljs-subst">{id2label[i]}</span>&quot;</span>: v <span class="hljs-keyword">for</span> i, v <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(per_category_iou)})
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;val_&quot;</span> + k: v <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> metrics.items()}`,wrap:!1}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p:ss,i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ma(k){let a,j;return a=new os({props:{$$slots:{default:[pa]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ra(k){let a,j='만약 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>를 사용해 모델을 미세 조정하는 것에 익숙하지 않다면, <a href="../training#finetune-with-trainer">여기</a>에서 기본 튜토리얼을 살펴보세요!';return{c(){a=d("p"),a.innerHTML=j},l(l){a=b(l,"P",{"data-svelte-h":!0}),I(a)!=="svelte-jgx1ek"&&(a.innerHTML=j)},m(l,i){t(l,a,i)},p:ss,d(l){l&&e(a)}}}function ca(k){let a,j,l,i='이제 모델 학습을 시작할 준비가 되었습니다! <a href="/docs/transformers/main/ko/model_doc/auto#transformers.AutoModelForSemanticSegmentation">AutoModelForSemanticSegmentation</a>로 SegFormer를 불러오고, 모델에 레이블 ID와 레이블 클래스 간의 매핑을 전달합니다:',u,$,R,W,_="이제 세 단계만 남았습니다:",B,C,Q='<li>학습 하이퍼파라미터를 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>에 정의합니다. <code>image</code> 열이 삭제되기 때문에 사용하지 않는 열을 제거하지 않는 것이 중요합니다. <code>image</code> 열이 없으면 <code>pixel_values</code>을 생성할 수 없습니다. 이런 경우를 방지하려면 <code>remove_unused_columns=False</code>로 설정하세요! 유일하게 필요한 다른 매개변수는 모델을 저장할 위치를 지정하는 <code>output_dir</code>입니다. <code>push_to_hub=True</code>를 설정하여 이 모델을 Hub에 푸시합니다(모델을 업로드하려면 Hugging Face에 로그인해야 합니다). 각 에포크가 끝날 때마다 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>가 IoU 메트릭을 평가하고 학습 체크포인트를 저장합니다.</li> <li>모델, 데이터 세트, 토크나이저, 데이터 콜레이터, <code>compute_metrics</code> 함수와 함께 학습 인자를 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>에 전달하세요.</li> <li>모델을 미세 조정하기 위해 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.train">train()</a>를 호출하세요.</li>',v,T,V,m,U='학습이 완료되면, 누구나 모델을 사용할 수 있도록 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> 메서드를 사용해 Hub에 모델을 공유하세요:',X,G,F;return a=new ul({props:{$$slots:{default:[ra]},$$scope:{ctx:k}}}),$=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlbWFudGljU2VnbWVudGF0aW9uJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZW1hbnRpY1NlZ21lbnRhdGlvbi5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCUyQyUyMGlkMmxhYmVsJTNEaWQybGFiZWwlMkMlMjBsYWJlbDJpZCUzRGxhYmVsMmlkKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSemanticSegmentation, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSemanticSegmentation.from_pretrained(checkpoint, id2label=id2label, label2id=label2id)`,wrap:!1}}),T=new x({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJzZWdmb3JtZXItYjAtc2NlbmUtcGFyc2UtMTUwJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDZlLTUlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0QyJTJDJTBBJTIwJTIwJTIwJTIwc2F2ZV90b3RhbF9saW1pdCUzRDMlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfYWNjdW11bGF0aW9uX3N0ZXBzJTNENSUyQyUwQSUyMCUyMCUyMCUyMHJlbW92ZV91bnVzZWRfY29sdW1ucyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0cmFpbl9kcyUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHRlc3RfZHMlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;segformer-b0-scene-parse-150&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">6e-5</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    save_total_limit=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    eval_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
<span class="hljs-meta">... </span>    save_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
<span class="hljs-meta">... </span>    save_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    eval_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    logging_steps=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    eval_accumulation_steps=<span class="hljs-number">5</span>,
<span class="hljs-meta">... </span>    remove_unused_columns=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=train_ds,
<span class="hljs-meta">... </span>    eval_dataset=test_ds,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),G=new x({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){y(a.$$.fragment),j=c(),l=d("p"),l.innerHTML=i,u=c(),y($.$$.fragment),R=c(),W=d("p"),W.textContent=_,B=c(),C=d("ol"),C.innerHTML=Q,v=c(),y(T.$$.fragment),V=c(),m=d("p"),m.innerHTML=U,X=c(),y(G.$$.fragment)},l(p){g(a.$$.fragment,p),j=M(p),l=b(p,"P",{"data-svelte-h":!0}),I(l)!=="svelte-rx7a2j"&&(l.innerHTML=i),u=M(p),g($.$$.fragment,p),R=M(p),W=b(p,"P",{"data-svelte-h":!0}),I(W)!=="svelte-1vwg7jz"&&(W.textContent=_),B=M(p),C=b(p,"OL",{"data-svelte-h":!0}),I(C)!=="svelte-1fvuao"&&(C.innerHTML=Q),v=M(p),g(T.$$.fragment,p),V=M(p),m=b(p,"P",{"data-svelte-h":!0}),I(m)!=="svelte-9u385y"&&(m.innerHTML=U),X=M(p),g(G.$$.fragment,p)},m(p,r){h(a,p,r),t(p,j,r),t(p,l,r),t(p,u,r),h($,p,r),t(p,R,r),t(p,W,r),t(p,B,r),t(p,C,r),t(p,v,r),h(T,p,r),t(p,V,r),t(p,m,r),t(p,X,r),h(G,p,r),F=!0},p(p,r){const Y={};r&2&&(Y.$$scope={dirty:r,ctx:p}),a.$set(Y)},i(p){F||(J(a.$$.fragment,p),J($.$$.fragment,p),J(T.$$.fragment,p),J(G.$$.fragment,p),F=!0)},o(p){f(a.$$.fragment,p),f($.$$.fragment,p),f(T.$$.fragment,p),f(G.$$.fragment,p),F=!1},d(p){p&&(e(j),e(l),e(u),e(R),e(W),e(B),e(C),e(v),e(V),e(m),e(X)),w(a,p),w($,p),w(T,p),w(G,p)}}}function Ma(k){let a,j;return a=new os({props:{$$slots:{default:[ca]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ia(k){let a,j='Keras로 모델을 미세 조정하는 데 익숙하지 않은 경우, 먼저 <a href="../training#train-a-tensorflow-model-with-keras">기본 튜토리얼</a>을 확인해보세요!';return{c(){a=d("p"),a.innerHTML=j},l(l){a=b(l,"P",{"data-svelte-h":!0}),I(a)!=="svelte-u4hk9"&&(a.innerHTML=j)},m(l,i){t(l,a,i)},p:ss,d(l){l&&e(a)}}}function oa(k){let a,j,l,i="TensorFlow에서 모델을 미세 조정하려면 다음 단계를 따르세요:",u,$,R="<li>학습 하이퍼파라미터를 정의하고 옵티마이저와 학습률 스케쥴러를 설정하세요.</li> <li>사전 학습된 모델을 인스턴스화하세요.</li> <li>🤗 Dataset을 <code>tf.data.Dataset</code>로 변환하세요.</li> <li>모델을 컴파일하세요.</li> <li>콜백을 추가하여 메트릭을 계산하고 🤗 Hub에 모델을 업로드하세요.</li> <li><code>fit()</code> 메서드를 사용하여 훈련을 실행하세요.</li>",W,_,B="하이퍼파라미터, 옵티마이저, 학습률 스케쥴러를 정의하는 것으로 시작하세요:",C,Q,v,T,V='그런 다음 레이블 매핑과 함께 <a href="/docs/transformers/main/ko/model_doc/auto#transformers.TFAutoModelForSemanticSegmentation">TFAutoModelForSemanticSegmentation</a>을 사용하여 SegFormer를 불러오고 옵티마이저로 컴파일합니다. 트랜스포머 모델은 모두 디폴트로 태스크 관련 손실 함수가 있으므로 원치 않으면 지정할 필요가 없습니다:',m,U,X,G,F='<code>to_tf_dataset</code> 와 <a href="/docs/transformers/main/ko/main_classes/data_collator#transformers.DefaultDataCollator">DefaultDataCollator</a>를 사용해 데이터 세트를 <code>tf.data.Dataset</code> 포맷으로 변환하세요:',p,r,Y,H,S='예측으로 정확도를 계산하고 모델을 🤗 Hub로 푸시하려면 <a href="../main_classes/keras_callbacks">Keras callbacks</a>를 사용하세요. <code>compute_metrics</code> 함수를 <a href="/docs/transformers/main/ko/main_classes/keras_callbacks#transformers.KerasMetricCallback">KerasMetricCallback</a>에 전달하고, 모델 업로드를 위해 <a href="/docs/transformers/main/ko/main_classes/keras_callbacks#transformers.PushToHubCallback">PushToHubCallback</a>를 사용하세요:',q,N,js,z,L="이제 모델을 훈련할 준비가 되었습니다! 훈련 및 검증 데이터 세트, 에포크 수와 함께 <code>fit()</code>을 호출하고, 콜백을 사용하여 모델을 미세 조정합니다:",K,A,P,E,vs="축하합니다! 모델을 미세 조정하고 🤗 Hub에 공유했습니다. 이제 추론에 사용할 수 있습니다!",O;return a=new ul({props:{$$slots:{default:[ia]},$$scope:{ctx:k}}}),Q=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMEElMEFiYXRjaF9zaXplJTIwJTNEJTIwMiUwQW51bV9lcG9jaHMlMjAlM0QlMjA1MCUwQW51bV90cmFpbl9zdGVwcyUyMCUzRCUyMGxlbih0cmFpbl9kcyklMjAqJTIwbnVtX2Vwb2NocyUwQWxlYXJuaW5nX3JhdGUlMjAlM0QlMjA2ZS01JTBBd2VpZ2h0X2RlY2F5X3JhdGUlMjAlM0QlMjAwLjAxJTBBJTBBb3B0aW1pemVyJTJDJTIwbHJfc2NoZWR1bGUlMjAlM0QlMjBjcmVhdGVfb3B0aW1pemVyKCUwQSUyMCUyMCUyMCUyMGluaXRfbHIlM0RsZWFybmluZ19yYXRlJTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX3N0ZXBzJTNEbnVtX3RyYWluX3N0ZXBzJTJDJTBBJTIwJTIwJTIwJTIwd2VpZ2h0X2RlY2F5X3JhdGUlM0R3ZWlnaHRfZGVjYXlfcmF0ZSUyQyUwQSUyMCUyMCUyMCUyMG51bV93YXJtdXBfc3RlcHMlM0QwJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size = <span class="hljs-number">2</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_epochs = <span class="hljs-number">50</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_train_steps = <span class="hljs-built_in">len</span>(train_ds) * num_epochs
<span class="hljs-meta">&gt;&gt;&gt; </span>learning_rate = <span class="hljs-number">6e-5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>weight_decay_rate = <span class="hljs-number">0.01</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer, lr_schedule = create_optimizer(
<span class="hljs-meta">... </span>    init_lr=learning_rate,
<span class="hljs-meta">... </span>    num_train_steps=num_train_steps,
<span class="hljs-meta">... </span>    weight_decay_rate=weight_decay_rate,
<span class="hljs-meta">... </span>    num_warmup_steps=<span class="hljs-number">0</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),U=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VtYW50aWNTZWdtZW50YXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yU2VtYW50aWNTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMGNoZWNrcG9pbnQlMkMlMEElMjAlMjAlMjAlMjBpZDJsYWJlbCUzRGlkMmxhYmVsJTJDJTBBJTIwJTIwJTIwJTIwbGFiZWwyaWQlM0RsYWJlbDJpZCUyQyUwQSklMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplciklMjAlMjAlMjMlMjAlRUMlODYlOTAlRUMlOEIlQTQlMjAlRUQlOTUlQTglRUMlODglOTglMjAlRUMlOUQlQjglRUMlOUUlOTAlRUElQjAlODAlMjAlRUMlOTclODYlRUMlOEElQjUlRUIlOEIlODglRUIlOEIlQTQh",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSemanticSegmentation

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSemanticSegmentation.from_pretrained(
<span class="hljs-meta">... </span>    checkpoint,
<span class="hljs-meta">... </span>    id2label=id2label,
<span class="hljs-meta">... </span>    label2id=label2id,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)  <span class="hljs-comment"># 손실 함수 인자가 없습니다!</span>`,wrap:!1}}),r=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlZmF1bHREYXRhQ29sbGF0b3IlMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGVmYXVsdERhdGFDb2xsYXRvcihyZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQXRmX3RyYWluX2RhdGFzZXQlMjAlM0QlMjB0cmFpbl9kcy50b190Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMGNvbHVtbnMlM0QlNUIlMjJwaXhlbF92YWx1ZXMlMjIlMkMlMjAlMjJsYWJlbCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRGJhdGNoX3NpemUlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0Zl9ldmFsX2RhdGFzZXQlMjAlM0QlMjB0ZXN0X2RzLnRvX3RmX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwY29sdW1ucyUzRCU1QiUyMnBpeGVsX3ZhbHVlcyUyMiUyQyUyMCUyMmxhYmVsJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwc2h1ZmZsZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEYmF0Y2hfc2l6ZSUyQyUwQSUyMCUyMCUyMCUyMGNvbGxhdGVfZm4lM0RkYXRhX2NvbGxhdG9yJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DefaultDataCollator

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DefaultDataCollator(return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_dataset = train_ds.to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;pixel_values&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=batch_size,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_eval_dataset = test_ds.to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;pixel_values&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=batch_size,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),N=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBLZXJhc01ldHJpY0NhbGxiYWNrJTJDJTIwUHVzaFRvSHViQ2FsbGJhY2slMEElMEFtZXRyaWNfY2FsbGJhY2slMjAlM0QlMjBLZXJhc01ldHJpY0NhbGxiYWNrKCUwQSUyMCUyMCUyMCUyMG1ldHJpY19mbiUzRGNvbXB1dGVfbWV0cmljcyUyQyUyMGV2YWxfZGF0YXNldCUzRHRmX2V2YWxfZGF0YXNldCUyQyUyMGJhdGNoX3NpemUlM0RiYXRjaF9zaXplJTJDJTIwbGFiZWxfY29scyUzRCU1QiUyMmxhYmVscyUyMiU1RCUwQSklMEElMEFwdXNoX3RvX2h1Yl9jYWxsYmFjayUyMCUzRCUyMFB1c2hUb0h1YkNhbGxiYWNrKG91dHB1dF9kaXIlM0QlMjJzY2VuZV9zZWdtZW50YXRpb24lMjIlMkMlMjB0b2tlbml6ZXIlM0RpbWFnZV9wcm9jZXNzb3IpJTBBJTBBY2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> KerasMetricCallback, PushToHubCallback

<span class="hljs-meta">&gt;&gt;&gt; </span>metric_callback = KerasMetricCallback(
<span class="hljs-meta">... </span>    metric_fn=compute_metrics, eval_dataset=tf_eval_dataset, batch_size=batch_size, label_cols=[<span class="hljs-string">&quot;labels&quot;</span>]
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>push_to_hub_callback = PushToHubCallback(output_dir=<span class="hljs-string">&quot;scene_segmentation&quot;</span>, tokenizer=image_processor)

<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]`,wrap:!1}}),A=new x({props:{code:"bW9kZWwuZml0KCUwQSUyMCUyMCUyMCUyMHRmX3RyYWluX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl9ldmFsX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBjYWxsYmFja3MlM0RjYWxsYmFja3MlMkMlMEElMjAlMjAlMjAlMjBlcG9jaHMlM0RudW1fZXBvY2hzJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(
<span class="hljs-meta">... </span>    tf_train_dataset,
<span class="hljs-meta">... </span>    validation_data=tf_eval_dataset,
<span class="hljs-meta">... </span>    callbacks=callbacks,
<span class="hljs-meta">... </span>    epochs=num_epochs,
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){y(a.$$.fragment),j=c(),l=d("p"),l.textContent=i,u=c(),$=d("ol"),$.innerHTML=R,W=c(),_=d("p"),_.textContent=B,C=c(),y(Q.$$.fragment),v=c(),T=d("p"),T.innerHTML=V,m=c(),y(U.$$.fragment),X=c(),G=d("p"),G.innerHTML=F,p=c(),y(r.$$.fragment),Y=c(),H=d("p"),H.innerHTML=S,q=c(),y(N.$$.fragment),js=c(),z=d("p"),z.innerHTML=L,K=c(),y(A.$$.fragment),P=c(),E=d("p"),E.textContent=vs},l(o){g(a.$$.fragment,o),j=M(o),l=b(o,"P",{"data-svelte-h":!0}),I(l)!=="svelte-um2evk"&&(l.textContent=i),u=M(o),$=b(o,"OL",{"data-svelte-h":!0}),I($)!=="svelte-173h0e5"&&($.innerHTML=R),W=M(o),_=b(o,"P",{"data-svelte-h":!0}),I(_)!=="svelte-wcragq"&&(_.textContent=B),C=M(o),g(Q.$$.fragment,o),v=M(o),T=b(o,"P",{"data-svelte-h":!0}),I(T)!=="svelte-1uvhdt7"&&(T.innerHTML=V),m=M(o),g(U.$$.fragment,o),X=M(o),G=b(o,"P",{"data-svelte-h":!0}),I(G)!=="svelte-10sn9fe"&&(G.innerHTML=F),p=M(o),g(r.$$.fragment,o),Y=M(o),H=b(o,"P",{"data-svelte-h":!0}),I(H)!=="svelte-kidr4q"&&(H.innerHTML=S),q=M(o),g(N.$$.fragment,o),js=M(o),z=b(o,"P",{"data-svelte-h":!0}),I(z)!=="svelte-1ud4ghv"&&(z.innerHTML=L),K=M(o),g(A.$$.fragment,o),P=M(o),E=b(o,"P",{"data-svelte-h":!0}),I(E)!=="svelte-1trgvwr"&&(E.textContent=vs)},m(o,Z){h(a,o,Z),t(o,j,Z),t(o,l,Z),t(o,u,Z),t(o,$,Z),t(o,W,Z),t(o,_,Z),t(o,C,Z),h(Q,o,Z),t(o,v,Z),t(o,T,Z),t(o,m,Z),h(U,o,Z),t(o,X,Z),t(o,G,Z),t(o,p,Z),h(r,o,Z),t(o,Y,Z),t(o,H,Z),t(o,q,Z),h(N,o,Z),t(o,js,Z),t(o,z,Z),t(o,K,Z),h(A,o,Z),t(o,P,Z),t(o,E,Z),O=!0},p(o,Z){const D={};Z&2&&(D.$$scope={dirty:Z,ctx:o}),a.$set(D)},i(o){O||(J(a.$$.fragment,o),J(Q.$$.fragment,o),J(U.$$.fragment,o),J(r.$$.fragment,o),J(N.$$.fragment,o),J(A.$$.fragment,o),O=!0)},o(o){f(a.$$.fragment,o),f(Q.$$.fragment,o),f(U.$$.fragment,o),f(r.$$.fragment,o),f(N.$$.fragment,o),f(A.$$.fragment,o),O=!1},d(o){o&&(e(j),e(l),e(u),e($),e(W),e(_),e(C),e(v),e(T),e(m),e(X),e(G),e(p),e(Y),e(H),e(q),e(js),e(z),e(K),e(P),e(E)),w(a,o),w(Q,o),w(U,o),w(r,o),w(N,o),w(A,o)}}}function ja(k){let a,j;return a=new os({props:{$$slots:{default:[oa]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ya(k){let a,j="추론을 위해 미세 조정한 모델을 시험해 보는 가장 간단한 방법은 <code>pipeline()</code>에서 사용하는 것입니다. 모델을 사용하여 이미지 분할을 위한 <code>pipeline</code>을 인스턴스화하고 이미지를 전달합니다:",l,i,u,$,R="원하는 경우 <code>pipeline</code>의 결과를 수동으로 복제할 수도 있습니다. 이미지 프로세서로 이미지를 처리하고 <code>pixel_values</code>을 GPU에 배치합니다:",W,_,B,C,Q="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",v,T,V,m,U="그런 다음 로짓의 크기를 원본 이미지 크기로 다시 조정합니다:",X,G,F;return i=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBc2VnbWVudGVyJTIwJTNEJTIwcGlwZWxpbmUoJTIyaW1hZ2Utc2VnbWVudGF0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJteV9hd2Vzb21lX3NlZ19tb2RlbCUyMiklMEFzZWdtZW50ZXIoaW1hZ2Up",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>segmenter = pipeline(<span class="hljs-string">&quot;image-segmentation&quot;</span>, model=<span class="hljs-string">&quot;my_awesome_seg_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>segmenter(image)
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;wall&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062690</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;sky&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062A50</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;floor&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062B50</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;ceiling&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062A10</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;bed &#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062E90</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;windowpane&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062390</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cabinet&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062550</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;chair&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062D90</span>&gt;},
 {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-literal">None</span>,
  <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;armchair&#x27;</span>,
  <span class="hljs-string">&#x27;mask&#x27;</span>: &lt;PIL.Image.Image image mode=L size=640x427 at <span class="hljs-number">0x7FD5B2062E10</span>&gt;}]`,wrap:!1}}),_=new x({props:{code:"ZGV2aWNlJTIwJTNEJTIwdG9yY2guZGV2aWNlKCUyMmN1ZGElMjIlMjBpZiUyMHRvcmNoLmN1ZGEuaXNfYXZhaWxhYmxlKCklMjBlbHNlJTIwJTIyY3B1JTIyKSUyMCUyMCUyMyUyMCVFQSVCMCU4MCVFQiU4QSVBNSVFRCU5NSU5OCVFQiU4QiVBNCVFQiVBOSVCNCUyMEdQVSVFQiVBNSVCQyUyMCVFQyU4MiVBQyVFQyU5QSVBOSVFRCU5NSU5OCVFQSVCMyVBMCUyQyUyMCVFQSVCNyVCOCVFQiVBMCU4NyVFQyVBNyU4MCUyMCVFQyU5NSU4QSVFQiU4QiVBNCVFQiVBOSVCNCUyMENQVSVFQiVBNSVCQyUyMCVFQyU4MiVBQyVFQyU5QSVBOSVFRCU5NSU5OCVFQyU4NCVCOCVFQyU5QSU5NCUwQWVuY29kaW5nJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBlbmNvZGluZy5waXhlbF92YWx1ZXMudG8oZGV2aWNlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>)  <span class="hljs-comment"># 가능하다면 GPU를 사용하고, 그렇지 않다면 CPU를 사용하세요</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = encoding.pixel_values.to(device)`,wrap:!1}}),T=new x({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKHBpeGVsX3ZhbHVlcyUzRHBpeGVsX3ZhbHVlcyklMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cy5jcHUoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values=pixel_values)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits.cpu()`,wrap:!1}}),G=new x({props:{code:"dXBzYW1wbGVkX2xvZ2l0cyUyMCUzRCUyMG5uLmZ1bmN0aW9uYWwuaW50ZXJwb2xhdGUoJTBBJTIwJTIwJTIwJTIwbG9naXRzJTJDJTBBJTIwJTIwJTIwJTIwc2l6ZSUzRGltYWdlLnNpemUlNUIlM0ElM0EtMSU1RCUyQyUwQSUyMCUyMCUyMCUyMG1vZGUlM0QlMjJiaWxpbmVhciUyMiUyQyUwQSUyMCUyMCUyMCUyMGFsaWduX2Nvcm5lcnMlM0RGYWxzZSUyQyUwQSklMEElMEFwcmVkX3NlZyUyMCUzRCUyMHVwc2FtcGxlZF9sb2dpdHMuYXJnbWF4KGRpbSUzRDEpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>upsampled_logits = nn.functional.interpolate(
<span class="hljs-meta">... </span>    logits,
<span class="hljs-meta">... </span>    size=image.size[::-<span class="hljs-number">1</span>],
<span class="hljs-meta">... </span>    mode=<span class="hljs-string">&quot;bilinear&quot;</span>,
<span class="hljs-meta">... </span>    align_corners=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pred_seg = upsampled_logits.argmax(dim=<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=d("p"),a.innerHTML=j,l=c(),y(i.$$.fragment),u=c(),$=d("p"),$.innerHTML=R,W=c(),y(_.$$.fragment),B=c(),C=d("p"),C.innerHTML=Q,v=c(),y(T.$$.fragment),V=c(),m=d("p"),m.textContent=U,X=c(),y(G.$$.fragment)},l(p){a=b(p,"P",{"data-svelte-h":!0}),I(a)!=="svelte-v6d888"&&(a.innerHTML=j),l=M(p),g(i.$$.fragment,p),u=M(p),$=b(p,"P",{"data-svelte-h":!0}),I($)!=="svelte-112n7y6"&&($.innerHTML=R),W=M(p),g(_.$$.fragment,p),B=M(p),C=b(p,"P",{"data-svelte-h":!0}),I(C)!=="svelte-t69k4k"&&(C.innerHTML=Q),v=M(p),g(T.$$.fragment,p),V=M(p),m=b(p,"P",{"data-svelte-h":!0}),I(m)!=="svelte-18ee243"&&(m.textContent=U),X=M(p),g(G.$$.fragment,p)},m(p,r){t(p,a,r),t(p,l,r),h(i,p,r),t(p,u,r),t(p,$,r),t(p,W,r),h(_,p,r),t(p,B,r),t(p,C,r),t(p,v,r),h(T,p,r),t(p,V,r),t(p,m,r),t(p,X,r),h(G,p,r),F=!0},p:ss,i(p){F||(J(i.$$.fragment,p),J(_.$$.fragment,p),J(T.$$.fragment,p),J(G.$$.fragment,p),F=!0)},o(p){f(i.$$.fragment,p),f(_.$$.fragment,p),f(T.$$.fragment,p),f(G.$$.fragment,p),F=!1},d(p){p&&(e(a),e(l),e(u),e($),e(W),e(B),e(C),e(v),e(V),e(m),e(X)),w(i,p),w(_,p),w(T,p),w(G,p)}}}function ga(k){let a,j;return a=new os({props:{$$slots:{default:[ya]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function ha(k){let a,j="이미지 프로세서를 로드하여 이미지를 전처리하고 입력을 TensorFlow 텐서로 반환합니다:",l,i,u,$,R="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",W,_,B,C,Q="그런 다음 로그를 원본 이미지 크기로 재조정하고 클래스 차원에 argmax를 적용합니다:",v,T,V;return i=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyTWFyaWFLJTJGc2NlbmVfc2VnbWVudGF0aW9uJTIyKSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;MariaK/scene_segmentation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),_=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VtYW50aWNTZWdtZW50YXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yU2VtYW50aWNTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMk1hcmlhSyUyRnNjZW5lX3NlZ21lbnRhdGlvbiUyMiklMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSemanticSegmentation

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSemanticSegmentation.from_pretrained(<span class="hljs-string">&quot;MariaK/scene_segmentation&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits`,wrap:!1}}),T=new x({props:{code:"bG9naXRzJTIwJTNEJTIwdGYudHJhbnNwb3NlKGxvZ2l0cyUyQyUyMCU1QjAlMkMlMjAyJTJDJTIwMyUyQyUyMDElNUQpJTBBJTBBdXBzYW1wbGVkX2xvZ2l0cyUyMCUzRCUyMHRmLmltYWdlLnJlc2l6ZSglMEElMjAlMjAlMjAlMjBsb2dpdHMlMkMlMEElMjAlMjAlMjAlMjAlMjMlMjAlNjBpbWFnZS5zaXplJTYwJUVBJUIwJTgwJTIwJUVCJTg0JTg4JUVCJUI5JTg0JUVDJTk5JTgwJTIwJUVCJTg2JTkyJUVDJTlEJUI0JUVCJUE1JUJDJTIwJUVCJUIwJTk4JUVEJTk5JTk4JUVEJTk1JTk4JUVBJUI4JUIwJTIwJUVCJTk1JThDJUVCJUFDJUI4JUVDJTk3JTkwJTIwJTYwaW1hZ2UlNjAlRUMlOUQlOTglMjAlRUIlQUElQTglRUMlOTYlOTElRUMlOUQlODQlMjAlRUIlQjAlOTglRUMlQTAlODQlRUMlOEIlOUMlRUQlODIlQjUlRUIlOEIlODglRUIlOEIlQTQlMEElMjAlMjAlMjAlMjBpbWFnZS5zaXplJTVCJTNBJTNBLTElNUQlMkMlMEEpJTBBJTBBcHJlZF9zZWclMjAlM0QlMjB0Zi5tYXRoLmFyZ21heCh1cHNhbXBsZWRfbG9naXRzJTJDJTIwYXhpcyUzRC0xKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>logits = tf.transpose(logits, [<span class="hljs-number">0</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">1</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>upsampled_logits = tf.image.resize(
<span class="hljs-meta">... </span>    logits,
<span class="hljs-meta">... </span>    <span class="hljs-comment"># \`image.size\`가 너비와 높이를 반환하기 때문에 \`image\`의 모양을 반전시킵니다</span>
<span class="hljs-meta">... </span>    image.size[::-<span class="hljs-number">1</span>],
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pred_seg = tf.math.argmax(upsampled_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){a=d("p"),a.textContent=j,l=c(),y(i.$$.fragment),u=c(),$=d("p"),$.innerHTML=R,W=c(),y(_.$$.fragment),B=c(),C=d("p"),C.textContent=Q,v=c(),y(T.$$.fragment)},l(m){a=b(m,"P",{"data-svelte-h":!0}),I(a)!=="svelte-k2y3aq"&&(a.textContent=j),l=M(m),g(i.$$.fragment,m),u=M(m),$=b(m,"P",{"data-svelte-h":!0}),I($)!=="svelte-t69k4k"&&($.innerHTML=R),W=M(m),g(_.$$.fragment,m),B=M(m),C=b(m,"P",{"data-svelte-h":!0}),I(C)!=="svelte-1dmtoj2"&&(C.textContent=Q),v=M(m),g(T.$$.fragment,m)},m(m,U){t(m,a,U),t(m,l,U),h(i,m,U),t(m,u,U),t(m,$,U),t(m,W,U),h(_,m,U),t(m,B,U),t(m,C,U),t(m,v,U),h(T,m,U),V=!0},p:ss,i(m){V||(J(i.$$.fragment,m),J(_.$$.fragment,m),J(T.$$.fragment,m),V=!0)},o(m){f(i.$$.fragment,m),f(_.$$.fragment,m),f(T.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(u),e($),e(W),e(B),e(C),e(v)),w(i,m),w(_,m),w(T,m)}}}function Ja(k){let a,j;return a=new os({props:{$$slots:{default:[ha]},$$scope:{ctx:k}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){h(a,l,i),j=!0},p(l,i){const u={};i&2&&(u.$$scope={dirty:i,ctx:l}),a.$set(u)},i(l){j||(J(a.$$.fragment,l),j=!0)},o(l){f(a.$$.fragment,l),j=!1},d(l){w(a,l)}}}function fa(k){let a,j,l,i,u,$,R,W,_,B,C,Q=`의미적 분할(semantic segmentation)은 이미지의 각 픽셀에 레이블 또는 클래스를 할당합니다. 분할(segmentation)에는 여러 종류가 있으며, 의미적 분할의 경우 동일한 물체의 고유 인스턴스를 구분하지 않습니다. 두 물체 모두 동일한 레이블이 지정됩니다(예시로, “car-1” 과 “car-2” 대신 “car”로 지정합니다).
실생활에서 흔히 볼 수 있는 의미적 분할의 적용 사례로는 보행자와 중요한 교통 정보를 식별하는 자율 주행 자동차 학습, 의료 이미지의 세포와 이상 징후 식별, 그리고 위성 이미지의 환경 변화 모니터링등이 있습니다.`,v,T,V="이번 가이드에서 배울 내용은 다음과 같습니다:",m,U,X='<li><a href="https://huggingface.co/datasets/scene_parse_150" rel="nofollow">SceneParse150</a> 데이터 세트를 이용해 <a href="https://huggingface.co/docs/transformers/main/en/model_doc/segformer#segformer" rel="nofollow">SegFormer</a> 미세 조정하기.</li> <li>미세 조정된 모델을 추론에 사용하기.</li>',G,F,p,r,Y="시작하기 전에 필요한 모든 라이브러리가 설치되었는지 확인하세요:",H,S,q,N,js="커뮤니티에 모델을 업로드하고 공유할 수 있도록 Hugging Face 계정에 로그인하는 것을 권장합니다. 프롬프트가 나타나면 토큰을 입력하여 로그인하세요:",z,L,K,A,P,E,vs="🤗 Datasets 라이브러리에서 SceneParse150 데이터 세트의 더 작은 부분 집합을 가져오는 것으로 시작합니다. 이렇게 하면 데이터 세트 전체에 대한 훈련에 많은 시간을 할애하기 전에 실험을 통해 모든 것이 제대로 작동하는지 확인할 수 있습니다.",O,o,Z,D,Ul="데이터 세트의 <code>train</code>을 <code>train_test_split</code> 메소드를 사용하여 훈련 및 테스트 세트로 분할하세요:",Fs,ys,Ys,gs,Tl="그리고 예시를 살펴보세요:",Xs,hs,Ns,Js,dl="<li><code>image</code>: 장면의 PIL 이미지입니다.</li> <li><code>annotation</code>: 분할 지도(segmentation map)의 PIL 이미지입니다. 모델의 타겟이기도 합니다.</li> <li><code>scene_category</code>: “주방” 또는 “사무실”과 같이 이미지 장면을 설명하는 카테고리 ID입니다. 이 가이드에서는 둘 다 PIL 이미지인 <code>image</code>와 <code>annotation</code>만을 사용합니다.</li>",As,fs,bl="나중에 모델을 설정할 때 유용하게 사용할 수 있도록 레이블 ID를 레이블 클래스에 매핑하는 사전도 만들고 싶을 것입니다. Hub에서 매핑을 다운로드하고 <code>id2label</code> 및 <code>label2id</code> 사전을 만드세요:",Es,ws,Hs,us,zs,Us,$l="다음 단계는 모델에 사용할 이미지와 주석을 준비하기 위해 SegFormer 이미지 프로세서를 불러오는 것입니다. 우리가 사용하는 데이터 세트와 같은 일부 데이터 세트는 배경 클래스로 제로 인덱스를 사용합니다. 하지만 배경 클래스는 150개의 클래스에 실제로는 포함되지 않기 때문에 <code>do_reduce_labels=True</code> 를 설정해 모든 레이블에서 배경 클래스를 제거해야 합니다. 제로 인덱스는 <code>255</code>로 대체되므로 SegFormer의 손실 함수에서 무시됩니다:",Ss,Ts,Ls,ls,Ds,as,qs,ds,Ks,bs,Cl='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 되는 경우가 많습니다. 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> 라이브러리를 사용하여 평가 방법을 빠르게 로드할 수 있습니다. 이 태스크에서는 <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">mean Intersection over Union</a> (IoU) 메트릭을 로드하세요 (메트릭을 로드하고 계산하는 방법에 대해 자세히 알아보려면 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a>를 살펴보세요).',Ps,$s,Os,Cs,Il="그런 다음 메트릭을 <code>compute</code>하는 함수를 만듭니다. 예측을 먼저 로짓으로 변환한 다음, 레이블의 크기에 맞게 모양을 다시 지정해야 <code>compute</code>를 호출할 수 있습니다:",sl,es,ll,ts,al,Is,_l="이제 <code>compute_metrics</code> 함수를 사용할 준비가 되었습니다. 트레이닝을 설정할 때 이 함수로 돌아가게 됩니다.",el,_s,tl,ns,nl,ps,pl,ks,ml,Ws,kl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",rl,Bs,Wl="추론할 이미지를 로드하세요:",cl,Zs,Ml,ms,Bl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/semantic-seg-image.png" alt="Image of bedroom"/>',il,rs,ol,cs,jl,Vs,Zl='결과를 시각화하려면 <a href="https://github.com/tensorflow/models/blob/3f1ca33afe3c1631b733ea7e40c294273b9e406d/research/deeplab/utils/get_dataset_colormap.py#L51" rel="nofollow">dataset color palette</a>를 각 클래스를 RGB 값에 매핑하는 <code>ade_palette()</code>로 로드합니다. 그런 다음 이미지와 예측된 분할 지도(segmentation map)을 결합하여 구성할 수 있습니다:',yl,Gs,gl,Ms,Vl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/semantic-seg-preds.png" alt="Image of bedroom overlaid with segmentation map"/>',hl,xs,Jl,Qs,fl;return u=new Rs({props:{title:"의미적 분할(Semantic segmentation)",local:"semantic-segmentation",headingTag:"h1"}}),R=new Kl({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/semantic_segmentation.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/semantic_segmentation.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/semantic_segmentation.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/semantic_segmentation.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/semantic_segmentation.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/semantic_segmentation.ipynb"}]}}),_=new ql({props:{id:"dKE8SIt9C-w"}}),F=new ul({props:{$$slots:{default:[Ol]},$$scope:{ctx:k}}}),S=new x({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1xJTIwZGF0YXNldHMlMjB0cmFuc2Zvcm1lcnMlMjBldmFsdWF0ZQ==",highlighted:"pip install -q datasets transformers evaluate",wrap:!1}}),L=new x({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`,wrap:!1}}),A=new Rs({props:{title:"SceneParse150 데이터 세트 불러오기",local:"load-sceneparse150-dataset",headingTag:"h2"}}),o=new x({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZHMlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyc2NlbmVfcGFyc2VfMTUwJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiU1QiUzQTUwJTVEJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>ds = load_dataset(<span class="hljs-string">&quot;scene_parse_150&quot;</span>, split=<span class="hljs-string">&quot;train[:50]&quot;</span>)`,wrap:!1}}),ys=new x({props:{code:"ZHMlMjAlM0QlMjBkcy50cmFpbl90ZXN0X3NwbGl0KHRlc3Rfc2l6ZSUzRDAuMiklMEF0cmFpbl9kcyUyMCUzRCUyMGRzJTVCJTIydHJhaW4lMjIlNUQlMEF0ZXN0X2RzJTIwJTNEJTIwZHMlNUIlMjJ0ZXN0JTIyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>ds = ds.train_test_split(test_size=<span class="hljs-number">0.2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>train_ds = ds[<span class="hljs-string">&quot;train&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>test_ds = ds[<span class="hljs-string">&quot;test&quot;</span>]`,wrap:!1}}),hs=new x({props:{code:"dHJhaW5fZHMlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>train_ds[<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;image&#x27;</span>: &lt;PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=512x683 at <span class="hljs-number">0x7F9B0C201F90</span>&gt;,
 <span class="hljs-string">&#x27;annotation&#x27;</span>: &lt;PIL.PngImagePlugin.PngImageFile image mode=L size=512x683 at <span class="hljs-number">0x7F9B0C201DD0</span>&gt;,
 <span class="hljs-string">&#x27;scene_category&#x27;</span>: <span class="hljs-number">368</span>}`,wrap:!1}}),ws=new x({props:{code:"aW1wb3J0JTIwanNvbiUwQWZyb20lMjBwYXRobGliJTIwaW1wb3J0JTIwUGF0aCUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBoZl9odWJfZG93bmxvYWQlMEElMEFyZXBvX2lkJTIwJTNEJTIwJTIyaHVnZ2luZ2ZhY2UlMkZsYWJlbC1maWxlcyUyMiUwQWZpbGVuYW1lJTIwJTNEJTIwJTIyYWRlMjBrLWlkMmxhYmVsLmpzb24lMjIlMEFpZDJsYWJlbCUyMCUzRCUyMGpzb24ubG9hZHMoUGF0aChoZl9odWJfZG93bmxvYWQocmVwb19pZCUyQyUyMGZpbGVuYW1lJTJDJTIwcmVwb190eXBlJTNEJTIyZGF0YXNldCUyMikpLnJlYWRfdGV4dCgpKSUwQWlkMmxhYmVsJTIwJTNEJTIwJTdCaW50KGspJTNBJTIwdiUyMGZvciUyMGslMkMlMjB2JTIwaW4lMjBpZDJsYWJlbC5pdGVtcygpJTdEJTBBbGFiZWwyaWQlMjAlM0QlMjAlN0J2JTNBJTIwayUyMGZvciUyMGslMkMlMjB2JTIwaW4lMjBpZDJsYWJlbC5pdGVtcygpJTdEJTBBbnVtX2xhYmVscyUyMCUzRCUyMGxlbihpZDJsYWJlbCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> json
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>repo_id = <span class="hljs-string">&quot;huggingface/label-files&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>filename = <span class="hljs-string">&quot;ade20k-id2label.json&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>id2label = json.loads(Path(hf_hub_download(repo_id, filename, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)).read_text())
<span class="hljs-meta">&gt;&gt;&gt; </span>id2label = {<span class="hljs-built_in">int</span>(k): v <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> id2label.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>label2id = {v: k <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> id2label.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(id2label)`,wrap:!1}}),us=new Rs({props:{title:"전처리하기[ preprocess",local:"전처리하기-preprocess",headingTag:"h2"}}),Ts=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJudmlkaWElMkZtaXQtYjAlMjIlMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQlMkMlMjBkb19yZWR1Y2VfbGFiZWxzJTNEVHJ1ZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>checkpoint = <span class="hljs-string">&quot;nvidia/mit-b0&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(checkpoint, do_reduce_labels=<span class="hljs-literal">True</span>)`,wrap:!1}}),ls=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[la]},$$scope:{ctx:k}}}),as=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ea]},$$scope:{ctx:k}}}),ds=new Rs({props:{title:"평가하기",local:"evaluate",headingTag:"h2"}}),$s=new x({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEFtZXRyaWMlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMm1lYW5faW91JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>metric = evaluate.load(<span class="hljs-string">&quot;mean_iou&quot;</span>)`,wrap:!1}}),es=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[na]},$$scope:{ctx:k}}}),ts=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ma]},$$scope:{ctx:k}}}),_s=new Rs({props:{title:"학습하기",local:"train",headingTag:"h2"}}),ns=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Ma]},$$scope:{ctx:k}}}),ps=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ja]},$$scope:{ctx:k}}}),ks=new Rs({props:{title:"추론하기",local:"inference",headingTag:"h2"}}),Zs=new x({props:{code:"aW1hZ2UlMjAlM0QlMjBkcyU1QjAlNUQlNUIlMjJpbWFnZSUyMiU1RCUwQWltYWdl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>image = ds[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;image&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image`,wrap:!1}}),rs=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[ga]},$$scope:{ctx:k}}}),cs=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ja]},$$scope:{ctx:k}}}),Gs=new x({props:{code:"aW1wb3J0JTIwbWF0cGxvdGxpYi5weXBsb3QlMjBhcyUyMHBsdCUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQWNvbG9yX3NlZyUyMCUzRCUyMG5wLnplcm9zKChwcmVkX3NlZy5zaGFwZSU1QjAlNUQlMkMlMjBwcmVkX3NlZy5zaGFwZSU1QjElNUQlMkMlMjAzKSUyQyUyMGR0eXBlJTNEbnAudWludDgpJTBBcGFsZXR0ZSUyMCUzRCUyMG5wLmFycmF5KGFkZV9wYWxldHRlKCkpJTBBZm9yJTIwbGFiZWwlMkMlMjBjb2xvciUyMGluJTIwZW51bWVyYXRlKHBhbGV0dGUpJTNBJTBBJTIwJTIwJTIwJTIwY29sb3Jfc2VnJTVCcHJlZF9zZWclMjAlM0QlM0QlMjBsYWJlbCUyQyUyMCUzQSU1RCUyMCUzRCUyMGNvbG9yJTBBY29sb3Jfc2VnJTIwJTNEJTIwY29sb3Jfc2VnJTVCLi4uJTJDJTIwJTNBJTNBLTElNUQlMjAlMjAlMjMlMjBCR1IlRUIlQTElOUMlMjAlRUIlQjMlODAlRUQlOTklOTglMEElMEFpbWclMjAlM0QlMjBucC5hcnJheShpbWFnZSklMjAqJTIwMC41JTIwJTJCJTIwY29sb3Jfc2VnJTIwKiUyMDAuNSUyMCUyMCUyMyUyMCVFQiVCNiU4NCVFRCU5NSVBMCUyMCVFQyVBNyU4MCVFQiU4RiU4NCVFQyU5QyVCQyVFQiVBMSU5QyUyMCVFQyU5RCVCNCVFQiVBRiVCOCVFQyVBNyU4MCUyMCVFQSVCNSVBQyVFQyU4NCVCMSUwQWltZyUyMCUzRCUyMGltZy5hc3R5cGUobnAudWludDgpJTBBJTBBcGx0LmZpZ3VyZShmaWdzaXplJTNEKDE1JTJDJTIwMTApKSUwQXBsdC5pbXNob3coaW1nKSUwQXBsdC5zaG93KCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span>color_seg = np.zeros((pred_seg.shape[<span class="hljs-number">0</span>], pred_seg.shape[<span class="hljs-number">1</span>], <span class="hljs-number">3</span>), dtype=np.uint8)
<span class="hljs-meta">&gt;&gt;&gt; </span>palette = np.array(ade_palette())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> label, color <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(palette):
<span class="hljs-meta">... </span>    color_seg[pred_seg == label, :] = color
<span class="hljs-meta">&gt;&gt;&gt; </span>color_seg = color_seg[..., ::-<span class="hljs-number">1</span>]  <span class="hljs-comment"># BGR로 변환</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>img = np.array(image) * <span class="hljs-number">0.5</span> + color_seg * <span class="hljs-number">0.5</span>  <span class="hljs-comment"># 분할 지도으로 이미지 구성</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>img = img.astype(np.uint8)

<span class="hljs-meta">&gt;&gt;&gt; </span>plt.figure(figsize=(<span class="hljs-number">15</span>, <span class="hljs-number">10</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>plt.imshow(img)
<span class="hljs-meta">&gt;&gt;&gt; </span>plt.show()`,wrap:!1}}),xs=new Pl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/tasks/semantic_segmentation.md"}}),{c(){a=d("meta"),j=c(),l=d("p"),i=c(),y(u.$$.fragment),$=c(),y(R.$$.fragment),W=c(),y(_.$$.fragment),B=c(),C=d("p"),C.textContent=Q,v=c(),T=d("p"),T.textContent=V,m=c(),U=d("ol"),U.innerHTML=X,G=c(),y(F.$$.fragment),p=c(),r=d("p"),r.textContent=Y,H=c(),y(S.$$.fragment),q=c(),N=d("p"),N.textContent=js,z=c(),y(L.$$.fragment),K=c(),y(A.$$.fragment),P=c(),E=d("p"),E.textContent=vs,O=c(),y(o.$$.fragment),Z=c(),D=d("p"),D.innerHTML=Ul,Fs=c(),y(ys.$$.fragment),Ys=c(),gs=d("p"),gs.textContent=Tl,Xs=c(),y(hs.$$.fragment),Ns=c(),Js=d("ul"),Js.innerHTML=dl,As=c(),fs=d("p"),fs.innerHTML=bl,Es=c(),y(ws.$$.fragment),Hs=c(),y(us.$$.fragment),zs=c(),Us=d("p"),Us.innerHTML=$l,Ss=c(),y(Ts.$$.fragment),Ls=c(),y(ls.$$.fragment),Ds=c(),y(as.$$.fragment),qs=c(),y(ds.$$.fragment),Ks=c(),bs=d("p"),bs.innerHTML=Cl,Ps=c(),y($s.$$.fragment),Os=c(),Cs=d("p"),Cs.innerHTML=Il,sl=c(),y(es.$$.fragment),ll=c(),y(ts.$$.fragment),al=c(),Is=d("p"),Is.innerHTML=_l,el=c(),y(_s.$$.fragment),tl=c(),y(ns.$$.fragment),nl=c(),y(ps.$$.fragment),pl=c(),y(ks.$$.fragment),ml=c(),Ws=d("p"),Ws.textContent=kl,rl=c(),Bs=d("p"),Bs.textContent=Wl,cl=c(),y(Zs.$$.fragment),Ml=c(),ms=d("div"),ms.innerHTML=Bl,il=c(),y(rs.$$.fragment),ol=c(),y(cs.$$.fragment),jl=c(),Vs=d("p"),Vs.innerHTML=Zl,yl=c(),y(Gs.$$.fragment),gl=c(),Ms=d("div"),Ms.innerHTML=Vl,hl=c(),y(xs.$$.fragment),Jl=c(),Qs=d("p"),this.h()},l(s){const n=Ll("svelte-u9bgzb",document.head);a=b(n,"META",{name:!0,content:!0}),n.forEach(e),j=M(s),l=b(s,"P",{}),Al(l).forEach(e),i=M(s),g(u.$$.fragment,s),$=M(s),g(R.$$.fragment,s),W=M(s),g(_.$$.fragment,s),B=M(s),C=b(s,"P",{"data-svelte-h":!0}),I(C)!=="svelte-1pm3sh7"&&(C.textContent=Q),v=M(s),T=b(s,"P",{"data-svelte-h":!0}),I(T)!=="svelte-pdyjx9"&&(T.textContent=V),m=M(s),U=b(s,"OL",{"data-svelte-h":!0}),I(U)!=="svelte-1r6ennb"&&(U.innerHTML=X),G=M(s),g(F.$$.fragment,s),p=M(s),r=b(s,"P",{"data-svelte-h":!0}),I(r)!=="svelte-1aeak3y"&&(r.textContent=Y),H=M(s),g(S.$$.fragment,s),q=M(s),N=b(s,"P",{"data-svelte-h":!0}),I(N)!=="svelte-1ylwhj7"&&(N.textContent=js),z=M(s),g(L.$$.fragment,s),K=M(s),g(A.$$.fragment,s),P=M(s),E=b(s,"P",{"data-svelte-h":!0}),I(E)!=="svelte-zqz01o"&&(E.textContent=vs),O=M(s),g(o.$$.fragment,s),Z=M(s),D=b(s,"P",{"data-svelte-h":!0}),I(D)!=="svelte-1amyql0"&&(D.innerHTML=Ul),Fs=M(s),g(ys.$$.fragment,s),Ys=M(s),gs=b(s,"P",{"data-svelte-h":!0}),I(gs)!=="svelte-1rb3v2y"&&(gs.textContent=Tl),Xs=M(s),g(hs.$$.fragment,s),Ns=M(s),Js=b(s,"UL",{"data-svelte-h":!0}),I(Js)!=="svelte-9pyc0a"&&(Js.innerHTML=dl),As=M(s),fs=b(s,"P",{"data-svelte-h":!0}),I(fs)!=="svelte-1s2rnds"&&(fs.innerHTML=bl),Es=M(s),g(ws.$$.fragment,s),Hs=M(s),g(us.$$.fragment,s),zs=M(s),Us=b(s,"P",{"data-svelte-h":!0}),I(Us)!=="svelte-tfzfy1"&&(Us.innerHTML=$l),Ss=M(s),g(Ts.$$.fragment,s),Ls=M(s),g(ls.$$.fragment,s),Ds=M(s),g(as.$$.fragment,s),qs=M(s),g(ds.$$.fragment,s),Ks=M(s),bs=b(s,"P",{"data-svelte-h":!0}),I(bs)!=="svelte-1am5yvm"&&(bs.innerHTML=Cl),Ps=M(s),g($s.$$.fragment,s),Os=M(s),Cs=b(s,"P",{"data-svelte-h":!0}),I(Cs)!=="svelte-1kp3i6f"&&(Cs.innerHTML=Il),sl=M(s),g(es.$$.fragment,s),ll=M(s),g(ts.$$.fragment,s),al=M(s),Is=b(s,"P",{"data-svelte-h":!0}),I(Is)!=="svelte-100s3bb"&&(Is.innerHTML=_l),el=M(s),g(_s.$$.fragment,s),tl=M(s),g(ns.$$.fragment,s),nl=M(s),g(ps.$$.fragment,s),pl=M(s),g(ks.$$.fragment,s),ml=M(s),Ws=b(s,"P",{"data-svelte-h":!0}),I(Ws)!=="svelte-174wmmm"&&(Ws.textContent=kl),rl=M(s),Bs=b(s,"P",{"data-svelte-h":!0}),I(Bs)!=="svelte-y0x66m"&&(Bs.textContent=Wl),cl=M(s),g(Zs.$$.fragment,s),Ml=M(s),ms=b(s,"DIV",{class:!0,"data-svelte-h":!0}),I(ms)!=="svelte-11jfm1f"&&(ms.innerHTML=Bl),il=M(s),g(rs.$$.fragment,s),ol=M(s),g(cs.$$.fragment,s),jl=M(s),Vs=b(s,"P",{"data-svelte-h":!0}),I(Vs)!=="svelte-1adsal6"&&(Vs.innerHTML=Zl),yl=M(s),g(Gs.$$.fragment,s),gl=M(s),Ms=b(s,"DIV",{class:!0,"data-svelte-h":!0}),I(Ms)!=="svelte-nsecok"&&(Ms.innerHTML=Vl),hl=M(s),g(xs.$$.fragment,s),Jl=M(s),Qs=b(s,"P",{}),Al(Qs).forEach(e),this.h()},h(){wl(a,"name","hf:doc:metadata"),wl(a,"content",wa),wl(ms,"class","flex justify-center"),wl(Ms,"class","flex justify-center")},m(s,n){Dl(document.head,a),t(s,j,n),t(s,l,n),t(s,i,n),h(u,s,n),t(s,$,n),h(R,s,n),t(s,W,n),h(_,s,n),t(s,B,n),t(s,C,n),t(s,v,n),t(s,T,n),t(s,m,n),t(s,U,n),t(s,G,n),h(F,s,n),t(s,p,n),t(s,r,n),t(s,H,n),h(S,s,n),t(s,q,n),t(s,N,n),t(s,z,n),h(L,s,n),t(s,K,n),h(A,s,n),t(s,P,n),t(s,E,n),t(s,O,n),h(o,s,n),t(s,Z,n),t(s,D,n),t(s,Fs,n),h(ys,s,n),t(s,Ys,n),t(s,gs,n),t(s,Xs,n),h(hs,s,n),t(s,Ns,n),t(s,Js,n),t(s,As,n),t(s,fs,n),t(s,Es,n),h(ws,s,n),t(s,Hs,n),h(us,s,n),t(s,zs,n),t(s,Us,n),t(s,Ss,n),h(Ts,s,n),t(s,Ls,n),h(ls,s,n),t(s,Ds,n),h(as,s,n),t(s,qs,n),h(ds,s,n),t(s,Ks,n),t(s,bs,n),t(s,Ps,n),h($s,s,n),t(s,Os,n),t(s,Cs,n),t(s,sl,n),h(es,s,n),t(s,ll,n),h(ts,s,n),t(s,al,n),t(s,Is,n),t(s,el,n),h(_s,s,n),t(s,tl,n),h(ns,s,n),t(s,nl,n),h(ps,s,n),t(s,pl,n),h(ks,s,n),t(s,ml,n),t(s,Ws,n),t(s,rl,n),t(s,Bs,n),t(s,cl,n),h(Zs,s,n),t(s,Ml,n),t(s,ms,n),t(s,il,n),h(rs,s,n),t(s,ol,n),h(cs,s,n),t(s,jl,n),t(s,Vs,n),t(s,yl,n),h(Gs,s,n),t(s,gl,n),t(s,Ms,n),t(s,hl,n),h(xs,s,n),t(s,Jl,n),t(s,Qs,n),fl=!0},p(s,[n]){const Gl={};n&2&&(Gl.$$scope={dirty:n,ctx:s}),F.$set(Gl);const xl={};n&2&&(xl.$$scope={dirty:n,ctx:s}),ls.$set(xl);const Rl={};n&2&&(Rl.$$scope={dirty:n,ctx:s}),as.$set(Rl);const vl={};n&2&&(vl.$$scope={dirty:n,ctx:s}),es.$set(vl);const Ql={};n&2&&(Ql.$$scope={dirty:n,ctx:s}),ts.$set(Ql);const Fl={};n&2&&(Fl.$$scope={dirty:n,ctx:s}),ns.$set(Fl);const Yl={};n&2&&(Yl.$$scope={dirty:n,ctx:s}),ps.$set(Yl);const Xl={};n&2&&(Xl.$$scope={dirty:n,ctx:s}),rs.$set(Xl);const Nl={};n&2&&(Nl.$$scope={dirty:n,ctx:s}),cs.$set(Nl)},i(s){fl||(J(u.$$.fragment,s),J(R.$$.fragment,s),J(_.$$.fragment,s),J(F.$$.fragment,s),J(S.$$.fragment,s),J(L.$$.fragment,s),J(A.$$.fragment,s),J(o.$$.fragment,s),J(ys.$$.fragment,s),J(hs.$$.fragment,s),J(ws.$$.fragment,s),J(us.$$.fragment,s),J(Ts.$$.fragment,s),J(ls.$$.fragment,s),J(as.$$.fragment,s),J(ds.$$.fragment,s),J($s.$$.fragment,s),J(es.$$.fragment,s),J(ts.$$.fragment,s),J(_s.$$.fragment,s),J(ns.$$.fragment,s),J(ps.$$.fragment,s),J(ks.$$.fragment,s),J(Zs.$$.fragment,s),J(rs.$$.fragment,s),J(cs.$$.fragment,s),J(Gs.$$.fragment,s),J(xs.$$.fragment,s),fl=!0)},o(s){f(u.$$.fragment,s),f(R.$$.fragment,s),f(_.$$.fragment,s),f(F.$$.fragment,s),f(S.$$.fragment,s),f(L.$$.fragment,s),f(A.$$.fragment,s),f(o.$$.fragment,s),f(ys.$$.fragment,s),f(hs.$$.fragment,s),f(ws.$$.fragment,s),f(us.$$.fragment,s),f(Ts.$$.fragment,s),f(ls.$$.fragment,s),f(as.$$.fragment,s),f(ds.$$.fragment,s),f($s.$$.fragment,s),f(es.$$.fragment,s),f(ts.$$.fragment,s),f(_s.$$.fragment,s),f(ns.$$.fragment,s),f(ps.$$.fragment,s),f(ks.$$.fragment,s),f(Zs.$$.fragment,s),f(rs.$$.fragment,s),f(cs.$$.fragment,s),f(Gs.$$.fragment,s),f(xs.$$.fragment,s),fl=!1},d(s){s&&(e(j),e(l),e(i),e($),e(W),e(B),e(C),e(v),e(T),e(m),e(U),e(G),e(p),e(r),e(H),e(q),e(N),e(z),e(K),e(P),e(E),e(O),e(Z),e(D),e(Fs),e(Ys),e(gs),e(Xs),e(Ns),e(Js),e(As),e(fs),e(Es),e(Hs),e(zs),e(Us),e(Ss),e(Ls),e(Ds),e(qs),e(Ks),e(bs),e(Ps),e(Os),e(Cs),e(sl),e(ll),e(al),e(Is),e(el),e(tl),e(nl),e(pl),e(ml),e(Ws),e(rl),e(Bs),e(cl),e(Ml),e(ms),e(il),e(ol),e(jl),e(Vs),e(yl),e(gl),e(Ms),e(hl),e(Jl),e(Qs)),e(a),w(u,s),w(R,s),w(_,s),w(F,s),w(S,s),w(L,s),w(A,s),w(o,s),w(ys,s),w(hs,s),w(ws,s),w(us,s),w(Ts,s),w(ls,s),w(as,s),w(ds,s),w($s,s),w(es,s),w(ts,s),w(_s,s),w(ns,s),w(ps,s),w(ks,s),w(Zs,s),w(rs,s),w(cs,s),w(Gs,s),w(xs,s)}}}const wa='{"title":"의미적 분할(Semantic segmentation)","local":"semantic-segmentation","sections":[{"title":"SceneParse150 데이터 세트 불러오기","local":"load-sceneparse150-dataset","sections":[],"depth":2},{"title":"전처리하기[ preprocess","local":"전처리하기-preprocess","sections":[],"depth":2},{"title":"평가하기","local":"evaluate","sections":[],"depth":2},{"title":"학습하기","local":"train","sections":[],"depth":2},{"title":"추론하기","local":"inference","sections":[],"depth":2}],"depth":1}';function ua(k){return Hl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ka extends zl{constructor(a){super(),Sl(this,a,ua,fa,El,{})}}export{ka as component};
