class_docstr: This is a thin wrapper around D2's backbone to provide padding masking
class_docstr_tok: ["This","is","a","thin","wrapper","around","D2","'s","backbone","to","provide","padding","masking"]
code: def forward(self, images):
      features = self.backbone(images.tensor)
      masks = self.mask_out_padding(
          [
              features_per_level.shape
              for features_per_level in features.values()
          ],
          images.image_sizes,
          images.tensor.device,
      )
      assert len(features) == len(masks)
      for i, k in enumerate(features.keys()):
          features[k] = NestedTensor(features[k], masks[i])
      return features
  
imports: import logging
  import math
  from typing import List
  import numpy
  import torch
  import torch.distributed
  import torch.nn.functional
  from scipy.optimize import linear_sum_assignment
  from torch import nn
  from detectron2.layers import ShapeSpec
  from detectron2.modeling import META_ARCH_REGISTRY, build_backbone, detector_postprocess
  from detectron2.structures import Boxes, ImageList, Instances, BitMasks, PolygonMasks
  from detectron2.utils.logger import log_first_n
  from fvcore.nn import giou_loss, smooth_l1_loss
  from models.backbone import Joiner
  from models.detr import DETR, SetCriterion
  from models.matcher import HungarianMatcher
  from models.position_encoding import PositionEmbeddingSine
  from models.transformer import Transformer
  from models.segmentation import DETRsegm, PostProcessPanoptic, PostProcessSegm
  from util.box_ops import box_cxcywh_to_xyxy, box_xyxy_to_cxcywh
  from util.misc import NestedTensor
  from datasets.coco import convert_coco_poly_to_mask
label_desc: Use image node_id 2 for calling the MaskedBackbone obj's underlying member method code with example usage: obj.forward(images) and returns: features