code: def generate_preds(args, outputs, target_size, threshold=0.5):
      preds = []
  
      for output in outputs:
          if args.pad_mode == "resize":
              cropped = resize_image(output, target_size=target_size)
          else:
              cropped = crop_image(output, target_size=target_size)
          pred = binarize(cropped, threshold)
          preds.append(pred)
  
      return preds
  
imports: import os
  import argparse
  import time
  import torch
  import torch.nn
  import torch.optim
  import torch.nn.functional
  from torch.optim.lr_scheduler import CosineAnnealingLR, ReduceLROnPlateau
  from loader import get_train_loaders, add_depth_channel
  from models import UNetResNetV4, UNetResNetV5, UNetResNetV6
  from lovasz_losses import lovasz_hinge
  from focal_loss import FocalLoss2d
  from postprocessing import binarize, crop_image, resize_image
  from metrics import intersection_over_union, intersection_over_union_thresholds
  import settings
label_desc: Use image node_id 5 for calling a global function with example usage: generate_preds(args, outputs, target_size, threshold) and returns: preds