code: def __getitem__(self, idx):
      img, target = self.coco_dataset[idx]
      image_id = self.coco_dataset.ids[idx]
      target = {"image_id": image_id, "annotations": target}
      img, target = self._load_coco_annotations(
          img, target, load_attributes=self.config.load_attributes
      )
      transform_out = self.detection_image_and_target_processor(
          {
              "img": img,
              "target": target,
              "dataset_type": self._dataset_type,
          }
      )
      img = transform_out["img"]
      target = transform_out["target"]
  
      current_sample = Sample()
      current_sample.image_id = torch.tensor(image_id, dtype=torch.long)
      current_sample.image = img
      current_sample.targets_enc = object_to_byte_tensor(
          target, max_size=self.config.max_target_enc_size
      )
      current_sample.orig_size = target["orig_size"].clone().detach()
  
      return current_sample
  
file_path: mmf/mmf/datasets/builders/coco/detection_dataset.py
imports: import os
  from typing import Dict
  import torch
  import torch.nn.functional
  import torchvision
  from mmf.common.sample import Sample
  from mmf.datasets.base_dataset import BaseDataset
  from mmf.utils.distributed import gather_tensor_along_batch, object_to_byte_tensor
  from torch import nn, Tensor
label_desc: Use image node_id 2 for calling the DetectionCOCODataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: current_sample