code: def iSAID_convert_from_color(arr_3d, palette=iSAID_invert_palette):
      """RGB-color encoding to grayscale labels."""
      arr_2d = np.zeros(
          (arr_3d.shape[0], arr_3d.shape[1]), dtype=np.uint8
      )
  
      for c, i in palette.items():
          m = np.all(arr_3d == np.array(c).reshape(1, 1, 3), axis=2)
          arr_2d[m] = i
  
      return arr_2d
  
file_path: PaddleSeg/contrib/RSSegBenchmark/data/prepare_isaid.py
imports: import argparse
  import glob
  import os
  import os.path
  import shutil
  import tempfile
  import zipfile
  import cv2
  import numpy
  from tqdm import tqdm
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: iSAID_convert_from_color(arr_3d, palette) and returns: arr_2d