code: def get_labels_with_sizes(x):
      obj_sizes = np.bincount(x.flatten())
      labels = np.nonzero(obj_sizes)[0].tolist()
      labels = [x for x in labels if x != 0]
      return labels, obj_sizes[labels].tolist()
  
file_path: PaddleSeg/EISeg/eiseg/util/misc.py
imports: import paddle
  import numpy
  import pickle
label_desc: Use image node_id 8 for calling a global function with example usage: get_labels_with_sizes(x) and returns: labels,  obj_sizes