code: def size(self):
          
          if isinstance(self.data, numpy.ndarray):
              h, w = self.data.shape[:2]
          elif isinstance(self.data, PIL.Image.Image):
              w, h = self.data.size()
          else:
              raise RuntimeError(
                  'Cannot get size of "%s"' % self.data.__class__.__name__)
          return h, w
docs: Return image dimensions (height, width)