code: def generate_binary_prediction(report):
      scores = torch.nn.functional.softmax(report.scores, dim=1)
      _, labels = torch.max(scores, 1)
      # Probability that the meme is hateful, (1)
      probabilities = scores[:, 1]
  
      predictions = []
  
      for idx, image_id in enumerate(report.id):
          proba = probabilities[idx].item()
          label = labels[idx].item()
          predictions.append(
              {"id": image_id.item(), "proba": proba, "label": label}
          )
      return predictions
  
imports: import copy
  import os
  import numpy
  import omegaconf
  import torch
  from mmf.common.sample import Sample
  from mmf.datasets.mmf_dataset import MMFDataset
  from mmf.utils.general import get_mmf_root
  from mmf.utils.visualize import visualize_images
  from PIL import Image
  from torchvision import transforms
label_desc: Use image node_id 1 for calling a global function with example usage: generate_binary_prediction(report) and returns: predictions