code: def all_boxes(array, classes=None, background=None):
      if classes is not None:
          labels = classes
          assert background not in labels
      else:
          if background is None:
              background = 0
          labels = list(np.unique(array))
          try:
              labels.remove(background)
          except ValueError:
              pass
  
      objects = []
      for lbl in labels:
          mask = array == lbl
          cc, _ = scipy.ndimage.measurements.label(mask)
          objs = scipy.ndimage.find_objects(cc)
          if len(objs) > 0 and objs[0] is not None:
              objects += objs
      return objects2boxes(objects, array.shape)
  
imports: from nose_utils import assert_raises
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.ops
  import numpy
  import scipy.ndimage
  import scipy.ndimage.measurements
  import random
  from test_utils import check_batch, np_type_to_dali
  from nose.tools import nottest
  from nose.plugins.attrib import attr
label_desc: Use image node_id 9 for calling a global function with example usage: all_boxes(array, classes, background) and returns: objects2boxes