code: def wandb_process(
      x: TensorImage, y: TensorMask, samples, outs, preds
  ):
      res = []
      codes = getattr(outs[0][0], "codes", None)
      if codes is not None:
          class_labels = [
              {"name": name, "id": id} for id, name in enumerate(codes)
          ]
      else:
          class_labels = [
              {"name": i, "id": i} for i in range(preds.shape[1])
          ]
      table = wandb.Table(
          columns=["Input Image", "Ground_Truth", "Predictions"]
      )
      for (image, label), pred_label in zip(samples, outs):
          img = image.permute(1, 2, 0)
          table.add_data(
              wandb.Image(img),
              wandb.Image(
                  img,
                  masks={
                      "Ground_Truth": {
                          "mask_data": label.numpy().astype(np.uint8)
                      }
                  },
                  classes=class_labels,
              ),
              wandb.Image(
                  img,
                  masks={
                      "Prediction": {
                          "mask_data": pred_label[0]
                          .numpy()
                          .astype(np.uint8)
                      }
                  },
                  classes=class_labels,
              ),
          )
      return {"Prediction_Samples": table}
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from ..text.data import TensorText
  from ..tabular.all import TabularDataLoaders, Tabular
  from .hook import total_params
  from .tracker import SaveModelCallback
  import wandb
label_desc: Use image node_id 11 for calling a global function with example usage: wandb_process(x, y, samples, outs, preds) and returns: dict