code: def encode(bimask):
      if len(bimask.shape) == 3:
          return _mask.encode(bimask)
      elif len(bimask.shape) == 2:
          h, w = bimask.shape
          return _mask.encode(bimask.reshape((h, w, 1), order="F"))[0]
  
imports: from rcnn.pycocotools import _mask
label_desc: Use image node_id 1 for calling a global function with example usage: encode(bimask) and returns: _mask, _mask