code: def test_mask_to_bbox(self):
      mask = np.array(
          [
              [0, 0, 0, 0, 0, 0],
              [0, 0, 1, 1, 0, 0],
              [0, 0, 0, 0, 0, 0],
          ]
      ).astype(np.float32)
      expected_bbox_xywh = [2, 1, 2, 1]
      bbox_xywh = get_bbox_from_mask(mask, 0.5)
      self.assertClose(bbox_xywh, expected_bbox_xywh)
  
file_path: pytorch3d/tests/implicitron/test_bbox.py
imports: import unittest
  import numpy
  import torch
  from pytorch3d.implicitron.dataset.utils import bbox_xywh_to_xyxy, bbox_xyxy_to_xywh, clamp_box_to_image_bounds_and_round, crop_around_box, get_1d_bounds, get_bbox_from_mask, get_clamp_bbox, rescale_bbox, resize_image
  from tests.common_testing import TestCaseMixin
label_desc: Use image node_id 4 for calling the TestBBox obj's underlying member method code with example usage: obj.test_mask_to_bbox() without return types