import{s as $t,o as Ct,n as Se}from"../chunks/scheduler.25b97de1.js";import{S as xt,i as zt,g as d,s as a,r as g,A as Zt,h as p,f as o,c as r,j as z,u as h,x as T,k as Z,y as m,a as i,v as f,d as u,t as _,w as b}from"../chunks/index.d9030fc9.js";import{T as Ut}from"../chunks/Tip.baa67368.js";import{D as H}from"../chunks/Docstring.e257edda.js";import{C as Ee}from"../chunks/CodeBlock.e6cd0d95.js";import{E as dt}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as Je,E as Wt}from"../chunks/EditOnGithub.91d95064.js";function jt(M){let n,w="Example:",l,c,y;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlZ0dwdENvbmZpZyUyQyUyMFNlZ0dwdE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFNlZ0dQVCUyMHNlZ2dwdC12aXQtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwU2VnR3B0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyMHNlZ2dwdC12aXQtbGFyZ2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMFNlZ0dwdE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegGptConfig, SegGptModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a SegGPT seggpt-vit-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = SegGptConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the seggpt-vit-large style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegGptModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){n=d("p"),n.textContent=w,l=a(),g(c.$$.fragment)},l(s){n=p(s,"P",{"data-svelte-h":!0}),T(n)!=="svelte-11lpom8"&&(n.textContent=w),l=r(s),h(c.$$.fragment,s)},m(s,v){i(s,n,v),i(s,l,v),f(c,s,v),y=!0},p:Se,i(s){y||(u(c.$$.fragment,s),y=!0)},o(s){_(c.$$.fragment,s),y=!1},d(s){s&&(o(n),o(l)),b(c,s)}}}function kt(M){let n,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=w},l(l){n=p(l,"P",{"data-svelte-h":!0}),T(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(l,c){i(l,n,c)},p:Se,d(l){l&&o(n)}}}function Vt(M){let n,w="Examples:",l,c,y;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlZ0dwdEltYWdlUHJvY2Vzc29yJTJDJTIwU2VnR3B0TW9kZWwlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQWltYWdlX2lucHV0X3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRmJhYWl2aXNpb24lMkZQYWludGVyJTJGbWFpbiUyRlNlZ0dQVCUyRlNlZ0dQVF9pbmZlcmVuY2UlMkZleGFtcGxlcyUyRmhtYmJfMi5qcGclMjIlMEFpbWFnZV9wcm9tcHRfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGYmFhaXZpc2lvbiUyRlBhaW50ZXIlMkZtYWluJTJGU2VnR1BUJTJGU2VnR1BUX2luZmVyZW5jZSUyRmV4YW1wbGVzJTJGaG1iYl8xLmpwZyUyMiUwQW1hc2tfcHJvbXB0X3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRmJhYWl2aXNpb24lMkZQYWludGVyJTJGbWFpbiUyRlNlZ0dQVCUyRlNlZ0dQVF9pbmZlcmVuY2UlMkZleGFtcGxlcyUyRmhtYmJfMV90YXJnZXQucG5nJTIyJTBBJTBBaW1hZ2VfaW5wdXQlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldChpbWFnZV9pbnB1dF91cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW1hZ2VfcHJvbXB0JTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQoaW1hZ2VfcHJvbXB0X3VybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFtYXNrX3Byb21wdCUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KG1hc2tfcHJvbXB0X3VybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdykuY29udmVydCglMjJMJTIyKSUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJCQUFJJTJGc2VnZ3B0LXZpdC1sYXJnZSUyMiUwQW1vZGVsJTIwJTNEJTIwU2VnR3B0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwU2VnR3B0SW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlX2lucHV0JTJDJTIwcHJvbXB0X2ltYWdlcyUzRGltYWdlX3Byb21wdCUyQyUyMHByb21wdF9tYXNrcyUzRG1hc2tfcHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGlzdChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegGptImageProcessor, SegGptModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>image_input_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_2.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_prompt_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_1.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_1_target.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>image_input = Image.<span class="hljs-built_in">open</span>(requests.get(image_input_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_prompt = Image.<span class="hljs-built_in">open</span>(requests.get(image_prompt_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt = Image.<span class="hljs-built_in">open</span>(requests.get(mask_prompt_url, stream=<span class="hljs-literal">True</span>).raw).convert(<span class="hljs-string">&quot;L&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>checkpoint = <span class="hljs-string">&quot;BAAI/seggpt-vit-large&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegGptModel.from_pretrained(checkpoint)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = SegGptImageProcessor.from_pretrained(checkpoint)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image_input, prompt_images=image_prompt, prompt_masks=mask_prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(outputs.last_hidden_state.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">56</span>, <span class="hljs-number">28</span>, <span class="hljs-number">1024</span>]`,wrap:!1}}),{c(){n=d("p"),n.textContent=w,l=a(),g(c.$$.fragment)},l(s){n=p(s,"P",{"data-svelte-h":!0}),T(n)!=="svelte-kvfsh7"&&(n.textContent=w),l=r(s),h(c.$$.fragment,s)},m(s,v){i(s,n,v),i(s,l,v),f(c,s,v),y=!0},p:Se,i(s){y||(u(c.$$.fragment,s),y=!0)},o(s){_(c.$$.fragment,s),y=!1},d(s){s&&(o(n),o(l)),b(c,s)}}}function Nt(M){let n,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=w},l(l){n=p(l,"P",{"data-svelte-h":!0}),T(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(l,c){i(l,n,c)},p:Se,d(l){l&&o(n)}}}function Bt(M){let n,w="Examples:",l,c,y;return c=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlZ0dwdEltYWdlUHJvY2Vzc29yJTJDJTIwU2VnR3B0Rm9ySW1hZ2VTZWdtZW50YXRpb24lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQWltYWdlX2lucHV0X3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRmJhYWl2aXNpb24lMkZQYWludGVyJTJGbWFpbiUyRlNlZ0dQVCUyRlNlZ0dQVF9pbmZlcmVuY2UlMkZleGFtcGxlcyUyRmhtYmJfMi5qcGclMjIlMEFpbWFnZV9wcm9tcHRfdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGYmFhaXZpc2lvbiUyRlBhaW50ZXIlMkZtYWluJTJGU2VnR1BUJTJGU2VnR1BUX2luZmVyZW5jZSUyRmV4YW1wbGVzJTJGaG1iYl8xLmpwZyUyMiUwQW1hc2tfcHJvbXB0X3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRmJhYWl2aXNpb24lMkZQYWludGVyJTJGbWFpbiUyRlNlZ0dQVCUyRlNlZ0dQVF9pbmZlcmVuY2UlMkZleGFtcGxlcyUyRmhtYmJfMV90YXJnZXQucG5nJTIyJTBBJTBBaW1hZ2VfaW5wdXQlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldChpbWFnZV9pbnB1dF91cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBaW1hZ2VfcHJvbXB0JTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQoaW1hZ2VfcHJvbXB0X3VybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEFtYXNrX3Byb21wdCUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KG1hc2tfcHJvbXB0X3VybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdykuY29udmVydCglMjJMJTIyKSUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJCQUFJJTJGc2VnZ3B0LXZpdC1sYXJnZSUyMiUwQW1vZGVsJTIwJTNEJTIwU2VnR3B0Rm9ySW1hZ2VTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwU2VnR3B0SW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlX2lucHV0JTJDJTIwcHJvbXB0X2ltYWdlcyUzRGltYWdlX3Byb21wdCUyQyUyMHByb21wdF9tYXNrcyUzRG1hc2tfcHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBcmVzdWx0JTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19zZW1hbnRpY19zZWdtZW50YXRpb24ob3V0cHV0cyUyQyUyMHRhcmdldF9zaXplcyUzRCU1QmltYWdlX2lucHV0LnNpemUlNUIlM0ElM0EtMSU1RCU1RCklNUIwJTVEJTBBcHJpbnQobGlzdChyZXN1bHQuc2hhcGUpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegGptImageProcessor, SegGptForImageSegmentation
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>image_input_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_2.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_prompt_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_1.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt_url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/baaivision/Painter/main/SegGPT/SegGPT_inference/examples/hmbb_1_target.png&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>image_input = Image.<span class="hljs-built_in">open</span>(requests.get(image_input_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_prompt = Image.<span class="hljs-built_in">open</span>(requests.get(image_prompt_url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_prompt = Image.<span class="hljs-built_in">open</span>(requests.get(mask_prompt_url, stream=<span class="hljs-literal">True</span>).raw).convert(<span class="hljs-string">&quot;L&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>checkpoint = <span class="hljs-string">&quot;BAAI/seggpt-vit-large&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = SegGptForImageSegmentation.from_pretrained(checkpoint)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = SegGptImageProcessor.from_pretrained(checkpoint)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image_input, prompt_images=image_prompt, prompt_masks=mask_prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>result = image_processor.post_process_semantic_segmentation(outputs, target_sizes=[image_input.size[::-<span class="hljs-number">1</span>]])[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-built_in">list</span>(result.shape))
[<span class="hljs-number">170</span>, <span class="hljs-number">297</span>]`,wrap:!1}}),{c(){n=d("p"),n.textContent=w,l=a(),g(c.$$.fragment)},l(s){n=p(s,"P",{"data-svelte-h":!0}),T(n)!=="svelte-kvfsh7"&&(n.textContent=w),l=r(s),h(c.$$.fragment,s)},m(s,v){i(s,n,v),i(s,l,v),f(c,s,v),y=!0},p:Se,i(s){y||(u(c.$$.fragment,s),y=!0)},o(s){_(c.$$.fragment,s),y=!1},d(s){s&&(o(n),o(l)),b(c,s)}}}function Ft(M){let n,w,l,c,y,s,v,Ie,Y,pt='The SegGPT model was proposed in <a href="https://arxiv.org/abs/2304.03284" rel="nofollow">SegGPT: Segmenting Everything In Context</a> by Xinlong Wang, Xiaosong Zhang, Yue Cao, Wen Wang, Chunhua Shen, Tiejun Huang. SegGPT employs a decoder-only Transformer that can generate a segmentation mask given an input image, a prompt image and its corresponding prompt mask. The model achieves remarkable one-shot results with 56.1 mIoU on COCO-20 and 85.6 mIoU on FSS-1000.',Ue,E,gt="The abstract from the paper is the following:",$e,Q,ht="<em>We present SegGPT, a generalist model for segmenting everything in context. We unify various segmentation tasks into a generalist in-context learning framework that accommodates different kinds of segmentation data by transforming them into the same format of images. The training of SegGPT is formulated as an in-context coloring problem with random color mapping for each data sample. The objective is to accomplish diverse tasks according to the context, rather than relying on specific colors. After training, SegGPT can perform arbitrary segmentation tasks in images or videos via in-context inference, such as object instance, stuff, part, contour, and text. SegGPT is evaluated on a broad range of tasks, including few-shot semantic segmentation, video object segmentation, semantic segmentation, and panoptic segmentation. Our results show strong capabilities in segmenting in-domain and out-of</em>",Ce,q,ft="Tips:",xe,L,ut='<li>One can use <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptImageProcessor">SegGptImageProcessor</a> to prepare image input, prompt and mask to the model.</li> <li>One can either use segmentation maps or RGB images as prompt masks. If using the latter make sure to set <code>do_convert_rgb=False</code> in the <code>preprocess</code> method.</li> <li>It’s highly advisable to pass <code>num_labels</code> when using <code>segmetantion_maps</code> (not considering background) during preprocessing and postprocessing with <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptImageProcessor">SegGptImageProcessor</a> for your use case.</li> <li>When doing inference with <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptForImageSegmentation">SegGptForImageSegmentation</a> if your <code>batch_size</code> is greater than 1 you can use feature ensemble across your images by passing <code>feature_ensemble=True</code> in the forward method.</li>',ze,A,_t="Here’s how to use the model for one-shot semantic segmentation:",Ze,O,We,D,bt=`This model was contributed by <a href="https://huggingface.co/EduardoPacheco" rel="nofollow">EduardoPacheco</a>.
The original code can be found <a href="%5B(https://github.com/baaivision/Painter/tree/main)">here</a>.`,je,K,ke,G,ee,Qe,he,yt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptModel">SegGptModel</a>. It is used to instantiate a SegGPT
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the SegGPT
<a href="https://huggingface.co/BAAI/seggpt-vit-large" rel="nofollow">BAAI/seggpt-vit-large</a> architecture.`,qe,fe,Tt=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Le,j,Ve,te,Ne,J,oe,Ae,ue,wt="Constructs a SegGpt image processor.",Oe,k,ne,De,_e,vt="Preprocess an image or batch of images.",Ke,V,se,et,be,Gt=`Converts the output of <code>SegGptImageSegmentationOutput</code> into segmentation maps. Only supports
PyTorch.`,Be,ae,Fe,U,re,tt,ye,Jt=`The bare SegGpt Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,ot,S,ie,nt,Te,Mt='The <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptModel">SegGptModel</a> forward method, overrides the <code>__call__</code> special method.',st,N,at,B,Pe,le,Re,$,ce,rt,we,St=`SegGpt model with a decoder on top for one-shot image segmentation.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,it,I,me,lt,ve,It='The <a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptForImageSegmentation">SegGptForImageSegmentation</a> forward method, overrides the <code>__call__</code> special method.',ct,F,mt,P,Xe,de,He,Me,Ye;return y=new Je({props:{title:"SegGPT",local:"seggpt",headingTag:"h1"}}),v=new Je({props:{title:"Overview",local:"overview",headingTag:"h2"}}),O=new Ee({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwU2VnR3B0SW1hZ2VQcm9jZXNzb3IlMkMlMjBTZWdHcHRGb3JJbWFnZVNlZ21lbnRhdGlvbiUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJCQUFJJTJGc2VnZ3B0LXZpdC1sYXJnZSUyMiUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMFNlZ0dwdEltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQW1vZGVsJTIwJTNEJTIwU2VnR3B0Rm9ySW1hZ2VTZWdtZW50YXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBZGF0YXNldF9pZCUyMCUzRCUyMCUyMkVkdWFyZG9QYWNoZWNvJTJGRm9vZFNlZzEwMyUyMiUwQWRzJTIwJTNEJTIwbG9hZF9kYXRhc2V0KGRhdGFzZXRfaWQlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQSUyMyUyME51bWJlciUyMG9mJTIwbGFiZWxzJTIwaW4lMjBGb29kU2VnMTAzJTIwKG5vdCUyMGluY2x1ZGluZyUyMGJhY2tncm91bmQpJTBBbnVtX2xhYmVscyUyMCUzRCUyMDEwMyUwQSUwQWltYWdlX2lucHV0JTIwJTNEJTIwZHMlNUI0JTVEJTVCJTIyaW1hZ2UlMjIlNUQlMEFncm91bmRfdHJ1dGglMjAlM0QlMjBkcyU1QjQlNUQlNUIlMjJsYWJlbCUyMiU1RCUwQWltYWdlX3Byb21wdCUyMCUzRCUyMGRzJTVCMjklNUQlNUIlMjJpbWFnZSUyMiU1RCUwQW1hc2tfcHJvbXB0JTIwJTNEJTIwZHMlNUIyOSU1RCU1QiUyMmxhYmVsJTIyJTVEJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMGltYWdlcyUzRGltYWdlX2lucHV0JTJDJTIwJTBBJTIwJTIwJTIwJTIwcHJvbXB0X2ltYWdlcyUzRGltYWdlX3Byb21wdCUyQyUwQSUyMCUyMCUyMCUyMHNlZ21lbnRhdGlvbl9tYXBzJTNEbWFza19wcm9tcHQlMkMlMjAlMEElMjAlMjAlMjAlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEF0YXJnZXRfc2l6ZXMlMjAlM0QlMjAlNUJpbWFnZV9pbnB1dC5zaXplJTVCJTNBJTNBLTElNUQlNUQlMEFtYXNrJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yLnBvc3RfcHJvY2Vzc19zZW1hbnRpY19zZWdtZW50YXRpb24ob3V0cHV0cyUyQyUyMHRhcmdldF9zaXplcyUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SegGptImageProcessor, SegGptForImageSegmentation

checkpoint = <span class="hljs-string">&quot;BAAI/seggpt-vit-large&quot;</span>
image_processor = SegGptImageProcessor.from_pretrained(checkpoint)
model = SegGptForImageSegmentation.from_pretrained(checkpoint)

dataset_id = <span class="hljs-string">&quot;EduardoPacheco/FoodSeg103&quot;</span>
ds = load_dataset(dataset_id, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-comment"># Number of labels in FoodSeg103 (not including background)</span>
num_labels = <span class="hljs-number">103</span>

image_input = ds[<span class="hljs-number">4</span>][<span class="hljs-string">&quot;image&quot;</span>]
ground_truth = ds[<span class="hljs-number">4</span>][<span class="hljs-string">&quot;label&quot;</span>]
image_prompt = ds[<span class="hljs-number">29</span>][<span class="hljs-string">&quot;image&quot;</span>]
mask_prompt = ds[<span class="hljs-number">29</span>][<span class="hljs-string">&quot;label&quot;</span>]

inputs = image_processor(
    images=image_input, 
    prompt_images=image_prompt,
    segmentation_maps=mask_prompt, 
    num_labels=num_labels,
    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
)

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

target_sizes = [image_input.size[::-<span class="hljs-number">1</span>]]
mask = image_processor.post_process_semantic_segmentation(outputs, target_sizes, num_labels=num_labels)[<span class="hljs-number">0</span>]`,wrap:!1}}),K=new Je({props:{title:"SegGptConfig",local:"transformers.SegGptConfig",headingTag:"h2"}}),ee=new H({props:{name:"class transformers.SegGptConfig",anchor:"transformers.SegGptConfig",parameters:[{name:"hidden_size",val:" = 1024"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"image_size",val:" = [896, 448]"},{name:"patch_size",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"qkv_bias",val:" = True"},{name:"mlp_dim",val:" = None"},{name:"drop_path_rate",val:" = 0.1"},{name:"pretrain_image_size",val:" = 224"},{name:"decoder_hidden_size",val:" = 64"},{name:"use_relative_position_embeddings",val:" = True"},{name:"merge_index",val:" = 2"},{name:"intermediate_hidden_state_indices",val:" = [5, 11, 17, 23]"},{name:"beta",val:" = 0.01"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegGptConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.SegGptConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.SegGptConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.SegGptConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.SegGptConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.SegGptConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.SegGptConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.SegGptConfig.image_size",description:`<strong>image_size</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[896, 448]</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.SegGptConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.SegGptConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.SegGptConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.SegGptConfig.mlp_dim",description:`<strong>mlp_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The dimensionality of the MLP layer in the Transformer encoder. If unset, defaults to
<code>hidden_size</code> * 4.`,name:"mlp_dim"},{anchor:"transformers.SegGptConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The drop path rate for the dropout layers.`,name:"drop_path_rate"},{anchor:"transformers.SegGptConfig.pretrain_image_size",description:`<strong>pretrain_image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The pretrained size of the absolute position embeddings.`,name:"pretrain_image_size"},{anchor:"transformers.SegGptConfig.decoder_hidden_size",description:`<strong>decoder_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Hidden size for decoder.`,name:"decoder_hidden_size"},{anchor:"transformers.SegGptConfig.use_relative_position_embeddings",description:`<strong>use_relative_position_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use relative position embeddings in the attention layers.`,name:"use_relative_position_embeddings"},{anchor:"transformers.SegGptConfig.merge_index",description:`<strong>merge_index</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The index of the encoder layer to merge the embeddings.`,name:"merge_index"},{anchor:"transformers.SegGptConfig.intermediate_hidden_state_indices",description:`<strong>intermediate_hidden_state_indices</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[5, 11, 17, 23]</code>) &#x2014;
The indices of the encoder layers which we store as features for the decoder.`,name:"intermediate_hidden_state_indices"},{anchor:"transformers.SegGptConfig.beta",description:`<strong>beta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
Regularization factor for SegGptLoss (smooth-l1 loss).`,name:"beta"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/configuration_seggpt.py#L24"}}),j=new dt({props:{anchor:"transformers.SegGptConfig.example",$$slots:{default:[jt]},$$scope:{ctx:M}}}),te=new Je({props:{title:"SegGptImageProcessor",local:"transformers.SegGptImageProcessor",headingTag:"h2"}}),oe=new H({props:{name:"class transformers.SegGptImageProcessor",anchor:"transformers.SegGptImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegGptImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>(size[&quot;height&quot;], size[&quot;width&quot;])</code>. Can be overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.SegGptImageProcessor.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 448, &quot;width&quot;: 448}</code>):
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.SegGptImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the
<code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.SegGptImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.SegGptImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.SegGptImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.SegGptImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.SegGptImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.SegGptImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the prompt mask to RGB format. Can be overridden by the <code>do_convert_rgb</code> parameter in the
<code>preprocess</code> method.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/image_processing_seggpt.py#L98"}}),ne=new H({props:{name:"preprocess",anchor:"transformers.SegGptImageProcessor.preprocess",parameters:[{name:"images",val:": Union = None"},{name:"prompt_images",val:": Union = None"},{name:"prompt_masks",val:": Union = None"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": Optional = None"},{name:"num_labels",val:": Optional = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.SegGptImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to _preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.SegGptImageProcessor.preprocess.prompt_images",description:`<strong>prompt_images</strong> (<code>ImageInput</code>) &#x2014;
Prompt image to _preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"prompt_images"},{anchor:"transformers.SegGptImageProcessor.preprocess.prompt_masks",description:`<strong>prompt_masks</strong> (<code>ImageInput</code>) &#x2014;
Prompt mask from prompt image to _preprocess that specify prompt_masks value in the preprocessed output.
Can either be in the format of segmentation maps (no channels) or RGB images. If in the format of
RGB images, <code>do_convert_rgb</code> should be set to <code>False</code>. If in the format of segmentation maps, <code>num_labels</code>
specifying <code>num_labels</code> is recommended to build a palette to map the prompt mask from a single channel to
a 3 channel RGB. If <code>num_labels</code> is not specified, the prompt mask will be duplicated across the channel
dimension.`,name:"prompt_masks"},{anchor:"transformers.SegGptImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.SegGptImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Dictionary in the format <code>{&quot;height&quot;: h, &quot;width&quot;: w}</code> specifying the size of the output image after
resizing.`,name:"size"},{anchor:"transformers.SegGptImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
<code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BICUBIC</code>. Only has
an effect if <code>do_resize</code> is set to <code>True</code>. Doesn&#x2019;t apply to prompt mask as it is resized using nearest.`,name:"resample"},{anchor:"transformers.SegGptImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.SegGptImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.SegGptImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.SegGptImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.SegGptImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.SegGptImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the prompt mask to RGB format. If <code>num_labels</code> is specified, a palette will be built
to map the prompt mask from a single channel to a 3 channel RGB. If unset, the prompt mask is duplicated
across the channel dimension. Must be set to <code>False</code> if the prompt mask is already in RGB format.
num_labels &#x2014; (<code>int</code>, <em>optional</em>):
Number of classes in the segmentation task (excluding the background). If specified, a palette will be
built, assuming that class_idx 0 is the background, to map the prompt mask from a plain segmentation map
with no channels to a 3 channel RGB. Not specifying this will result in the prompt mask either being passed
through as is if it is already in RGB format (if <code>do_convert_rgb</code> is false) or being duplicated
across the channel dimension.`,name:"do_convert_rgb"},{anchor:"transformers.SegGptImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.SegGptImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.SegGptImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/image_processing_seggpt.py#L391"}}),se=new H({props:{name:"post_process_semantic_segmentation",anchor:"transformers.SegGptImageProcessor.post_process_semantic_segmentation",parameters:[{name:"outputs",val:""},{name:"target_sizes",val:": Optional = None"},{name:"num_labels",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegGptImageProcessor.post_process_semantic_segmentation.outputs",description:`<strong>outputs</strong> (<code>SegGptImageSegmentationOutput</code>) &#x2014;
Raw outputs of the model.`,name:"outputs"},{anchor:"transformers.SegGptImageProcessor.post_process_semantic_segmentation.target_sizes",description:`<strong>target_sizes</strong> (<code>List[Tuple[int, int]]</code>, <em>optional</em>) &#x2014;
List of length (batch_size), where each list item (<code>Tuple[int, int]</code>) corresponds to the requested
final size (height, width) of each prediction. If left to None, predictions will not be resized.`,name:"target_sizes"},{anchor:"transformers.SegGptImageProcessor.post_process_semantic_segmentation.num_labels",description:`<strong>num_labels</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of classes in the segmentation task (excluding the background). If specified, a palette will be
built, assuming that class_idx 0 is the background, to map prediction masks from RGB values to class
indices. This value should be the same used when preprocessing inputs.`,name:"num_labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/image_processing_seggpt.py#L542",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[torch.Tensor]</code> of length <code>batch_size</code>, where each item is a semantic
segmentation map of shape (height, width) corresponding to the target_sizes entry (if <code>target_sizes</code> is
specified). Each entry of each <code>torch.Tensor</code> correspond to a semantic class id.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>semantic_segmentation</p>
`}}),ae=new Je({props:{title:"SegGptModel",local:"transformers.SegGptModel",headingTag:"h2"}}),re=new H({props:{name:"class transformers.SegGptModel",anchor:"transformers.SegGptModel",parameters:[{name:"config",val:": SegGptConfig"}],parametersDescription:[{anchor:"transformers.SegGptModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptConfig">SegGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/modeling_seggpt.py#L716"}}),ie=new H({props:{name:"forward",anchor:"transformers.SegGptModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"prompt_pixel_values",val:": Tensor"},{name:"prompt_masks",val:": Tensor"},{name:"bool_masked_pos",val:": Optional = None"},{name:"feature_ensemble",val:": Optional = None"},{name:"embedding_type",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegGptModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SegGptModel.forward.prompt_pixel_values",description:`<strong>prompt_pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Prompt pixel values. Prompt pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a> for details.`,name:"prompt_pixel_values"},{anchor:"transformers.SegGptModel.forward.prompt_masks",description:`<strong>prompt_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Prompt mask. Prompt mask can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a> for
details.`,name:"prompt_masks"},{anchor:"transformers.SegGptModel.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.SegGptModel.forward.feature_ensemble",description:`<strong>feature_ensemble</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Boolean indicating whether to use feature ensemble or not. If <code>True</code>, the model will use feature ensemble
if we have at least two prompts. If <code>False</code>, the model will not use feature ensemble. This argument should
be considered when doing few-shot inference on an input image i.e. more than one prompt for the same image.`,name:"feature_ensemble"},{anchor:"transformers.SegGptModel.forward.embedding_type",description:`<strong>embedding_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Embedding type. Indicates whether the prompt is a semantic or instance embedding. Can be either
instance or semantic.`,name:"embedding_type"},{anchor:"transformers.SegGptModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegGptModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SegGptModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegGptModel.forward.labels",description:`<strong>labels</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>, <code>optional</code>) &#x2014;
Ground truth mask for input images.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/modeling_seggpt.py#L742",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.seggpt.modeling_seggpt.SegGptEncoderOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptConfig"
>SegGptConfig</a>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, patch_height, patch_width, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>hidden_states</strong> (<code>Tuple[torch.FloatTensor]</code>, <code>optional</code>, returned when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer)
of shape <code>(batch_size, patch_height, patch_width, hidden_size)</code>.</li>
<li><strong>attentions</strong> (<code>Tuple[torch.FloatTensor]</code>, <code>optional</code>, returned when <code>config.output_attentions=True</code>) — Tuple of <em>torch.FloatTensor</em> (one for each layer) of shape
<code>(batch_size, num_heads, seq_len, seq_len)</code>.</li>
<li><strong>intermediate_hidden_states</strong> (<code>Tuple[torch.FloatTensor]</code>, <code>optional</code>, returned when <code>config.intermediate_hidden_state_indices</code> is set) — Tuple of <code>torch.FloatTensor</code> of shape <code>(batch_size, patch_height, patch_width, hidden_size)</code>.
Each element in the Tuple corresponds to the output of the layer specified in <code>config.intermediate_hidden_state_indices</code>.
Additionaly, each feature passes through a LayerNorm.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.seggpt.modeling_seggpt.SegGptEncoderOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),N=new Ut({props:{$$slots:{default:[kt]},$$scope:{ctx:M}}}),B=new dt({props:{anchor:"transformers.SegGptModel.forward.example",$$slots:{default:[Vt]},$$scope:{ctx:M}}}),le=new Je({props:{title:"SegGptForImageSegmentation",local:"transformers.SegGptForImageSegmentation",headingTag:"h2"}}),ce=new H({props:{name:"class transformers.SegGptForImageSegmentation",anchor:"transformers.SegGptForImageSegmentation",parameters:[{name:"config",val:": SegGptConfig"}],parametersDescription:[{anchor:"transformers.SegGptForImageSegmentation.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptConfig">SegGptConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/modeling_seggpt.py#L907"}}),me=new H({props:{name:"forward",anchor:"transformers.SegGptForImageSegmentation.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"prompt_pixel_values",val:": Tensor"},{name:"prompt_masks",val:": Tensor"},{name:"bool_masked_pos",val:": Optional = None"},{name:"feature_ensemble",val:": Optional = None"},{name:"embedding_type",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.SegGptForImageSegmentation.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.SegGptForImageSegmentation.forward.prompt_pixel_values",description:`<strong>prompt_pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Prompt pixel values. Prompt pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a> for details.`,name:"prompt_pixel_values"},{anchor:"transformers.SegGptForImageSegmentation.forward.prompt_masks",description:`<strong>prompt_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Prompt mask. Prompt mask can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__call__">SegGptImageProcessor.<strong>call</strong>()</a> for
details.`,name:"prompt_masks"},{anchor:"transformers.SegGptForImageSegmentation.forward.bool_masked_pos",description:`<strong>bool_masked_pos</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, num_patches)</code>, <em>optional</em>) &#x2014;
Boolean masked positions. Indicates which patches are masked (1) and which aren&#x2019;t (0).`,name:"bool_masked_pos"},{anchor:"transformers.SegGptForImageSegmentation.forward.feature_ensemble",description:`<strong>feature_ensemble</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Boolean indicating whether to use feature ensemble or not. If <code>True</code>, the model will use feature ensemble
if we have at least two prompts. If <code>False</code>, the model will not use feature ensemble. This argument should
be considered when doing few-shot inference on an input image i.e. more than one prompt for the same image.`,name:"feature_ensemble"},{anchor:"transformers.SegGptForImageSegmentation.forward.embedding_type",description:`<strong>embedding_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Embedding type. Indicates whether the prompt is a semantic or instance embedding. Can be either
instance or semantic.`,name:"embedding_type"},{anchor:"transformers.SegGptForImageSegmentation.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.SegGptForImageSegmentation.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.SegGptForImageSegmentation.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.SegGptForImageSegmentation.forward.labels",description:`<strong>labels</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>, <code>optional</code>) &#x2014;
Ground truth mask for input images.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/seggpt/modeling_seggpt.py#L922",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.seggpt.modeling_seggpt.SegGptImageSegmentationOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/seggpt#transformers.SegGptConfig"
>SegGptConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code>, <code>optional</code>, returned when <code>labels</code> is provided) — The loss value.</li>
<li><strong>pred_masks</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — The predicted masks.</li>
<li><strong>hidden_states</strong> (<code>Tuple[torch.FloatTensor]</code>, <code>optional</code>, returned when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer)
of shape <code>(batch_size, patch_height, patch_width, hidden_size)</code>.</li>
<li><strong>attentions</strong> (<code>Tuple[torch.FloatTensor]</code>, <code>optional</code>, returned when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape
<code>(batch_size, num_heads, seq_len, seq_len)</code>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.seggpt.modeling_seggpt.SegGptImageSegmentationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),F=new Ut({props:{$$slots:{default:[Nt]},$$scope:{ctx:M}}}),P=new dt({props:{anchor:"transformers.SegGptForImageSegmentation.forward.example",$$slots:{default:[Bt]},$$scope:{ctx:M}}}),de=new Wt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/seggpt.md"}}),{c(){n=d("meta"),w=a(),l=d("p"),c=a(),g(y.$$.fragment),s=a(),g(v.$$.fragment),Ie=a(),Y=d("p"),Y.innerHTML=pt,Ue=a(),E=d("p"),E.textContent=gt,$e=a(),Q=d("p"),Q.innerHTML=ht,Ce=a(),q=d("p"),q.textContent=ft,xe=a(),L=d("ul"),L.innerHTML=ut,ze=a(),A=d("p"),A.textContent=_t,Ze=a(),g(O.$$.fragment),We=a(),D=d("p"),D.innerHTML=bt,je=a(),g(K.$$.fragment),ke=a(),G=d("div"),g(ee.$$.fragment),Qe=a(),he=d("p"),he.innerHTML=yt,qe=a(),fe=d("p"),fe.innerHTML=Tt,Le=a(),g(j.$$.fragment),Ve=a(),g(te.$$.fragment),Ne=a(),J=d("div"),g(oe.$$.fragment),Ae=a(),ue=d("p"),ue.textContent=wt,Oe=a(),k=d("div"),g(ne.$$.fragment),De=a(),_e=d("p"),_e.textContent=vt,Ke=a(),V=d("div"),g(se.$$.fragment),et=a(),be=d("p"),be.innerHTML=Gt,Be=a(),g(ae.$$.fragment),Fe=a(),U=d("div"),g(re.$$.fragment),tt=a(),ye=d("p"),ye.innerHTML=Jt,ot=a(),S=d("div"),g(ie.$$.fragment),nt=a(),Te=d("p"),Te.innerHTML=Mt,st=a(),g(N.$$.fragment),at=a(),g(B.$$.fragment),Pe=a(),g(le.$$.fragment),Re=a(),$=d("div"),g(ce.$$.fragment),rt=a(),we=d("p"),we.innerHTML=St,it=a(),I=d("div"),g(me.$$.fragment),lt=a(),ve=d("p"),ve.innerHTML=It,ct=a(),g(F.$$.fragment),mt=a(),g(P.$$.fragment),Xe=a(),g(de.$$.fragment),He=a(),Me=d("p"),this.h()},l(e){const t=Zt("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(o),w=r(e),l=p(e,"P",{}),z(l).forEach(o),c=r(e),h(y.$$.fragment,e),s=r(e),h(v.$$.fragment,e),Ie=r(e),Y=p(e,"P",{"data-svelte-h":!0}),T(Y)!=="svelte-182h8ge"&&(Y.innerHTML=pt),Ue=r(e),E=p(e,"P",{"data-svelte-h":!0}),T(E)!=="svelte-vfdo9a"&&(E.textContent=gt),$e=r(e),Q=p(e,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-1wjy0wn"&&(Q.innerHTML=ht),Ce=r(e),q=p(e,"P",{"data-svelte-h":!0}),T(q)!=="svelte-axv494"&&(q.textContent=ft),xe=r(e),L=p(e,"UL",{"data-svelte-h":!0}),T(L)!=="svelte-1a0ivup"&&(L.innerHTML=ut),ze=r(e),A=p(e,"P",{"data-svelte-h":!0}),T(A)!=="svelte-7cf6zy"&&(A.textContent=_t),Ze=r(e),h(O.$$.fragment,e),We=r(e),D=p(e,"P",{"data-svelte-h":!0}),T(D)!=="svelte-ymhs7r"&&(D.innerHTML=bt),je=r(e),h(K.$$.fragment,e),ke=r(e),G=p(e,"DIV",{class:!0});var C=z(G);h(ee.$$.fragment,C),Qe=r(C),he=p(C,"P",{"data-svelte-h":!0}),T(he)!=="svelte-1by7zj7"&&(he.innerHTML=yt),qe=r(C),fe=p(C,"P",{"data-svelte-h":!0}),T(fe)!=="svelte-o55m63"&&(fe.innerHTML=Tt),Le=r(C),h(j.$$.fragment,C),C.forEach(o),Ve=r(e),h(te.$$.fragment,e),Ne=r(e),J=p(e,"DIV",{class:!0});var x=z(J);h(oe.$$.fragment,x),Ae=r(x),ue=p(x,"P",{"data-svelte-h":!0}),T(ue)!=="svelte-1agvcs2"&&(ue.textContent=wt),Oe=r(x),k=p(x,"DIV",{class:!0});var pe=z(k);h(ne.$$.fragment,pe),De=r(pe),_e=p(pe,"P",{"data-svelte-h":!0}),T(_e)!=="svelte-1x3yxsa"&&(_e.textContent=vt),pe.forEach(o),Ke=r(x),V=p(x,"DIV",{class:!0});var ge=z(V);h(se.$$.fragment,ge),et=r(ge),be=p(ge,"P",{"data-svelte-h":!0}),T(be)!=="svelte-1wij86i"&&(be.innerHTML=Gt),ge.forEach(o),x.forEach(o),Be=r(e),h(ae.$$.fragment,e),Fe=r(e),U=p(e,"DIV",{class:!0});var W=z(U);h(re.$$.fragment,W),tt=r(W),ye=p(W,"P",{"data-svelte-h":!0}),T(ye)!=="svelte-1fytdmv"&&(ye.innerHTML=Jt),ot=r(W),S=p(W,"DIV",{class:!0});var R=z(S);h(ie.$$.fragment,R),nt=r(R),Te=p(R,"P",{"data-svelte-h":!0}),T(Te)!=="svelte-1eqofs9"&&(Te.innerHTML=Mt),st=r(R),h(N.$$.fragment,R),at=r(R),h(B.$$.fragment,R),R.forEach(o),W.forEach(o),Pe=r(e),h(le.$$.fragment,e),Re=r(e),$=p(e,"DIV",{class:!0});var Ge=z($);h(ce.$$.fragment,Ge),rt=r(Ge),we=p(Ge,"P",{"data-svelte-h":!0}),T(we)!=="svelte-1u1qbk5"&&(we.innerHTML=St),it=r(Ge),I=p(Ge,"DIV",{class:!0});var X=z(I);h(me.$$.fragment,X),lt=r(X),ve=p(X,"P",{"data-svelte-h":!0}),T(ve)!=="svelte-1ennpmp"&&(ve.innerHTML=It),ct=r(X),h(F.$$.fragment,X),mt=r(X),h(P.$$.fragment,X),X.forEach(o),Ge.forEach(o),Xe=r(e),h(de.$$.fragment,e),He=r(e),Me=p(e,"P",{}),z(Me).forEach(o),this.h()},h(){Z(n,"name","hf:doc:metadata"),Z(n,"content",Pt),Z(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),Z($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){m(document.head,n),i(e,w,t),i(e,l,t),i(e,c,t),f(y,e,t),i(e,s,t),f(v,e,t),i(e,Ie,t),i(e,Y,t),i(e,Ue,t),i(e,E,t),i(e,$e,t),i(e,Q,t),i(e,Ce,t),i(e,q,t),i(e,xe,t),i(e,L,t),i(e,ze,t),i(e,A,t),i(e,Ze,t),f(O,e,t),i(e,We,t),i(e,D,t),i(e,je,t),f(K,e,t),i(e,ke,t),i(e,G,t),f(ee,G,null),m(G,Qe),m(G,he),m(G,qe),m(G,fe),m(G,Le),f(j,G,null),i(e,Ve,t),f(te,e,t),i(e,Ne,t),i(e,J,t),f(oe,J,null),m(J,Ae),m(J,ue),m(J,Oe),m(J,k),f(ne,k,null),m(k,De),m(k,_e),m(J,Ke),m(J,V),f(se,V,null),m(V,et),m(V,be),i(e,Be,t),f(ae,e,t),i(e,Fe,t),i(e,U,t),f(re,U,null),m(U,tt),m(U,ye),m(U,ot),m(U,S),f(ie,S,null),m(S,nt),m(S,Te),m(S,st),f(N,S,null),m(S,at),f(B,S,null),i(e,Pe,t),f(le,e,t),i(e,Re,t),i(e,$,t),f(ce,$,null),m($,rt),m($,we),m($,it),m($,I),f(me,I,null),m(I,lt),m(I,ve),m(I,ct),f(F,I,null),m(I,mt),f(P,I,null),i(e,Xe,t),f(de,e,t),i(e,He,t),i(e,Me,t),Ye=!0},p(e,[t]){const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),j.$set(C);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),N.$set(x);const pe={};t&2&&(pe.$$scope={dirty:t,ctx:e}),B.$set(pe);const ge={};t&2&&(ge.$$scope={dirty:t,ctx:e}),F.$set(ge);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),P.$set(W)},i(e){Ye||(u(y.$$.fragment,e),u(v.$$.fragment,e),u(O.$$.fragment,e),u(K.$$.fragment,e),u(ee.$$.fragment,e),u(j.$$.fragment,e),u(te.$$.fragment,e),u(oe.$$.fragment,e),u(ne.$$.fragment,e),u(se.$$.fragment,e),u(ae.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(N.$$.fragment,e),u(B.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(me.$$.fragment,e),u(F.$$.fragment,e),u(P.$$.fragment,e),u(de.$$.fragment,e),Ye=!0)},o(e){_(y.$$.fragment,e),_(v.$$.fragment,e),_(O.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(j.$$.fragment,e),_(te.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(N.$$.fragment,e),_(B.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(me.$$.fragment,e),_(F.$$.fragment,e),_(P.$$.fragment,e),_(de.$$.fragment,e),Ye=!1},d(e){e&&(o(w),o(l),o(c),o(s),o(Ie),o(Y),o(Ue),o(E),o($e),o(Q),o(Ce),o(q),o(xe),o(L),o(ze),o(A),o(Ze),o(We),o(D),o(je),o(ke),o(G),o(Ve),o(Ne),o(J),o(Be),o(Fe),o(U),o(Pe),o(Re),o($),o(Xe),o(He),o(Me)),o(n),b(y,e),b(v,e),b(O,e),b(K,e),b(ee),b(j),b(te,e),b(oe),b(ne),b(se),b(ae,e),b(re),b(ie),b(N),b(B),b(le,e),b(ce),b(me),b(F),b(P),b(de,e)}}}const Pt='{"title":"SegGPT","local":"seggpt","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"SegGptConfig","local":"transformers.SegGptConfig","sections":[],"depth":2},{"title":"SegGptImageProcessor","local":"transformers.SegGptImageProcessor","sections":[],"depth":2},{"title":"SegGptModel","local":"transformers.SegGptModel","sections":[],"depth":2},{"title":"SegGptForImageSegmentation","local":"transformers.SegGptForImageSegmentation","sections":[],"depth":2}],"depth":1}';function Rt(M){return Ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class At extends xt{constructor(n){super(),zt(this,n,Rt,Ft,$t,{})}}export{At as component};
