code: def generate_preds(outputs, target_size, pad_mode, threshold=0.5):
      preds = []
  
      for output in outputs:
          # print(output.shape)
          if 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 glob
  import argparse
  import numpy
  import torch
  import torch.optim
  import torch.nn.functional
  import settings
  from loader import get_test_loader, add_depth_channel
  from models import UNetResNetV4, UNetResNetV5, UNetResNetV6, UNet7, UNet8
  from postprocessing import crop_image, binarize, resize_image
  from metrics import intersection_over_union, intersection_over_union_thresholds
  from utils import create_submission
label_desc: Use image node_id 5 for calling a global function with example usage: generate_preds(outputs, target_size, pad_mode, threshold) and returns: preds