import{s as Nl,o as Al,n as ss}from"../chunks/scheduler.56730f09.js";import{S as El,i as Hl,g as d,s as M,r as g,A as zl,h as b,f as e,c as i,j as Yl,u as y,x as C,k as hl,y as Sl,a as t,v as h,d as w,t as f,w as u,m as Ll,n as Dl}from"../chunks/index.1f144517.js";import{T as wl}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.b2e82107.js";import{F as is,M as os}from"../chunks/Markdown.c541024b.js";import{H as xs}from"../chunks/Heading.57d46534.js";function Pl(W){let a,o,l='<a href="../model_doc/beit">BEiT</a>, <a href="../model_doc/data2vec-vision">Data2VecVision</a>, <a href="../model_doc/dpt">DPT</a>, <a href="../model_doc/mobilenet_v2">MobileNetV2</a>, <a href="../model_doc/mobilevit">MobileViT</a>, <a href="../model_doc/mobilevitv2">MobileViTV2</a>, <a href="../model_doc/segformer">SegFormer</a>, <a href="../model_doc/upernet">UPerNet</a>';return{c(){a=Ll(`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에서 지원됩니다:

`),o=d("p"),o.innerHTML=l},l(c){a=Dl(c,`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에서 지원됩니다:

`),o=b(c,"P",{"data-svelte-h":!0}),C(o)!=="svelte-19l83ao"&&(o.innerHTML=l)},m(c,J){t(c,a,J),t(c,o,J)},p:ss,d(c){c&&(e(a),e(o))}}}function Ol(W){let a,o='이미지 데이터 세트에 데이터 증강을 적용하여 과적합에 대해 모델을 보다 강건하게 만드는 것이 일반적입니다. 이 가이드에서는 <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,c,J,$,R="이제 모델에 사용할 이미지와 주석을 준비하기 위해 두 개의 전처리 함수를 만듭니다. 이 함수들은 이미지를 <code>pixel_values</code>로, 주석을 <code>labels</code>로 변환합니다. 훈련 세트의 경우 이미지 프로세서에 이미지를 제공하기 전에 <code>jitter</code>를 적용합니다. 테스트 세트의 경우 이미지 프로세서는 <code>images</code>를 자르고 정규화하며, 테스트 중에는 데이터 증강이 적용되지 않으므로 <code>labels</code>만 자릅니다.",B,_,Z,I,Q="모든 데이터 세트에 <code>jitter</code>를 적용하려면, 🤗 Datasets <code>set_transform</code> 함수를 사용하세요. 즉시 변환이 적용되기 때문에 더 빠르고 디스크 공간을 덜 차지합니다:",v,U,V;return c=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}}),U=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=o,l=M(),g(c.$$.fragment),J=M(),$=d("p"),$.innerHTML=R,B=M(),g(_.$$.fragment),Z=M(),I=d("p"),I.innerHTML=Q,v=M(),g(U.$$.fragment)},l(m){a=b(m,"P",{"data-svelte-h":!0}),C(a)!=="svelte-wfjux"&&(a.innerHTML=o),l=i(m),y(c.$$.fragment,m),J=i(m),$=b(m,"P",{"data-svelte-h":!0}),C($)!=="svelte-nni9bw"&&($.innerHTML=R),B=i(m),y(_.$$.fragment,m),Z=i(m),I=b(m,"P",{"data-svelte-h":!0}),C(I)!=="svelte-co6957"&&(I.innerHTML=Q),v=i(m),y(U.$$.fragment,m)},m(m,T){t(m,a,T),t(m,l,T),h(c,m,T),t(m,J,T),t(m,$,T),t(m,B,T),h(_,m,T),t(m,Z,T),t(m,I,T),t(m,v,T),h(U,m,T),V=!0},p:ss,i(m){V||(w(c.$$.fragment,m),w(_.$$.fragment,m),w(U.$$.fragment,m),V=!0)},o(m){f(c.$$.fragment,m),f(_.$$.fragment,m),f(U.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(J),e($),e(B),e(Z),e(I),e(v)),u(c,m),u(_,m),u(U,m)}}}function sa(W){let a,o;return a=new os({props:{$$slots:{default:[Ol]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function la(W){let a,o='이미지 데이터 세트에 데이터 증강을 적용하여 과적합에 대해 모델을 보다 강건하게 만드는 것이 일반적입니다. 이 가이드에서는 <a href="https://www.tensorflow.org/api_docs/python/tf/image" rel="nofollow"><code>tf.image</code></a>를 사용하여 이미지의 색상 속성을 임의로 변경합니다. 하지만, 자신이 원하는 이미지 라이브러리를 사용할 수도 있습니다.',l,c,J="별개의 두 변환 함수를 정의합니다:",$,R,B="<li>이미지 증강을 포함하는 학습 데이터 변환</li> <li>🤗 Transformers의 컴퓨터 비전 모델은 채널 우선 레이아웃을 기대하기 때문에, 이미지만 바꾸는 검증 데이터 변환</li>",_,Z,I,Q,v="그런 다음 모델을 위해 두 개의 전처리 함수를 만들어 이미지 및 주석 배치를 준비합니다. 이 함수들은 이미지 변환을 적용하고 이전에 로드한 <code>image_processor</code>를 사용하여 이미지를 <code>pixel_values</code>로, 주석을 <code>label</code>로 변환합니다. <code>ImageProcessor</code> 는 이미지의 크기 조정과 정규화도 처리합니다.",U,V,m,T,Y=`전체 데이터 집합에 전처리 변환을 적용하려면 🤗 Datasets <code>set_transform</code> 함수를 사용하세요.
즉시 변환이 적용되기 때문에 더 빠르고 디스크 공간을 덜 차지합니다:`,G,X,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}}),X=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=o,l=M(),c=d("p"),c.textContent=J,$=M(),R=d("ul"),R.innerHTML=B,_=M(),g(Z.$$.fragment),I=M(),Q=d("p"),Q.innerHTML=v,U=M(),g(V.$$.fragment),m=M(),T=d("p"),T.innerHTML=Y,G=M(),g(X.$$.fragment)},l(r){a=b(r,"P",{"data-svelte-h":!0}),C(a)!=="svelte-r0uin4"&&(a.innerHTML=o),l=i(r),c=b(r,"P",{"data-svelte-h":!0}),C(c)!=="svelte-163wstu"&&(c.textContent=J),$=i(r),R=b(r,"UL",{"data-svelte-h":!0}),C(R)!=="svelte-5sercd"&&(R.innerHTML=B),_=i(r),y(Z.$$.fragment,r),I=i(r),Q=b(r,"P",{"data-svelte-h":!0}),C(Q)!=="svelte-1p58cmv"&&(Q.innerHTML=v),U=i(r),y(V.$$.fragment,r),m=i(r),T=b(r,"P",{"data-svelte-h":!0}),C(T)!=="svelte-1trxcly"&&(T.innerHTML=Y),G=i(r),y(X.$$.fragment,r)},m(r,F){t(r,a,F),t(r,l,F),t(r,c,F),t(r,$,F),t(r,R,F),t(r,_,F),h(Z,r,F),t(r,I,F),t(r,Q,F),t(r,U,F),h(V,r,F),t(r,m,F),t(r,T,F),t(r,G,F),h(X,r,F),p=!0},p:ss,i(r){p||(w(Z.$$.fragment,r),w(V.$$.fragment,r),w(X.$$.fragment,r),p=!0)},o(r){f(Z.$$.fragment,r),f(V.$$.fragment,r),f(X.$$.fragment,r),p=!1},d(r){r&&(e(a),e(l),e(c),e($),e(R),e(_),e(I),e(Q),e(U),e(m),e(T),e(G)),u(Z,r),u(V,r),u(X,r)}}}function aa(W){let a,o;return a=new os({props:{$$slots:{default:[la]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ea(W){let a,o;return a=new x({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2glMjBpbXBvcnQlMjBubiUwQSUwQWRlZiUyMGNvbXB1dGVfbWV0cmljcyhldmFsX3ByZWQpJTNBJTBBJTIwJTIwJTIwJTIwd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvZ2l0cyUyQyUyMGxhYmVscyUyMCUzRCUyMGV2YWxfcHJlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvZ2l0c190ZW5zb3IlMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KGxvZ2l0cyklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb2dpdHNfdGVuc29yJTIwJTNEJTIwbm4uZnVuY3Rpb25hbC5pbnRlcnBvbGF0ZSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb2dpdHNfdGVuc29yJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2l6ZSUzRGxhYmVscy5zaGFwZSU1Qi0yJTNBJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZSUzRCUyMmJpbGluZWFyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYWxpZ25fY29ybmVycyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKS5hcmdtYXgoZGltJTNEMSklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmVkX2xhYmVscyUyMCUzRCUyMGxvZ2l0c190ZW5zb3IuZGV0YWNoKCkuY3B1KCkubnVtcHkoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldHJpY3MlMjAlM0QlMjBtZXRyaWMuY29tcHV0ZSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUzRHByZWRfbGFiZWxzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVmZXJlbmNlcyUzRGxhYmVscyUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWdub3JlX2luZGV4JTNEMjU1JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVkdWNlX2xhYmVscyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZvciUyMGtleSUyQyUyMHZhbHVlJTIwaW4lMjBtZXRyaWNzLml0ZW1zKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpZiUyMHR5cGUodmFsdWUpJTIwaXMlMjBucC5uZGFycmF5JTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbWV0cmljcyU1QmtleSU1RCUyMCUzRCUyMHZhbHVlLnRvbGlzdCgpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwbWV0cmljcw==",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">type</span>(value) <span class="hljs-keyword">is</span> 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(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p:ss,i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ta(W){let a,o;return a=new os({props:{$$slots:{default:[ea]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function na(W){let a,o;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(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p:ss,i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function pa(W){let a,o;return a=new os({props:{$$slots:{default:[na]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ma(W){let a,o='만약 <code>Trainer</code>를 사용해 모델을 미세 조정하는 것에 익숙하지 않다면, <a href="../training#finetune-with-trainer">여기</a>에서 기본 튜토리얼을 살펴보세요!';return{c(){a=d("p"),a.innerHTML=o},l(l){a=b(l,"P",{"data-svelte-h":!0}),C(a)!=="svelte-3emgbb"&&(a.innerHTML=o)},m(l,c){t(l,a,c)},p:ss,d(l){l&&e(a)}}}function ca(W){let a,o,l,c="이제 모델 학습을 시작할 준비가 되었습니다! <code>AutoModelForSemanticSegmentation</code>로 SegFormer를 불러오고, 모델에 레이블 ID와 레이블 클래스 간의 매핑을 전달합니다:",J,$,R,B,_="이제 세 단계만 남았습니다:",Z,I,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,U,V,m,T="학습이 완료되면, 누구나 모델을 사용할 수 있도록 <code>push_to_hub()</code> 메서드를 사용해 Hub에 모델을 공유하세요:",Y,G,X;return a=new wl({props:{$$slots:{default:[ma]},$$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}}),U=new x({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJzZWdmb3JtZXItYjAtc2NlbmUtcGFyc2UtMTUwJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDZlLTUlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0QyJTJDJTBBJTIwJTIwJTIwJTIwc2F2ZV90b3RhbF9saW1pdCUzRDMlMkMlMEElMjAlMjAlMjAlMjBldmFsdWF0aW9uX3N0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfYWNjdW11bGF0aW9uX3N0ZXBzJTNENSUyQyUwQSUyMCUyMCUyMCUyMHJlbW92ZV91bnVzZWRfY29sdW1ucyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0cmFpbl9kcyUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHRlc3RfZHMlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",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>    evaluation_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(){g(a.$$.fragment),o=M(),l=d("p"),l.innerHTML=c,J=M(),g($.$$.fragment),R=M(),B=d("p"),B.textContent=_,Z=M(),I=d("ol"),I.innerHTML=Q,v=M(),g(U.$$.fragment),V=M(),m=d("p"),m.innerHTML=T,Y=M(),g(G.$$.fragment)},l(p){y(a.$$.fragment,p),o=i(p),l=b(p,"P",{"data-svelte-h":!0}),C(l)!=="svelte-1j8jvu6"&&(l.innerHTML=c),J=i(p),y($.$$.fragment,p),R=i(p),B=b(p,"P",{"data-svelte-h":!0}),C(B)!=="svelte-1vwg7jz"&&(B.textContent=_),Z=i(p),I=b(p,"OL",{"data-svelte-h":!0}),C(I)!=="svelte-ds64a5"&&(I.innerHTML=Q),v=i(p),y(U.$$.fragment,p),V=i(p),m=b(p,"P",{"data-svelte-h":!0}),C(m)!=="svelte-sq2z1z"&&(m.innerHTML=T),Y=i(p),y(G.$$.fragment,p)},m(p,r){h(a,p,r),t(p,o,r),t(p,l,r),t(p,J,r),h($,p,r),t(p,R,r),t(p,B,r),t(p,Z,r),t(p,I,r),t(p,v,r),h(U,p,r),t(p,V,r),t(p,m,r),t(p,Y,r),h(G,p,r),X=!0},p(p,r){const F={};r&2&&(F.$$scope={dirty:r,ctx:p}),a.$set(F)},i(p){X||(w(a.$$.fragment,p),w($.$$.fragment,p),w(U.$$.fragment,p),w(G.$$.fragment,p),X=!0)},o(p){f(a.$$.fragment,p),f($.$$.fragment,p),f(U.$$.fragment,p),f(G.$$.fragment,p),X=!1},d(p){p&&(e(o),e(l),e(J),e(R),e(B),e(Z),e(I),e(v),e(V),e(m),e(Y)),u(a,p),u($,p),u(U,p),u(G,p)}}}function ra(W){let a,o;return a=new os({props:{$$slots:{default:[ca]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function Ma(W){let a,o='Keras로 모델을 미세 조정하는 데 익숙하지 않은 경우, 먼저 <a href="../training#train-a-tensorflow-model-with-keras">기본 튜토리얼</a>을 확인해보세요!';return{c(){a=d("p"),a.innerHTML=o},l(l){a=b(l,"P",{"data-svelte-h":!0}),C(a)!=="svelte-u4hk9"&&(a.innerHTML=o)},m(l,c){t(l,a,c)},p:ss,d(l){l&&e(a)}}}function ia(W){let a,o,l,c="TensorFlow에서 모델을 미세 조정하려면 다음 단계를 따르세요:",J,$,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="하이퍼파라미터, 옵티마이저, 학습률 스케쥴러를 정의하는 것으로 시작하세요:",I,Q,v,U,V="그런 다음 레이블 매핑과 함께 <code>TFAutoModelForSemanticSegmentation</code>을 사용하여 SegFormer를 불러오고 옵티마이저로 컴파일합니다. 트랜스포머 모델은 모두 디폴트로 태스크 관련 손실 함수가 있으므로 원치 않으면 지정할 필요가 없습니다:",m,T,Y,G,X="<code>to_tf_dataset</code> 와 <code>DefaultDataCollator</code>를 사용해 데이터 세트를 <code>tf.data.Dataset</code> 포맷으로 변환하세요:",p,r,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,Rs="축하합니다! 모델을 미세 조정하고 🤗 Hub에 공유했습니다. 이제 추론에 사용할 수 있습니다!",O;return a=new wl({props:{$$slots:{default:[Ma]},$$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}}),T=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(){g(a.$$.fragment),o=M(),l=d("p"),l.textContent=c,J=M(),$=d("ol"),$.innerHTML=R,B=M(),_=d("p"),_.textContent=Z,I=M(),g(Q.$$.fragment),v=M(),U=d("p"),U.innerHTML=V,m=M(),g(T.$$.fragment),Y=M(),G=d("p"),G.innerHTML=X,p=M(),g(r.$$.fragment),F=M(),H=d("p"),H.innerHTML=S,q=M(),g(N.$$.fragment),js=M(),z=d("p"),z.innerHTML=L,K=M(),g(A.$$.fragment),P=M(),E=d("p"),E.textContent=Rs},l(j){y(a.$$.fragment,j),o=i(j),l=b(j,"P",{"data-svelte-h":!0}),C(l)!=="svelte-um2evk"&&(l.textContent=c),J=i(j),$=b(j,"OL",{"data-svelte-h":!0}),C($)!=="svelte-173h0e5"&&($.innerHTML=R),B=i(j),_=b(j,"P",{"data-svelte-h":!0}),C(_)!=="svelte-wcragq"&&(_.textContent=Z),I=i(j),y(Q.$$.fragment,j),v=i(j),U=b(j,"P",{"data-svelte-h":!0}),C(U)!=="svelte-nqumm8"&&(U.innerHTML=V),m=i(j),y(T.$$.fragment,j),Y=i(j),G=b(j,"P",{"data-svelte-h":!0}),C(G)!=="svelte-1qohu6b"&&(G.innerHTML=X),p=i(j),y(r.$$.fragment,j),F=i(j),H=b(j,"P",{"data-svelte-h":!0}),C(H)!=="svelte-1piamfe"&&(H.innerHTML=S),q=i(j),y(N.$$.fragment,j),js=i(j),z=b(j,"P",{"data-svelte-h":!0}),C(z)!=="svelte-1ud4ghv"&&(z.innerHTML=L),K=i(j),y(A.$$.fragment,j),P=i(j),E=b(j,"P",{"data-svelte-h":!0}),C(E)!=="svelte-1trgvwr"&&(E.textContent=Rs)},m(j,k){h(a,j,k),t(j,o,k),t(j,l,k),t(j,J,k),t(j,$,k),t(j,B,k),t(j,_,k),t(j,I,k),h(Q,j,k),t(j,v,k),t(j,U,k),t(j,m,k),h(T,j,k),t(j,Y,k),t(j,G,k),t(j,p,k),h(r,j,k),t(j,F,k),t(j,H,k),t(j,q,k),h(N,j,k),t(j,js,k),t(j,z,k),t(j,K,k),h(A,j,k),t(j,P,k),t(j,E,k),O=!0},p(j,k){const D={};k&2&&(D.$$scope={dirty:k,ctx:j}),a.$set(D)},i(j){O||(w(a.$$.fragment,j),w(Q.$$.fragment,j),w(T.$$.fragment,j),w(r.$$.fragment,j),w(N.$$.fragment,j),w(A.$$.fragment,j),O=!0)},o(j){f(a.$$.fragment,j),f(Q.$$.fragment,j),f(T.$$.fragment,j),f(r.$$.fragment,j),f(N.$$.fragment,j),f(A.$$.fragment,j),O=!1},d(j){j&&(e(o),e(l),e(J),e($),e(B),e(_),e(I),e(v),e(U),e(m),e(Y),e(G),e(p),e(F),e(H),e(q),e(js),e(z),e(K),e(P),e(E)),u(a,j),u(Q,j),u(T,j),u(r,j),u(N,j),u(A,j)}}}function oa(W){let a,o;return a=new os({props:{$$slots:{default:[ia]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ja(W){let a,o="추론을 위해 미세 조정한 모델을 시험해 보는 가장 간단한 방법은 <code>pipeline()</code>에서 사용하는 것입니다. 모델을 사용하여 이미지 분할을 위한 <code>pipeline</code>을 인스턴스화하고 이미지를 전달합니다:",l,c,J,$,R="원하는 경우 <code>pipeline</code>의 결과를 수동으로 복제할 수도 있습니다. 이미지 프로세서로 이미지를 처리하고 <code>pixel_values</code>을 GPU에 배치합니다:",B,_,Z,I,Q="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",v,U,V,m,T="그런 다음 로짓의 크기를 원본 이미지 크기로 다시 조정합니다:",Y,G,X;return c=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}}),U=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=o,l=M(),g(c.$$.fragment),J=M(),$=d("p"),$.innerHTML=R,B=M(),g(_.$$.fragment),Z=M(),I=d("p"),I.innerHTML=Q,v=M(),g(U.$$.fragment),V=M(),m=d("p"),m.textContent=T,Y=M(),g(G.$$.fragment)},l(p){a=b(p,"P",{"data-svelte-h":!0}),C(a)!=="svelte-v6d888"&&(a.innerHTML=o),l=i(p),y(c.$$.fragment,p),J=i(p),$=b(p,"P",{"data-svelte-h":!0}),C($)!=="svelte-112n7y6"&&($.innerHTML=R),B=i(p),y(_.$$.fragment,p),Z=i(p),I=b(p,"P",{"data-svelte-h":!0}),C(I)!=="svelte-t69k4k"&&(I.innerHTML=Q),v=i(p),y(U.$$.fragment,p),V=i(p),m=b(p,"P",{"data-svelte-h":!0}),C(m)!=="svelte-18ee243"&&(m.textContent=T),Y=i(p),y(G.$$.fragment,p)},m(p,r){t(p,a,r),t(p,l,r),h(c,p,r),t(p,J,r),t(p,$,r),t(p,B,r),h(_,p,r),t(p,Z,r),t(p,I,r),t(p,v,r),h(U,p,r),t(p,V,r),t(p,m,r),t(p,Y,r),h(G,p,r),X=!0},p:ss,i(p){X||(w(c.$$.fragment,p),w(_.$$.fragment,p),w(U.$$.fragment,p),w(G.$$.fragment,p),X=!0)},o(p){f(c.$$.fragment,p),f(_.$$.fragment,p),f(U.$$.fragment,p),f(G.$$.fragment,p),X=!1},d(p){p&&(e(a),e(l),e(J),e($),e(B),e(Z),e(I),e(v),e(V),e(m),e(Y)),u(c,p),u(_,p),u(U,p),u(G,p)}}}function Ja(W){let a,o;return a=new os({props:{$$slots:{default:[ja]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ga(W){let a,o="이미지 프로세서를 로드하여 이미지를 전처리하고 입력을 TensorFlow 텐서로 반환합니다:",l,c,J,$,R="모델에 입력을 전달하고 <code>logits</code>를 반환합니다:",B,_,Z,I,Q="그런 다음 로그를 원본 이미지 크기로 재조정하고 클래스 차원에 argmax를 적용합니다:",v,U,V;return c=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}}),U=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=o,l=M(),g(c.$$.fragment),J=M(),$=d("p"),$.innerHTML=R,B=M(),g(_.$$.fragment),Z=M(),I=d("p"),I.textContent=Q,v=M(),g(U.$$.fragment)},l(m){a=b(m,"P",{"data-svelte-h":!0}),C(a)!=="svelte-k2y3aq"&&(a.textContent=o),l=i(m),y(c.$$.fragment,m),J=i(m),$=b(m,"P",{"data-svelte-h":!0}),C($)!=="svelte-t69k4k"&&($.innerHTML=R),B=i(m),y(_.$$.fragment,m),Z=i(m),I=b(m,"P",{"data-svelte-h":!0}),C(I)!=="svelte-1dmtoj2"&&(I.textContent=Q),v=i(m),y(U.$$.fragment,m)},m(m,T){t(m,a,T),t(m,l,T),h(c,m,T),t(m,J,T),t(m,$,T),t(m,B,T),h(_,m,T),t(m,Z,T),t(m,I,T),t(m,v,T),h(U,m,T),V=!0},p:ss,i(m){V||(w(c.$$.fragment,m),w(_.$$.fragment,m),w(U.$$.fragment,m),V=!0)},o(m){f(c.$$.fragment,m),f(_.$$.fragment,m),f(U.$$.fragment,m),V=!1},d(m){m&&(e(a),e(l),e(J),e($),e(B),e(Z),e(I),e(v)),u(c,m),u(_,m),u(U,m)}}}function ya(W){let a,o;return a=new os({props:{$$slots:{default:[ga]},$$scope:{ctx:W}}}),{c(){g(a.$$.fragment)},l(l){y(a.$$.fragment,l)},m(l,c){h(a,l,c),o=!0},p(l,c){const J={};c&2&&(J.$$scope={dirty:c,ctx:l}),a.$set(J)},i(l){o||(w(a.$$.fragment,l),o=!0)},o(l){f(a.$$.fragment,l),o=!1},d(l){u(a,l)}}}function ha(W){let a,o,l,c,J,$,R,B,_,Z,I,Q=`의미적 분할(semantic segmentation)은 이미지의 각 픽셀에 레이블 또는 클래스를 할당합니다. 분할(segmentation)에는 여러 종류가 있으며, 의미적 분할의 경우 동일한 물체의 고유 인스턴스를 구분하지 않습니다. 두 물체 모두 동일한 레이블이 지정됩니다(예시로, “car-1” 과 “car-2” 대신 “car”로 지정합니다).
실생활에서 흔히 볼 수 있는 의미적 분할의 적용 사례로는 보행자와 중요한 교통 정보를 식별하는 자율 주행 자동차 학습, 의료 이미지의 세포와 이상 징후 식별, 그리고 위성 이미지의 환경 변화 모니터링등이 있습니다.`,v,U,V="이번 가이드에서 배울 내용은 다음과 같습니다:",m,T,Y='<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,X,p,r,F="시작하기 전에 필요한 모든 라이브러리가 설치되었는지 확인하세요:",H,S,q,N,js="커뮤니티에 모델을 업로드하고 공유할 수 있도록 Hugging Face 계정에 로그인하는 것을 권장합니다. 프롬프트가 나타나면 토큰을 입력하여 로그인하세요:",z,L,K,A,P,E,Rs="🤗 Datasets 라이브러리에서 SceneParse150 데이터 세트의 더 작은 부분 집합을 가져오는 것으로 시작합니다. 이렇게 하면 데이터 세트 전체에 대한 훈련에 많은 시간을 할애하기 전에 실험을 통해 모든 것이 제대로 작동하는지 확인할 수 있습니다.",O,j,k,D,fl="데이터 세트의 <code>train</code>을 <code>train_test_split</code> 메소드를 사용하여 훈련 및 테스트 세트로 분할하세요:",Qs,Js,Xs,gs,ul="그리고 예시를 살펴보세요:",Fs,ys,Ys,hs,Tl="<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>",Ns,ws,Ul="나중에 모델을 설정할 때 유용하게 사용할 수 있도록 레이블 ID를 레이블 클래스에 매핑하는 사전도 만들고 싶을 것입니다. Hub에서 매핑을 다운로드하고 <code>id2label</code> 및 <code>label2id</code> 사전을 만드세요:",As,fs,Es,us,Hs,Ts,dl="다음 단계는 모델에 사용할 이미지와 주석을 준비하기 위해 SegFormer 이미지 프로세서를 불러오는 것입니다. 우리가 사용하는 데이터 세트와 같은 일부 데이터 세트는 배경 클래스로 제로 인덱스를 사용합니다. 하지만 배경 클래스는 150개의 클래스에 실제로는 포함되지 않기 때문에 <code>reduce_labels=True</code> 를 설정해 모든 레이블에서 배경 클래스를 제거해야 합니다. 제로 인덱스는 <code>255</code>로 대체되므로 SegFormer의 손실 함수에서 무시됩니다:",zs,Us,Ss,ls,Ls,as,Ds,ds,qs,bs,bl='훈련 중에 메트릭을 포함하면 모델의 성능을 평가하는 데 도움이 되는 경우가 많습니다. 🤗 <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>를 살펴보세요).',Ks,$s,Ps,Is,$l="그런 다음 메트릭을 <code>compute</code>하는 함수를 만듭니다. 예측을 먼저 로짓으로 변환한 다음, 레이블의 크기에 맞게 모양을 다시 지정해야 <code>compute</code>를 호출할 수 있습니다:",Os,es,sl,ts,ll,Cs,Il="이제 <code>compute_metrics</code> 함수를 사용할 준비가 되었습니다. 트레이닝을 설정할 때 이 함수로 돌아가게 됩니다.",al,_s,el,ns,tl,ps,nl,Ws,pl,Bs,Cl="이제 모델을 미세 조정했으니 추론에 사용할 수 있습니다!",ml,Zs,_l="추론할 이미지를 로드하세요:",cl,ks,rl,ms,Wl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/semantic-seg-image.png" alt="Image of bedroom"/>',Ml,cs,il,rs,ol,Vs,Bl='결과를 시각화하려면 <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)을 결합하여 구성할 수 있습니다:',jl,Gs,Jl,Ms,Zl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/semantic-seg-preds.png" alt="Image of bedroom overlaid with segmentation map"/>',gl,vs,yl;return J=new xs({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"}}),X=new wl({props:{$$slots:{default:[Pl]},$$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 xs({props:{title:"SceneParse150 데이터 세트 불러오기",local:"load-sceneparse150-dataset",headingTag:"h2"}}),j=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}}),Js=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}}),ys=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:"aW1wb3J0JTIwanNvbiUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBjYWNoZWRfZG93bmxvYWQlMkMlMjBoZl9odWJfdXJsJTBBJTBBcmVwb19pZCUyMCUzRCUyMCUyMmh1Z2dpbmdmYWNlJTJGbGFiZWwtZmlsZXMlMjIlMEFmaWxlbmFtZSUyMCUzRCUyMCUyMmFkZTIway1pZDJsYWJlbC5qc29uJTIyJTBBaWQybGFiZWwlMjAlM0QlMjBqc29uLmxvYWQob3BlbihjYWNoZWRfZG93bmxvYWQoaGZfaHViX3VybChyZXBvX2lkJTJDJTIwZmlsZW5hbWUlMkMlMjByZXBvX3R5cGUlM0QlMjJkYXRhc2V0JTIyKSklMkMlMjAlMjJyJTIyKSklMEFpZDJsYWJlbCUyMCUzRCUyMCU3QmludChrKSUzQSUyMHYlMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwaWQybGFiZWwuaXRlbXMoKSU3RCUwQWxhYmVsMmlkJTIwJTNEJTIwJTdCdiUzQSUyMGslMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwaWQybGFiZWwuaXRlbXMoKSU3RCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4oaWQybGFiZWwp",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> huggingface_hub <span class="hljs-keyword">import</span> cached_download, hf_hub_url

<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.load(<span class="hljs-built_in">open</span>(cached_download(hf_hub_url(repo_id, filename, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)), <span class="hljs-string">&quot;r&quot;</span>))
<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 xs({props:{title:"전처리하기[ preprocess",local:"전처리하기-preprocess",headingTag:"h2"}}),Us=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJudmlkaWElMkZtaXQtYjAlMjIlMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQlMkMlMjByZWR1Y2VfbGFiZWxzJTNEVHJ1ZSk=",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, reduce_labels=<span class="hljs-literal">True</span>)`,wrap:!1}}),ls=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[sa]},$$scope:{ctx:W}}}),as=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[aa]},$$scope:{ctx:W}}}),ds=new xs({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:[ta]},$$scope:{ctx:W}}}),ts=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[pa]},$$scope:{ctx:W}}}),_s=new xs({props:{title:"학습하기",local:"train",headingTag:"h2"}}),ns=new is({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[ra]},$$scope:{ctx:W}}}),ps=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[oa]},$$scope:{ctx:W}}}),Ws=new xs({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:[Ja]},$$scope:{ctx:W}}}),rs=new is({props:{pytorch:!1,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ya]},$$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}}),{c(){a=d("meta"),o=M(),l=d("p"),c=M(),g(J.$$.fragment),$=M(),g(R.$$.fragment),B=M(),g(_.$$.fragment),Z=M(),I=d("p"),I.textContent=Q,v=M(),U=d("p"),U.textContent=V,m=M(),T=d("ol"),T.innerHTML=Y,G=M(),g(X.$$.fragment),p=M(),r=d("p"),r.textContent=F,H=M(),g(S.$$.fragment),q=M(),N=d("p"),N.textContent=js,z=M(),g(L.$$.fragment),K=M(),g(A.$$.fragment),P=M(),E=d("p"),E.textContent=Rs,O=M(),g(j.$$.fragment),k=M(),D=d("p"),D.innerHTML=fl,Qs=M(),g(Js.$$.fragment),Xs=M(),gs=d("p"),gs.textContent=ul,Fs=M(),g(ys.$$.fragment),Ys=M(),hs=d("ul"),hs.innerHTML=Tl,Ns=M(),ws=d("p"),ws.innerHTML=Ul,As=M(),g(fs.$$.fragment),Es=M(),g(us.$$.fragment),Hs=M(),Ts=d("p"),Ts.innerHTML=dl,zs=M(),g(Us.$$.fragment),Ss=M(),g(ls.$$.fragment),Ls=M(),g(as.$$.fragment),Ds=M(),g(ds.$$.fragment),qs=M(),bs=d("p"),bs.innerHTML=bl,Ks=M(),g($s.$$.fragment),Ps=M(),Is=d("p"),Is.innerHTML=$l,Os=M(),g(es.$$.fragment),sl=M(),g(ts.$$.fragment),ll=M(),Cs=d("p"),Cs.innerHTML=Il,al=M(),g(_s.$$.fragment),el=M(),g(ns.$$.fragment),tl=M(),g(ps.$$.fragment),nl=M(),g(Ws.$$.fragment),pl=M(),Bs=d("p"),Bs.textContent=Cl,ml=M(),Zs=d("p"),Zs.textContent=_l,cl=M(),g(ks.$$.fragment),rl=M(),ms=d("div"),ms.innerHTML=Wl,Ml=M(),g(cs.$$.fragment),il=M(),g(rs.$$.fragment),ol=M(),Vs=d("p"),Vs.innerHTML=Bl,jl=M(),g(Gs.$$.fragment),Jl=M(),Ms=d("div"),Ms.innerHTML=Zl,gl=M(),vs=d("p"),this.h()},l(s){const n=zl("svelte-u9bgzb",document.head);a=b(n,"META",{name:!0,content:!0}),n.forEach(e),o=i(s),l=b(s,"P",{}),Yl(l).forEach(e),c=i(s),y(J.$$.fragment,s),$=i(s),y(R.$$.fragment,s),B=i(s),y(_.$$.fragment,s),Z=i(s),I=b(s,"P",{"data-svelte-h":!0}),C(I)!=="svelte-1pm3sh7"&&(I.textContent=Q),v=i(s),U=b(s,"P",{"data-svelte-h":!0}),C(U)!=="svelte-pdyjx9"&&(U.textContent=V),m=i(s),T=b(s,"OL",{"data-svelte-h":!0}),C(T)!=="svelte-1r6ennb"&&(T.innerHTML=Y),G=i(s),y(X.$$.fragment,s),p=i(s),r=b(s,"P",{"data-svelte-h":!0}),C(r)!=="svelte-1aeak3y"&&(r.textContent=F),H=i(s),y(S.$$.fragment,s),q=i(s),N=b(s,"P",{"data-svelte-h":!0}),C(N)!=="svelte-1ylwhj7"&&(N.textContent=js),z=i(s),y(L.$$.fragment,s),K=i(s),y(A.$$.fragment,s),P=i(s),E=b(s,"P",{"data-svelte-h":!0}),C(E)!=="svelte-zqz01o"&&(E.textContent=Rs),O=i(s),y(j.$$.fragment,s),k=i(s),D=b(s,"P",{"data-svelte-h":!0}),C(D)!=="svelte-1amyql0"&&(D.innerHTML=fl),Qs=i(s),y(Js.$$.fragment,s),Xs=i(s),gs=b(s,"P",{"data-svelte-h":!0}),C(gs)!=="svelte-1rb3v2y"&&(gs.textContent=ul),Fs=i(s),y(ys.$$.fragment,s),Ys=i(s),hs=b(s,"UL",{"data-svelte-h":!0}),C(hs)!=="svelte-9pyc0a"&&(hs.innerHTML=Tl),Ns=i(s),ws=b(s,"P",{"data-svelte-h":!0}),C(ws)!=="svelte-1s2rnds"&&(ws.innerHTML=Ul),As=i(s),y(fs.$$.fragment,s),Es=i(s),y(us.$$.fragment,s),Hs=i(s),Ts=b(s,"P",{"data-svelte-h":!0}),C(Ts)!=="svelte-1aa89j5"&&(Ts.innerHTML=dl),zs=i(s),y(Us.$$.fragment,s),Ss=i(s),y(ls.$$.fragment,s),Ls=i(s),y(as.$$.fragment,s),Ds=i(s),y(ds.$$.fragment,s),qs=i(s),bs=b(s,"P",{"data-svelte-h":!0}),C(bs)!=="svelte-1am5yvm"&&(bs.innerHTML=bl),Ks=i(s),y($s.$$.fragment,s),Ps=i(s),Is=b(s,"P",{"data-svelte-h":!0}),C(Is)!=="svelte-1kp3i6f"&&(Is.innerHTML=$l),Os=i(s),y(es.$$.fragment,s),sl=i(s),y(ts.$$.fragment,s),ll=i(s),Cs=b(s,"P",{"data-svelte-h":!0}),C(Cs)!=="svelte-100s3bb"&&(Cs.innerHTML=Il),al=i(s),y(_s.$$.fragment,s),el=i(s),y(ns.$$.fragment,s),tl=i(s),y(ps.$$.fragment,s),nl=i(s),y(Ws.$$.fragment,s),pl=i(s),Bs=b(s,"P",{"data-svelte-h":!0}),C(Bs)!=="svelte-174wmmm"&&(Bs.textContent=Cl),ml=i(s),Zs=b(s,"P",{"data-svelte-h":!0}),C(Zs)!=="svelte-y0x66m"&&(Zs.textContent=_l),cl=i(s),y(ks.$$.fragment,s),rl=i(s),ms=b(s,"DIV",{class:!0,"data-svelte-h":!0}),C(ms)!=="svelte-11jfm1f"&&(ms.innerHTML=Wl),Ml=i(s),y(cs.$$.fragment,s),il=i(s),y(rs.$$.fragment,s),ol=i(s),Vs=b(s,"P",{"data-svelte-h":!0}),C(Vs)!=="svelte-1adsal6"&&(Vs.innerHTML=Bl),jl=i(s),y(Gs.$$.fragment,s),Jl=i(s),Ms=b(s,"DIV",{class:!0,"data-svelte-h":!0}),C(Ms)!=="svelte-nsecok"&&(Ms.innerHTML=Zl),gl=i(s),vs=b(s,"P",{}),Yl(vs).forEach(e),this.h()},h(){hl(a,"name","hf:doc:metadata"),hl(a,"content",wa),hl(ms,"class","flex justify-center"),hl(Ms,"class","flex justify-center")},m(s,n){Sl(document.head,a),t(s,o,n),t(s,l,n),t(s,c,n),h(J,s,n),t(s,$,n),h(R,s,n),t(s,B,n),h(_,s,n),t(s,Z,n),t(s,I,n),t(s,v,n),t(s,U,n),t(s,m,n),t(s,T,n),t(s,G,n),h(X,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(j,s,n),t(s,k,n),t(s,D,n),t(s,Qs,n),h(Js,s,n),t(s,Xs,n),t(s,gs,n),t(s,Fs,n),h(ys,s,n),t(s,Ys,n),t(s,hs,n),t(s,Ns,n),t(s,ws,n),t(s,As,n),h(fs,s,n),t(s,Es,n),h(us,s,n),t(s,Hs,n),t(s,Ts,n),t(s,zs,n),h(Us,s,n),t(s,Ss,n),h(ls,s,n),t(s,Ls,n),h(as,s,n),t(s,Ds,n),h(ds,s,n),t(s,qs,n),t(s,bs,n),t(s,Ks,n),h($s,s,n),t(s,Ps,n),t(s,Is,n),t(s,Os,n),h(es,s,n),t(s,sl,n),h(ts,s,n),t(s,ll,n),t(s,Cs,n),t(s,al,n),h(_s,s,n),t(s,el,n),h(ns,s,n),t(s,tl,n),h(ps,s,n),t(s,nl,n),h(Ws,s,n),t(s,pl,n),t(s,Bs,n),t(s,ml,n),t(s,Zs,n),t(s,cl,n),h(ks,s,n),t(s,rl,n),t(s,ms,n),t(s,Ml,n),h(cs,s,n),t(s,il,n),h(rs,s,n),t(s,ol,n),t(s,Vs,n),t(s,jl,n),h(Gs,s,n),t(s,Jl,n),t(s,Ms,n),t(s,gl,n),t(s,vs,n),yl=!0},p(s,[n]){const kl={};n&2&&(kl.$$scope={dirty:n,ctx:s}),X.$set(kl);const Vl={};n&2&&(Vl.$$scope={dirty:n,ctx:s}),ls.$set(Vl);const Gl={};n&2&&(Gl.$$scope={dirty:n,ctx:s}),as.$set(Gl);const xl={};n&2&&(xl.$$scope={dirty:n,ctx:s}),es.$set(xl);const Rl={};n&2&&(Rl.$$scope={dirty:n,ctx:s}),ts.$set(Rl);const vl={};n&2&&(vl.$$scope={dirty:n,ctx:s}),ns.$set(vl);const Ql={};n&2&&(Ql.$$scope={dirty:n,ctx:s}),ps.$set(Ql);const Xl={};n&2&&(Xl.$$scope={dirty:n,ctx:s}),cs.$set(Xl);const Fl={};n&2&&(Fl.$$scope={dirty:n,ctx:s}),rs.$set(Fl)},i(s){yl||(w(J.$$.fragment,s),w(R.$$.fragment,s),w(_.$$.fragment,s),w(X.$$.fragment,s),w(S.$$.fragment,s),w(L.$$.fragment,s),w(A.$$.fragment,s),w(j.$$.fragment,s),w(Js.$$.fragment,s),w(ys.$$.fragment,s),w(fs.$$.fragment,s),w(us.$$.fragment,s),w(Us.$$.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),yl=!0)},o(s){f(J.$$.fragment,s),f(R.$$.fragment,s),f(_.$$.fragment,s),f(X.$$.fragment,s),f(S.$$.fragment,s),f(L.$$.fragment,s),f(A.$$.fragment,s),f(j.$$.fragment,s),f(Js.$$.fragment,s),f(ys.$$.fragment,s),f(fs.$$.fragment,s),f(us.$$.fragment,s),f(Us.$$.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(Ws.$$.fragment,s),f(ks.$$.fragment,s),f(cs.$$.fragment,s),f(rs.$$.fragment,s),f(Gs.$$.fragment,s),yl=!1},d(s){s&&(e(o),e(l),e(c),e($),e(B),e(Z),e(I),e(v),e(U),e(m),e(T),e(G),e(p),e(r),e(H),e(q),e(N),e(z),e(K),e(P),e(E),e(O),e(k),e(D),e(Qs),e(Xs),e(gs),e(Fs),e(Ys),e(hs),e(Ns),e(ws),e(As),e(Es),e(Hs),e(Ts),e(zs),e(Ss),e(Ls),e(Ds),e(qs),e(bs),e(Ks),e(Ps),e(Is),e(Os),e(sl),e(ll),e(Cs),e(al),e(el),e(tl),e(nl),e(pl),e(Bs),e(ml),e(Zs),e(cl),e(rl),e(ms),e(Ml),e(il),e(ol),e(Vs),e(jl),e(Jl),e(Ms),e(gl),e(vs)),e(a),u(J,s),u(R,s),u(_,s),u(X,s),u(S,s),u(L,s),u(A,s),u(j,s),u(Js,s),u(ys,s),u(fs,s),u(us,s),u(Us,s),u(ls,s),u(as,s),u(ds,s),u($s,s),u(es,s),u(ts,s),u(_s,s),u(ns,s),u(ps,s),u(Ws,s),u(ks,s),u(cs,s),u(rs,s),u(Gs,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 fa(W){return Al(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _a extends El{constructor(a){super(),Hl(this,a,fa,ha,Nl,{})}}export{_a as component};
