import{s as El,o as Hl,n as ss}from"../chunks/scheduler.56730f09.js";import{S as zl,i as Sl,g as d,s as r,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 fl,y as Dl,a as t,v as J,d as h,t as w,w as f}from"../chunks/index.1f144517.js";import{T as Ul}from"../chunks/Tip.41e845e5.js";import{Y as ql}from"../chunks/Youtube.62e0f062.js";import{C as x}from"../chunks/CodeBlock.738eeccb.js";import{D as Kl}from"../chunks/DocNotebookDropdown.243c3df7.js";import{F as is,M as os}from"../chunks/Markdown.c541024b.js";import{H as Rs,E as Pl}from"../chunks/EditOnGithub.854793f1.js";function Ol(W){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(W){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>만 자릅니다.",B,_,Z,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=r(),y(i.$$.fragment),U=r(),$=d("p"),$.innerHTML=R,B=r(),y(_.$$.fragment),Z=r(),C=d("p"),C.innerHTML=Q,v=r(),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),B=M(m),g(_.$$.fragment,m),Z=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),J(i,m,u),t(m,U,u),t(m,$,u),t(m,B,u),J(_,m,u),t(m,Z,u),t(m,C,u),t(m,v,u),J(T,m,u),V=!0},p:ss,i(m){V||(h(i.$$.fragment,m),h(_.$$.fragment,m),h(T.$$.fragment,m),V=!0)},o(m){w(i.$$.fragment,m),w(_.$$.fragment,m),w(T.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(U),e($),e(B),e(Z),e(C),e(v)),f(i,m),f(_,m),f(T,m)}}}function la(W){let a,j;return a=new os({props:{$$slots:{default:[sa]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function aa(W){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,B="<li>이미지 증강을 포함하는 학습 데이터 변환</li> <li>🤗 Transformers의 컴퓨터 비전 모델은 채널 우선 레이아웃을 기대하기 때문에, 이미지만 바꾸는 검증 데이터 변환</li>",_,Z,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,Y,p;return Z=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}}),Y=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=r(),i=d("p"),i.textContent=U,$=r(),R=d("ul"),R.innerHTML=B,_=r(),y(Z.$$.fragment),C=r(),Q=d("p"),Q.innerHTML=v,T=r(),y(V.$$.fragment),m=r(),u=d("p"),u.innerHTML=X,G=r(),y(Y.$$.fragment)},l(c){a=b(c,"P",{"data-svelte-h":!0}),I(a)!=="svelte-r0uin4"&&(a.innerHTML=j),l=M(c),i=b(c,"P",{"data-svelte-h":!0}),I(i)!=="svelte-163wstu"&&(i.textContent=U),$=M(c),R=b(c,"UL",{"data-svelte-h":!0}),I(R)!=="svelte-5sercd"&&(R.innerHTML=B),_=M(c),g(Z.$$.fragment,c),C=M(c),Q=b(c,"P",{"data-svelte-h":!0}),I(Q)!=="svelte-1p58cmv"&&(Q.innerHTML=v),T=M(c),g(V.$$.fragment,c),m=M(c),u=b(c,"P",{"data-svelte-h":!0}),I(u)!=="svelte-1trxcly"&&(u.innerHTML=X),G=M(c),g(Y.$$.fragment,c)},m(c,F){t(c,a,F),t(c,l,F),t(c,i,F),t(c,$,F),t(c,R,F),t(c,_,F),J(Z,c,F),t(c,C,F),t(c,Q,F),t(c,T,F),J(V,c,F),t(c,m,F),t(c,u,F),t(c,G,F),J(Y,c,F),p=!0},p:ss,i(c){p||(h(Z.$$.fragment,c),h(V.$$.fragment,c),h(Y.$$.fragment,c),p=!0)},o(c){w(Z.$$.fragment,c),w(V.$$.fragment,c),w(Y.$$.fragment,c),p=!1},d(c){c&&(e(a),e(l),e(i),e($),e(R),e(_),e(C),e(Q),e(T),e(m),e(u),e(G)),f(Z,c),f(V,c),f(Y,c)}}}function ea(W){let a,j;return a=new os({props:{$$slots:{default:[aa]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function ta(W){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){J(a,l,i),j=!0},p:ss,i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function na(W){let a,j;return a=new os({props:{$$slots:{default:[ta]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function pa(W){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){J(a,l,i),j=!0},p:ss,i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function ma(W){let a,j;return a=new os({props:{$$slots:{default:[pa]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function ca(W){let a,j='만약 <code>Trainer</code>를 사용해 모델을 미세 조정하는 것에 익숙하지 않다면, <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-3emgbb"&&(a.innerHTML=j)},m(l,i){t(l,a,i)},p:ss,d(l){l&&e(a)}}}function ra(W){let a,j,l,i="이제 모델 학습을 시작할 준비가 되었습니다! <code>AutoModelForSemanticSegmentation</code>로 SegFormer를 불러오고, 모델에 레이블 ID와 레이블 클래스 간의 매핑을 전달합니다:",U,$,R,B,_="이제 세 단계만 남았습니다:",Z,C,Q="<li>학습 하이퍼파라미터를 <code>TrainingArguments</code>에 정의합니다. <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에 로그인해야 합니다). 각 에포크가 끝날 때마다 <code>Trainer</code>가 IoU 메트릭을 평가하고 학습 체크포인트를 저장합니다.</li> <li>모델, 데이터 세트, 토크나이저, 데이터 콜레이터, <code>compute_metrics</code> 함수와 함께 학습 인자를 <code>Trainer</code>에 전달하세요.</li> <li>모델을 미세 조정하기 위해 <code>train()</code>를 호출하세요.</li>",v,T,V,m,u="학습이 완료되면, 누구나 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메서드를 사용해 Hub에 모델을 공유하세요:",X,G,Y;return a=new Ul({props:{$$slots:{default:[ca]},$$scope:{ctx:W}}}),$=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=r(),l=d("p"),l.innerHTML=i,U=r(),y($.$$.fragment),R=r(),B=d("p"),B.textContent=_,Z=r(),C=d("ol"),C.innerHTML=Q,v=r(),y(T.$$.fragment),V=r(),m=d("p"),m.innerHTML=u,X=r(),y(G.$$.fragment)},l(p){g(a.$$.fragment,p),j=M(p),l=b(p,"P",{"data-svelte-h":!0}),I(l)!=="svelte-1j8jvu6"&&(l.innerHTML=i),U=M(p),g($.$$.fragment,p),R=M(p),B=b(p,"P",{"data-svelte-h":!0}),I(B)!=="svelte-1vwg7jz"&&(B.textContent=_),Z=M(p),C=b(p,"OL",{"data-svelte-h":!0}),I(C)!=="svelte-ds64a5"&&(C.innerHTML=Q),v=M(p),g(T.$$.fragment,p),V=M(p),m=b(p,"P",{"data-svelte-h":!0}),I(m)!=="svelte-sq2z1z"&&(m.innerHTML=u),X=M(p),g(G.$$.fragment,p)},m(p,c){J(a,p,c),t(p,j,c),t(p,l,c),t(p,U,c),J($,p,c),t(p,R,c),t(p,B,c),t(p,Z,c),t(p,C,c),t(p,v,c),J(T,p,c),t(p,V,c),t(p,m,c),t(p,X,c),J(G,p,c),Y=!0},p(p,c){const F={};c&2&&(F.$$scope={dirty:c,ctx:p}),a.$set(F)},i(p){Y||(h(a.$$.fragment,p),h($.$$.fragment,p),h(T.$$.fragment,p),h(G.$$.fragment,p),Y=!0)},o(p){w(a.$$.fragment,p),w($.$$.fragment,p),w(T.$$.fragment,p),w(G.$$.fragment,p),Y=!1},d(p){p&&(e(j),e(l),e(U),e(R),e(B),e(Z),e(C),e(v),e(V),e(m),e(X)),f(a,p),f($,p),f(T,p),f(G,p)}}}function Ma(W){let a,j;return a=new os({props:{$$slots:{default:[ra]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function ia(W){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(W){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>",B,_,Z="하이퍼파라미터, 옵티마이저, 학습률 스케쥴러를 정의하는 것으로 시작하세요:",C,Q,v,T,V="그런 다음 레이블 매핑과 함께 <code>TFAutoModelForSemanticSegmentation</code>을 사용하여 SegFormer를 불러오고 옵티마이저로 컴파일합니다. 트랜스포머 모델은 모두 디폴트로 태스크 관련 손실 함수가 있으므로 원치 않으면 지정할 필요가 없습니다:",m,u,X,G,Y="<code>to_tf_dataset</code> 와 <code>DefaultDataCollator</code>를 사용해 데이터 세트를 <code>tf.data.Dataset</code> 포맷으로 변환하세요:",p,c,F,H,S='예측으로 정확도를 계산하고 모델을 🤗 Hub로 푸시하려면 <a href="../main_classes/keras_callbacks">Keras callbacks</a>를 사용하세요. <code>compute_metrics</code> 함수를 <code>KerasMetricCallback</code>에 전달하고, 모델 업로드를 위해 <code>PushToHubCallback</code>를 사용하세요:',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:W}}}),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}}),c=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=r(),l=d("p"),l.textContent=i,U=r(),$=d("ol"),$.innerHTML=R,B=r(),_=d("p"),_.textContent=Z,C=r(),y(Q.$$.fragment),v=r(),T=d("p"),T.innerHTML=V,m=r(),y(u.$$.fragment),X=r(),G=d("p"),G.innerHTML=Y,p=r(),y(c.$$.fragment),F=r(),H=d("p"),H.innerHTML=S,q=r(),y(N.$$.fragment),js=r(),z=d("p"),z.innerHTML=L,K=r(),y(A.$$.fragment),P=r(),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),B=M(o),_=b(o,"P",{"data-svelte-h":!0}),I(_)!=="svelte-wcragq"&&(_.textContent=Z),C=M(o),g(Q.$$.fragment,o),v=M(o),T=b(o,"P",{"data-svelte-h":!0}),I(T)!=="svelte-nqumm8"&&(T.innerHTML=V),m=M(o),g(u.$$.fragment,o),X=M(o),G=b(o,"P",{"data-svelte-h":!0}),I(G)!=="svelte-1qohu6b"&&(G.innerHTML=Y),p=M(o),g(c.$$.fragment,o),F=M(o),H=b(o,"P",{"data-svelte-h":!0}),I(H)!=="svelte-1piamfe"&&(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,k){J(a,o,k),t(o,j,k),t(o,l,k),t(o,U,k),t(o,$,k),t(o,B,k),t(o,_,k),t(o,C,k),J(Q,o,k),t(o,v,k),t(o,T,k),t(o,m,k),J(u,o,k),t(o,X,k),t(o,G,k),t(o,p,k),J(c,o,k),t(o,F,k),t(o,H,k),t(o,q,k),J(N,o,k),t(o,js,k),t(o,z,k),t(o,K,k),J(A,o,k),t(o,P,k),t(o,E,k),O=!0},p(o,k){const D={};k&2&&(D.$$scope={dirty:k,ctx:o}),a.$set(D)},i(o){O||(h(a.$$.fragment,o),h(Q.$$.fragment,o),h(u.$$.fragment,o),h(c.$$.fragment,o),h(N.$$.fragment,o),h(A.$$.fragment,o),O=!0)},o(o){w(a.$$.fragment,o),w(Q.$$.fragment,o),w(u.$$.fragment,o),w(c.$$.fragment,o),w(N.$$.fragment,o),w(A.$$.fragment,o),O=!1},d(o){o&&(e(j),e(l),e(U),e($),e(B),e(_),e(C),e(v),e(T),e(m),e(X),e(G),e(p),e(F),e(H),e(q),e(js),e(z),e(K),e(P),e(E)),f(a,o),f(Q,o),f(u,o),f(c,o),f(N,o),f(A,o)}}}function ja(W){let a,j;return a=new os({props:{$$slots:{default:[oa]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function ya(W){let a,j="추론을 위해 미세 조정한 모델을 시험해 보는 가장 간단한 방법은 <code>pipeline()</code>에서 사용하는 것입니다. 모델을 사용하여 이미지 분할을 위한 <code>pipeline</code>을 인스턴스화하고 이미지를 전달합니다:",l,i,U,$,R="원하는 경우 <code>pipeline</code>의 결과를 수동으로 복제할 수도 있습니다. 이미지 프로세서로 이미지를 처리하고 <code>pixel_values</code>을 GPU에 배치합니다:",B,_,Z,C,Q="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",v,T,V,m,u="그런 다음 로짓의 크기를 원본 이미지 크기로 다시 조정합니다:",X,G,Y;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=r(),y(i.$$.fragment),U=r(),$=d("p"),$.innerHTML=R,B=r(),y(_.$$.fragment),Z=r(),C=d("p"),C.innerHTML=Q,v=r(),y(T.$$.fragment),V=r(),m=d("p"),m.textContent=u,X=r(),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),B=M(p),g(_.$$.fragment,p),Z=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,c){t(p,a,c),t(p,l,c),J(i,p,c),t(p,U,c),t(p,$,c),t(p,B,c),J(_,p,c),t(p,Z,c),t(p,C,c),t(p,v,c),J(T,p,c),t(p,V,c),t(p,m,c),t(p,X,c),J(G,p,c),Y=!0},p:ss,i(p){Y||(h(i.$$.fragment,p),h(_.$$.fragment,p),h(T.$$.fragment,p),h(G.$$.fragment,p),Y=!0)},o(p){w(i.$$.fragment,p),w(_.$$.fragment,p),w(T.$$.fragment,p),w(G.$$.fragment,p),Y=!1},d(p){p&&(e(a),e(l),e(U),e($),e(B),e(Z),e(C),e(v),e(V),e(m),e(X)),f(i,p),f(_,p),f(T,p),f(G,p)}}}function ga(W){let a,j;return a=new os({props:{$$slots:{default:[ya]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function Ja(W){let a,j="이미지 프로세서를 로드하여 이미지를 전처리하고 입력을 TensorFlow 텐서로 반환합니다:",l,i,U,$,R="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",B,_,Z,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=r(),y(i.$$.fragment),U=r(),$=d("p"),$.innerHTML=R,B=r(),y(_.$$.fragment),Z=r(),C=d("p"),C.textContent=Q,v=r(),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),B=M(m),g(_.$$.fragment,m),Z=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),J(i,m,u),t(m,U,u),t(m,$,u),t(m,B,u),J(_,m,u),t(m,Z,u),t(m,C,u),t(m,v,u),J(T,m,u),V=!0},p:ss,i(m){V||(h(i.$$.fragment,m),h(_.$$.fragment,m),h(T.$$.fragment,m),V=!0)},o(m){w(i.$$.fragment,m),w(_.$$.fragment,m),w(T.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(U),e($),e(B),e(Z),e(C),e(v)),f(i,m),f(_,m),f(T,m)}}}function ha(W){let a,j;return a=new os({props:{$$slots:{default:[Ja]},$$scope:{ctx:W}}}),{c(){y(a.$$.fragment)},l(l){g(a.$$.fragment,l)},m(l,i){J(a,l,i),j=!0},p(l,i){const U={};i&2&&(U.$$scope={dirty:i,ctx:l}),a.$set(U)},i(l){j||(h(a.$$.fragment,l),j=!0)},o(l){w(a.$$.fragment,l),j=!1},d(l){f(a,l)}}}function wa(W){let a,j,l,i,U,$,R,B,_,Z,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,Y,p,c,F="시작하기 전에 필요한 모든 라이브러리가 설치되었는지 확인하세요:",H,S,q,N,js="커뮤니티에 모델을 업로드하고 공유할 수 있도록 Hugging Face 계정에 로그인하는 것을 권장합니다. 프롬프트가 나타나면 토큰을 입력하여 로그인하세요:",z,L,K,A,P,E,vs="🤗 Datasets 라이브러리에서 SceneParse150 데이터 세트의 더 작은 부분 집합을 가져오는 것으로 시작합니다. 이렇게 하면 데이터 세트 전체에 대한 훈련에 많은 시간을 할애하기 전에 실험을 통해 모든 것이 제대로 작동하는지 확인할 수 있습니다.",O,o,k,D,ul="데이터 세트의 <code>train</code>을 <code>train_test_split</code> 메소드를 사용하여 훈련 및 테스트 세트로 분할하세요:",Ys,ys,Fs,gs,Tl="그리고 예시를 살펴보세요:",Xs,Js,Ns,hs,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,ws,bl="나중에 모델을 설정할 때 유용하게 사용할 수 있도록 레이블 ID를 레이블 클래스에 매핑하는 사전도 만들고 싶을 것입니다. Hub에서 매핑을 다운로드하고 <code>id2label</code> 및 <code>label2id</code> 사전을 만드세요:",Es,fs,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,Ws,ml,Bs,Wl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",cl,Zs,Bl="추론할 이미지를 로드하세요:",rl,ks,Ml,ms,Zl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/semantic-seg-image.png" alt="Image of bedroom"/>',il,cs,ol,rs,jl,Vs,kl='결과를 시각화하려면 <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"/>',Jl,xs,hl,Qs,wl;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"}}),Y=new Ul({props:{$$slots:{default:[Ol]},$$scope:{ctx:W}}}),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}}),Js=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}}),fs=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:W}}}),as=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ea]},$$scope:{ctx:W}}}),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:W}}}),ts=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ma]},$$scope:{ctx:W}}}),_s=new Rs({props:{title:"학습하기",local:"train",headingTag:"h2"}}),ns=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Ma]},$$scope:{ctx:W}}}),ps=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ja]},$$scope:{ctx:W}}}),Ws=new Rs({props:{title:"추론하기",local:"inference",headingTag:"h2"}}),ks=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}}),cs=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[ga]},$$scope:{ctx:W}}}),rs=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ha]},$$scope:{ctx:W}}}),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=r(),l=d("p"),i=r(),y(U.$$.fragment),$=r(),y(R.$$.fragment),B=r(),y(_.$$.fragment),Z=r(),C=d("p"),C.textContent=Q,v=r(),T=d("p"),T.textContent=V,m=r(),u=d("ol"),u.innerHTML=X,G=r(),y(Y.$$.fragment),p=r(),c=d("p"),c.textContent=F,H=r(),y(S.$$.fragment),q=r(),N=d("p"),N.textContent=js,z=r(),y(L.$$.fragment),K=r(),y(A.$$.fragment),P=r(),E=d("p"),E.textContent=vs,O=r(),y(o.$$.fragment),k=r(),D=d("p"),D.innerHTML=ul,Ys=r(),y(ys.$$.fragment),Fs=r(),gs=d("p"),gs.textContent=Tl,Xs=r(),y(Js.$$.fragment),Ns=r(),hs=d("ul"),hs.innerHTML=dl,As=r(),ws=d("p"),ws.innerHTML=bl,Es=r(),y(fs.$$.fragment),Hs=r(),y(Us.$$.fragment),zs=r(),us=d("p"),us.innerHTML=$l,Ss=r(),y(Ts.$$.fragment),Ls=r(),y(ls.$$.fragment),Ds=r(),y(as.$$.fragment),qs=r(),y(ds.$$.fragment),Ks=r(),bs=d("p"),bs.innerHTML=Cl,Ps=r(),y($s.$$.fragment),Os=r(),Cs=d("p"),Cs.innerHTML=Il,sl=r(),y(es.$$.fragment),ll=r(),y(ts.$$.fragment),al=r(),Is=d("p"),Is.innerHTML=_l,el=r(),y(_s.$$.fragment),tl=r(),y(ns.$$.fragment),nl=r(),y(ps.$$.fragment),pl=r(),y(Ws.$$.fragment),ml=r(),Bs=d("p"),Bs.textContent=Wl,cl=r(),Zs=d("p"),Zs.textContent=Bl,rl=r(),y(ks.$$.fragment),Ml=r(),ms=d("div"),ms.innerHTML=Zl,il=r(),y(cs.$$.fragment),ol=r(),y(rs.$$.fragment),jl=r(),Vs=d("p"),Vs.innerHTML=kl,yl=r(),y(Gs.$$.fragment),gl=r(),Ms=d("div"),Ms.innerHTML=Vl,Jl=r(),y(xs.$$.fragment),hl=r(),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),B=M(s),g(_.$$.fragment,s),Z=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(Y.$$.fragment,s),p=M(s),c=b(s,"P",{"data-svelte-h":!0}),I(c)!=="svelte-1aeak3y"&&(c.textContent=F),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),k=M(s),D=b(s,"P",{"data-svelte-h":!0}),I(D)!=="svelte-1amyql0"&&(D.innerHTML=ul),Ys=M(s),g(ys.$$.fragment,s),Fs=M(s),gs=b(s,"P",{"data-svelte-h":!0}),I(gs)!=="svelte-1rb3v2y"&&(gs.textContent=Tl),Xs=M(s),g(Js.$$.fragment,s),Ns=M(s),hs=b(s,"UL",{"data-svelte-h":!0}),I(hs)!=="svelte-9pyc0a"&&(hs.innerHTML=dl),As=M(s),ws=b(s,"P",{"data-svelte-h":!0}),I(ws)!=="svelte-1s2rnds"&&(ws.innerHTML=bl),Es=M(s),g(fs.$$.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(Ws.$$.fragment,s),ml=M(s),Bs=b(s,"P",{"data-svelte-h":!0}),I(Bs)!=="svelte-174wmmm"&&(Bs.textContent=Wl),cl=M(s),Zs=b(s,"P",{"data-svelte-h":!0}),I(Zs)!=="svelte-y0x66m"&&(Zs.textContent=Bl),rl=M(s),g(ks.$$.fragment,s),Ml=M(s),ms=b(s,"DIV",{class:!0,"data-svelte-h":!0}),I(ms)!=="svelte-11jfm1f"&&(ms.innerHTML=Zl),il=M(s),g(cs.$$.fragment,s),ol=M(s),g(rs.$$.fragment,s),jl=M(s),Vs=b(s,"P",{"data-svelte-h":!0}),I(Vs)!=="svelte-1adsal6"&&(Vs.innerHTML=kl),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),Jl=M(s),g(xs.$$.fragment,s),hl=M(s),Qs=b(s,"P",{}),Al(Qs).forEach(e),this.h()},h(){fl(a,"name","hf:doc:metadata"),fl(a,"content",fa),fl(ms,"class","flex justify-center"),fl(Ms,"class","flex justify-center")},m(s,n){Dl(document.head,a),t(s,j,n),t(s,l,n),t(s,i,n),J(U,s,n),t(s,$,n),J(R,s,n),t(s,B,n),J(_,s,n),t(s,Z,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),J(Y,s,n),t(s,p,n),t(s,c,n),t(s,H,n),J(S,s,n),t(s,q,n),t(s,N,n),t(s,z,n),J(L,s,n),t(s,K,n),J(A,s,n),t(s,P,n),t(s,E,n),t(s,O,n),J(o,s,n),t(s,k,n),t(s,D,n),t(s,Ys,n),J(ys,s,n),t(s,Fs,n),t(s,gs,n),t(s,Xs,n),J(Js,s,n),t(s,Ns,n),t(s,hs,n),t(s,As,n),t(s,ws,n),t(s,Es,n),J(fs,s,n),t(s,Hs,n),J(Us,s,n),t(s,zs,n),t(s,us,n),t(s,Ss,n),J(Ts,s,n),t(s,Ls,n),J(ls,s,n),t(s,Ds,n),J(as,s,n),t(s,qs,n),J(ds,s,n),t(s,Ks,n),t(s,bs,n),t(s,Ps,n),J($s,s,n),t(s,Os,n),t(s,Cs,n),t(s,sl,n),J(es,s,n),t(s,ll,n),J(ts,s,n),t(s,al,n),t(s,Is,n),t(s,el,n),J(_s,s,n),t(s,tl,n),J(ns,s,n),t(s,nl,n),J(ps,s,n),t(s,pl,n),J(Ws,s,n),t(s,ml,n),t(s,Bs,n),t(s,cl,n),t(s,Zs,n),t(s,rl,n),J(ks,s,n),t(s,Ml,n),t(s,ms,n),t(s,il,n),J(cs,s,n),t(s,ol,n),J(rs,s,n),t(s,jl,n),t(s,Vs,n),t(s,yl,n),J(Gs,s,n),t(s,gl,n),t(s,Ms,n),t(s,Jl,n),J(xs,s,n),t(s,hl,n),t(s,Qs,n),wl=!0},p(s,[n]){const Gl={};n&2&&(Gl.$$scope={dirty:n,ctx:s}),Y.$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 Yl={};n&2&&(Yl.$$scope={dirty:n,ctx:s}),ns.$set(Yl);const Fl={};n&2&&(Fl.$$scope={dirty:n,ctx:s}),ps.$set(Fl);const Xl={};n&2&&(Xl.$$scope={dirty:n,ctx:s}),cs.$set(Xl);const Nl={};n&2&&(Nl.$$scope={dirty:n,ctx:s}),rs.$set(Nl)},i(s){wl||(h(U.$$.fragment,s),h(R.$$.fragment,s),h(_.$$.fragment,s),h(Y.$$.fragment,s),h(S.$$.fragment,s),h(L.$$.fragment,s),h(A.$$.fragment,s),h(o.$$.fragment,s),h(ys.$$.fragment,s),h(Js.$$.fragment,s),h(fs.$$.fragment,s),h(Us.$$.fragment,s),h(Ts.$$.fragment,s),h(ls.$$.fragment,s),h(as.$$.fragment,s),h(ds.$$.fragment,s),h($s.$$.fragment,s),h(es.$$.fragment,s),h(ts.$$.fragment,s),h(_s.$$.fragment,s),h(ns.$$.fragment,s),h(ps.$$.fragment,s),h(Ws.$$.fragment,s),h(ks.$$.fragment,s),h(cs.$$.fragment,s),h(rs.$$.fragment,s),h(Gs.$$.fragment,s),h(xs.$$.fragment,s),wl=!0)},o(s){w(U.$$.fragment,s),w(R.$$.fragment,s),w(_.$$.fragment,s),w(Y.$$.fragment,s),w(S.$$.fragment,s),w(L.$$.fragment,s),w(A.$$.fragment,s),w(o.$$.fragment,s),w(ys.$$.fragment,s),w(Js.$$.fragment,s),w(fs.$$.fragment,s),w(Us.$$.fragment,s),w(Ts.$$.fragment,s),w(ls.$$.fragment,s),w(as.$$.fragment,s),w(ds.$$.fragment,s),w($s.$$.fragment,s),w(es.$$.fragment,s),w(ts.$$.fragment,s),w(_s.$$.fragment,s),w(ns.$$.fragment,s),w(ps.$$.fragment,s),w(Ws.$$.fragment,s),w(ks.$$.fragment,s),w(cs.$$.fragment,s),w(rs.$$.fragment,s),w(Gs.$$.fragment,s),w(xs.$$.fragment,s),wl=!1},d(s){s&&(e(j),e(l),e(i),e($),e(B),e(Z),e(C),e(v),e(T),e(m),e(u),e(G),e(p),e(c),e(H),e(q),e(N),e(z),e(K),e(P),e(E),e(O),e(k),e(D),e(Ys),e(Fs),e(gs),e(Xs),e(Ns),e(hs),e(As),e(ws),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(Bs),e(cl),e(Zs),e(rl),e(Ml),e(ms),e(il),e(ol),e(jl),e(Vs),e(yl),e(gl),e(Ms),e(Jl),e(hl),e(Qs)),e(a),f(U,s),f(R,s),f(_,s),f(Y,s),f(S,s),f(L,s),f(A,s),f(o,s),f(ys,s),f(Js,s),f(fs,s),f(Us,s),f(Ts,s),f(ls,s),f(as,s),f(ds,s),f($s,s),f(es,s),f(ts,s),f(_s,s),f(ns,s),f(ps,s),f(Ws,s),f(ks,s),f(cs,s),f(rs,s),f(Gs,s),f(xs,s)}}}const fa='{"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(W){return Hl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wa extends zl{constructor(a){super(),Sl(this,a,Ua,wa,El,{})}}export{Wa as component};
