class_docstr: Encapsulate the results obtained by a Segmentation model.
  
  Args:
      logits: Results logits with shape :math:`(B, C, H, W)`, where :math:`C` refers to the number of predicted masks
      scores: The scores from the logits. Shape :math:`(B, C)`
      mask_threshold: The threshold value to generate the `binary_masks` from the `logits`
class_docstr_tok: ["Encapsulate","the","results","obtained","by","a","Segmentation","model",".","Args",":","logits",":","Results","logits","with","shape",":","math",":","`","(","B",",","C",",","H",",","W",")","`",",","where",":","math",":","`","C","`","refers","to","the","number","of","predicted","masks","scores",":","The","scores","from","the","logits",".","Shape",":","math",":","`","(","B",",","C",")","`","mask_threshold",":","The","threshold","value","to","generate","the","`","binary_masks","`","from","the","`","logits","`"]
docstr: Remove padding and upscale the logits to the original image size.
  
  Resize to image encoder input -> remove padding (bottom and right) -> Resize to original size
  
  .. note:: This method set a internal `original_res_logits` which will be used if available for the binary masks.
  
  Args:
      input_size: The size of the image input to the model, in (H, W) format. Used to remove padding.
      original_size: The original size of the image before resizing for input to the model, in (H, W) format.
      image_size_encoder: The size of the input image for image encoder, in (H, W) format. Used to resize the
                          logits back to encoder resolution before remove the padding.
  
  Returns:
      Batched logits in :math:`(K, C, H, W)` format, where (H, W) is given by original_size.
docstr_tok: ["Remove","padding","and","upscale","the","logits","to","the","original","image","size",".","Resize","to","image","encoder","input","-",">","remove","padding","(","bottom","and","right",")","-",">","Resize","to","original","size","..","note",":",":","This","method","set","a","internal","`","original_res_logits","`","which","will","be","used","if","available","for","the","binary","masks",".","Args",":","input_size",":","The","size","of","the","image","input","to","the","model",",","in","(","H",",","W",")","format",".","Used","to","remove","padding",".","original_size",":","The","original","size","of","the","image","before","resizing","for","input","to","the","model",",","in","(","H",",","W",")","format",".","image_size_encoder",":","The","size","of","the","input","image","for","image","encoder",",","in","(","H",",","W",")","format",".","Used","to","resize","the","logits","back","to","encoder","resolution","before","remove","the","padding",".","Returns",":","Batched","logits","in",":","math",":","`","(","K",",","C",",","H",",","W",")","`","format",",","where","(","H",",","W",")","is","given","by","original_size","."]
code: def original_res_logits(
      self,
      input_size: tuple[int, int],
      original_size: tuple[int, int],
      image_size_encoder: Optional[tuple[int, int]],
  ) -> Tensor:
      """Remove padding and upscale the logits to the original image size.
  
      Resize to image encoder input -> remove padding (bottom and right) -> Resize to original size
  
      .. note:: This method set a internal `original_res_logits` which will be used if available for the binary masks.
  
      Args:
          input_size: The size of the image input to the model, in (H, W) format. Used to remove padding.
          original_size: The original size of the image before resizing for input to the model, in (H, W) format.
          image_size_encoder: The size of the input image for image encoder, in (H, W) format. Used to resize the
                              logits back to encoder resolution before remove the padding.
  
      Returns:
          Batched logits in :math:`(K, C, H, W)` format, where (H, W) is given by original_size.
      """
      x = self.logits
  
      if isinstance(image_size_encoder, tuple):
          x = resize(
              x,
              size=image_size_encoder,
              interpolation="bilinear",
              align_corners=False,
              antialias=False,
          )
      x = x[..., : input_size[0], : input_size[1]]
  
      x = resize(
          x,
          size=original_size,
          interpolation="bilinear",
          align_corners=False,
          antialias=False,
      )
  
      self._original_res_logits = x
      return self._original_res_logits
  
file_path: kornia/kornia/contrib/models/structures.py
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import Optional
  from kornia.core import Tensor
  from kornia.core.check import KORNIA_CHECK
  from kornia.geometry.transform import resize
label_desc: Use image node_id 2 for calling the SegmentationResults obj's underlying member method code with example usage: obj.original_res_logits(input_size, original_size, image_size_encoder) and returns: self