code: def convert_to_abs_coords(targets, img_shape):
      height, width = img_shape[-2:]
      for idx, t in enumerate(targets):
          targets[idx]["boxes"][:, 0::2] = (
              t["boxes"][:, 0::2] * width
          ).round()
          targets[idx]["boxes"][:, 1::2] = (
              t["boxes"][:, 1::2] * height
          ).round()
  
      targets = [
          {
              "boxes": torch.from_numpy(t["boxes"]).to(
                  dtype=torch.float32
              ),
              "labels": torch.tensor(t["labels"]).to(dtype=torch.long),
          }
          for t in targets
      ]
  
      return targets
  
imports: import os
  import datetime
  import logging
  import multiprocessing
  import time
  import numpy
  import torch
  import torch.optim
  import wandb
  from torch.optim.lr_scheduler import MultiplicativeLR, StepLR
  from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
  from torchvision.transforms import ColorJitter, Compose, GaussianBlur
  from tqdm.auto import tqdm
  from doctr import transforms
  from doctr.datasets import DocArtefacts
  from doctr.models import login_to_hub, obj_detection, push_to_hf_hub
  from doctr.utils import DetectionMetric
  from utils import EarlyStopper, plot_recorder, plot_samples
label_desc: Use image node_id 2 for calling a global function with example usage: convert_to_abs_coords(targets, img_shape) and returns: targets