code: def collate_fn(x):
      x, f = zip(*x)
      i = list(map(lambda t: t.shape[1], x))
      x = torch.as_tensor(np.swapaxes(np.concatenate(x, 1), 0, 1))
      return x, f, i
  
imports: import os
  import numpy
  import torch
  import torchvision
  import wget
  import gradio
label_desc: Use image node_id 1 for calling a global function with example usage: collate_fn(x) and returns: x,  f,  i