code: def img2arr(img):
      # assumes color image
      # returns an array suitable for sending to visdom
      return (
          np.array(img.getdata(), np.uint8)
          .reshape(img.size + (3,))
          .transpose((2, 0, 1))
      )
  
file_path: pyro/examples/air/viz.py
imports: import math
  from collections import namedtuple
  import numpy
  from PIL import Image, ImageDraw
label_desc: Use image node_id 3 for calling a global function with example usage: img2arr(img) and returns: np