code: def guess_image_dims(img):
      if len(img.shape) == 1:
          # assume 2D monochrome (MNIST)
          width = height = round(math.sqrt(img.shape[0]))
          if width * height != img.shape[0]:
              # assume 3 channels (CFAR, ImageNet)
              width = height = round(math.sqrt(img.shape[0] / 3))
              if width * height * 3 != img.shape[0]:
                  raise ValueError(
                      "Cannot guess image dimensions for linearized pixels"
                  )
              return (3, height, width)
          return (1, height, width)
      return img.shape
  
file_path: tensorwatch/tensorwatch/image_utils.py
imports: import numpy
  import math
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: guess_image_dims(img) and returns: img, int,  height,  width, int,  height,  width