code: def mask_to_box_coordinate(
      mask, normalize=False, format="xyxy", dtype="float32"
  ):
      """
      Compute the bounding boxes around the provided mask.
      Args:
          mask (Tensor:bool): [b, c, h, w]
  
      Returns:
          bbox (Tensor): [b, c, 4]
      """
      assert mask.ndim == 4
      assert format in ["xyxy", "xywh"]
      if mask.sum() == 0:
          return paddle.zeros(
              [mask.shape[0], mask.shape[1], 4], dtype=dtype
          )
  
      h, w = mask.shape[-2:]
      y, x = paddle.meshgrid(
          paddle.arange(end=h, dtype=dtype),
          paddle.arange(end=w, dtype=dtype),
      )
  
      x_mask = x * mask
      x_max = x_mask.flatten(-2).max(-1) + 1
      x_min = (
          paddle.where(mask, x_mask, paddle.to_tensor(1e8))
          .flatten(-2)
          .min(-1)
      )
  
      y_mask = y * mask
      y_max = y_mask.flatten(-2).max(-1) + 1
      y_min = (
          paddle.where(mask, y_mask, paddle.to_tensor(1e8))
          .flatten(-2)
          .min(-1)
      )
      out_bbox = paddle.stack([x_min, y_min, x_max, y_max], axis=-1)
      if normalize:
          out_bbox /= paddle.to_tensor([w, h, w, h]).astype(dtype)
  
      return (
          out_bbox
          if format == "xyxy"
          else bbox_xyxy_to_cxcywh(out_bbox)
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ..bbox_utils import bbox_overlaps
label_desc: Use image node_id 11 for calling a global function with example usage: mask_to_box_coordinate(mask, normalize, format, dtype) and returns: unknown, paddle