code: def get_bool_mask_from_coco_segmentation(
      coco_segmentation, width, height
  ):
      """
      Convert coco segmentation to 2D boolean mask of given height and width
      """
      size = [height, width]
      points = [
          np.array(point).reshape(-1, 2).round().astype(int)
          for point in coco_segmentation
      ]
      bool_mask = np.zeros(size)
      bool_mask = cv2.fillPoly(bool_mask, points, 1)
      bool_mask.astype(bool)
      return bool_mask
  
imports: import copy
  import os
  import random
  import time
  from typing import List, Optional, Union
  import cv2
  import numpy
  import requests
  from PIL import Image
  from sahi.utils.file import Path
label_desc: Use image node_id 12 for calling a global function with example usage: get_bool_mask_from_coco_segmentation(coco_segmentation, width, height) and returns: bool_mask