code: def get_merged_mask(
      pred1: ObjectPrediction, pred2: ObjectPrediction
  ) -> Mask:
      mask1 = pred1.mask
      mask2 = pred2.mask
      union_mask = np.logical_or(mask1.bool_mask, mask2.bool_mask)
      return Mask(
          bool_mask=union_mask,
          full_shape=mask1.full_shape,
          shift_amount=mask1.shift_amount,
      )
  
imports: from collections.abc import Sequence
  from typing import List, Union
  import numpy
  import torch
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 9 for calling a global function with example usage: get_merged_mask(pred1, pred2) and returns: Mask