code: def _merge_object_prediction_pair(
      self,
      pred1: ObjectPrediction,
      pred2: ObjectPrediction,
  ) -> ObjectPrediction:
      shift_amount = pred1.bbox.shift_amount
      merged_bbox: BoundingBox = self._get_merged_bbox(pred1, pred2)
      merged_score: float = self._get_merged_score(pred1, pred2)
      merged_category: Category = self._get_merged_category(
          pred1, pred2
      )
      if pred1.mask and pred2.mask:
          merged_mask: Mask = self._get_merged_mask(pred1, pred2)
          bool_mask = merged_mask.bool_mask
          full_shape = merged_mask.full_shape
      else:
          bool_mask = None
          full_shape = None
      return ObjectPrediction(
          bbox=merged_bbox.to_xyxy(),
          score=merged_score,
          category_id=merged_category.id,
          category_name=merged_category.name,
          bool_mask=bool_mask,
          shift_amount=shift_amount,
          full_shape=full_shape,
      )
  
imports: import copy
  from typing import List
  import numpy
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.postprocess.utils import calculate_area, calculate_box_union, calculate_intersection_area
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 2 for calling the UnionMergePostprocess obj's underlying member method code with example usage: obj._merge_object_prediction_pair(pred1, pred2) and returns: ObjectPrediction