class_docstr: ⚡ Constructor for the DETR Object Detection Model
  Warning: Currently support only DETR
class_docstr_tok: ["\u26a1","Constructor","for","the","DETR","Object","Detection","Model","Warning",":","Currently","support","only","DETR"]
code: def common_step(self, batch, batch_idx):
      # Get image
      pixel_values = batch["pixel_values"]
      pixel_mask = batch["pixel_mask"]
  
      # Get labels
      labels = [
          {k: v.to(self.device) for k, v in t.items()}
          for t in batch["labels"]
      ]
  
      # Predict
      outputs = self.model(
          pixel_values=pixel_values,
          pixel_mask=pixel_mask,
          labels=labels,
      )
  
      # Loss
      loss = outputs.loss
      loss_dict = outputs.loss_dict
  
      return loss, loss_dict
  
file_path: HugsVision/build/lib/hugsvision/models/Detr.py
imports: import torch
  import pytorch_lightning
  from transformers import DetrConfig, DetrForObjectDetection
label_desc: Use image node_id 3 for calling the Detr obj's underlying member method code with example usage: obj.common_step(batch, batch_idx) and returns: loss,  loss_dict